Module: Nrename::Runner

Defined in:
lib/nrename/runner.rb

Class Method Summary collapse

Class Method Details

.run(args) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/nrename/runner.rb', line 3

def self.run(args)
  Nrename.parse_options args

  dirs = Nrename.options.dirs.map { |dir| Directory.new dir }
  if dirs.all? &:empty?
    warn 'No matched files to rename.'
  else
    dirs.each &:normalize
  end
end