Class: ExtensionFixer
- Inherits:
-
Object
- Object
- ExtensionFixer
- Defined in:
- lib/extension_fixer.rb
Overview
A ruby gem to fix file extensions
Instance Method Summary collapse
Instance Method Details
#check ⇒ Object
7 8 9 10 11 12 |
# File 'lib/extension_fixer.rb', line 7 def check # Check all files for the correct extension type walk_args do |file, right_ext| p "#{file} should have a #{right_ext} extension." end end |
#fix ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/extension_fixer.rb', line 14 def fix # Change all files to the correct extension types walk_args do |file, right_extension| p "$ mv #{file.gsub(File.extname(file), '{\0,.' + right_extension + '}')}" File.rename file, file.ext(right_extension) end end |