Miscellany
public text v1 · immutableclass Adaptor
def initialize(clientbucket = '/var/lib/puppet/clientbucket')
@clientbucket = clientbucket
end
def get_newest_contents_file(filename)
regex = Regexp.compile(Regexp.escape(filename))
Dir.chdir(@clientbucket)
Dir['**/paths'].each do |path|
File.open(path) do |contents|
contents.grep(regex).max { |a,b| File.mtime(a) <=> File.mtime(b) }
puts path
end
end
end
end
end