Class: Imagesorter::Cmd

Inherits:
Object
  • Object
show all
Defined in:
lib/imagesorter/cmd.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCmd

Returns a new instance of Cmd.



11
12
13
# File 'lib/imagesorter/cmd.rb', line 11

def initialize
  @options = Imagesorter::OptionParser.parse(ARGV)
end

Instance Attribute Details

#progressbarObject (readonly)

Returns the value of attribute progressbar.



9
10
11
# File 'lib/imagesorter/cmd.rb', line 9

def progressbar
  @progressbar
end

Instance Method Details

#runObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/imagesorter/cmd.rb', line 15

def run
  print_options

  setup_logger
  setup_locale

  Imagesorter::FileBatchProcessor.new(batch_options).execute!

  finalize

  puts 'DONE'
  exit 0
rescue Interrupt
  puts 'FAIL: INTERRUPTED'
  exit 1
rescue => e
  puts e
  exit 2
end