Test
#!/usr/bin/ruby
require "rubygems"
require "exifr"
require "pathname"
Pathname.glob("*.{jpg,JPG}") do |f|
date = EXIFR::JPEG.new(f.to_s).date_time_original
path = Pathname.new(date.strftime("%Y/%m%d"))
path.mkpath
f.rename(path + f)
puts "#{f} -> #{path}"
raw = Pathname.new(f.to_s.sub(/jpg$/i, "CR2"))
if raw.exist?
puts "#{raw} -> #{path}"
raw.rename(path + raw)
end
end