discourse/app/assets/images/avatars/rename.rb

10 lines
253 B
Ruby
Raw Normal View History

2013-02-05 14:16:51 -05:00
all_files = [Dir["*.jpg"] + Dir["*.jpeg"]].flatten
all_files.each do |f|
File.rename(f, "#{rand(2**256).to_s(36)[0..7]}.jpg")
end
all_files = [Dir["*.jpg"] + Dir["*.jpeg"]].flatten
all_files.each_with_index do |f, i|
File.rename(f, "#{i}.jpg")
end