Created
November 3, 2016 18:36
-
-
Save therod/36f3c4595b7fd5d2991f29df0b14dd26 to your computer and use it in GitHub Desktop.
Simple script that normalizes files in a folder and renames them accordingly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'i18n' | |
require 'fileutils' | |
I18n.available_locales = [:en] | |
Dir.glob('./authors/*.jpg').map do |orig| | |
dest = I18n.transliterate(orig.downcase.tr(' ', '-').tr('_', '-')) | |
File.rename(orig, dest) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment