Skip to content

Instantly share code, notes, and snippets.

@TrevorS
Created July 30, 2014 15:59
Show Gist options
  • Save TrevorS/8a188edfa5316f85e5cf to your computer and use it in GitHub Desktop.
Save TrevorS/8a188edfa5316f85e5cf to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# encoding: utf-8
require 'date'
data = Hash.new(0)
Dir.glob("#{ARGV[0]}/**/*").reject { |f| File.directory?(f) }.each do |file|
date = Date.parse(file[/\d{4}\/\d{2}\/\d{2}/])
size = File.size(file)
data[date] += size
end
data.keys.sort.each do |date|
puts "#{date}, #{(data[date].to_f / 2**20).round(2)}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment