SHARE
TWEET

Untitled

a guest Jun 14th, 2013 21 Never
  1. def batchrename(annoyingstr)
  2.   Dir["#{Dir.pwd}/*"].each do |name|
  3.     new_name = name.gsub(annoyingstr, "")
  4.     puts "Renaming #{name} to #{new_name}"
  5.     File.rename(name, new_name)
  6.   end
  7. end
  8.  
  9. def listcwd
  10.   Dir.foreach("#{Dir.pwd}") do |fname|
  11.     puts fname
  12.   end
  13. end
RAW Paste Data
Top