kenpratt/dbox — pull request #4 by spatten (2013-09-11 05:16:32+00:00)
Title: Adding dbox metadata <remote_path>

Hey Ken,

I needed to get the metadata on the directories in staging so I could delete old directories. Here's a pull request for the changes.

Example code using it:

metadata = Dbox.metadata("staging_book_repos")

to_delete = metadata["contents"].select do |data|
DateTime.parse(data["modified"]) + 7 < DateTime.now
end.map do |data|
data['path']
end

to_delete.each do |path|
puts "deleting #{path}"
Dbox.delete(path)
end