Class: Hum::Exec::Generic
- Inherits:
-
Object
- Object
- Hum::Exec::Generic
- Defined in:
- lib/hum/exec.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(args) ⇒ Generic
constructor
A new instance of Generic.
- #parse ⇒ Object
- #parse! ⇒ Object
Constructor Details
#initialize(args) ⇒ Generic
Returns a new instance of Generic.
12 13 14 15 16 17 18 19 20 |
# File 'lib/hum/exec.rb', line 12 def initialize(args) @args = args #Command line options @options = {} #Files to output @files = {} end |
Instance Method Details
#parse ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/hum/exec.rb', line 31 def parse @opts = OptionParser.new(&method(:set_opts)) if @args.kind_of? String @args = [@args] end @opts.parse!(@args) process_result end |
#parse! ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/hum/exec.rb', line 22 def parse! begin parse rescue Exception => e exit 1 end exit 0 end |