Class: Lhj::Command::Rename
- Inherits:
-
Lhj::Command
- Object
- CLAide::Command
- Lhj::Command
- Lhj::Command::Rename
- Defined in:
- lib/lhj/command/rename_image.rb
Instance Method Summary collapse
Instance Method Details
#rename ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/lhj/command/rename_image.rb', line 11 def rename folder_path = "~/Downloads/ss" Dir.glob("#{folder_path}/**/*.{png}").sort.each do |f| filename = File.basename(f, File.extname(f)) File.rename(f, "#{folder_path}/aomi_soldout_" + filename.capitalize + File.extname(f)) end end |
#run ⇒ Object
7 8 9 |
# File 'lib/lhj/command/rename_image.rb', line 7 def run rename end |