Class: Giblish::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/giblish/application.rb

Overview

The ‘main’ class of giblish

Instance Method Summary collapse

Instance Method Details

#run(args) ⇒ Object

return exit status (0 for success)



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/giblish/application.rb', line 15

def run(args)
  # force immediate output
  $stdout.sync = true

  # setup logging
  Giblog.setup

  # Parse cmd line
  cmdline = CmdLineParser.new args
  Giblog.logger.debug { "cmd line args: #{cmdline.args}" }

  exit_code = execute_conversion(cmdline)
  Giblog.logger.info { "Giblish is done!" } if exit_code.zero?
  exit_code
end

#run_from_cmd_lineObject

does not return, exits with status code



9
10
11
12
# File 'lib/giblish/application.rb', line 9

def run_from_cmd_line
  status = run(ARGV)
  exit(status)
end