Class: Haml::Exec::Generic
Overview
A class that encapsulates the executable code for all three executables.
Instance Method Summary collapse
-
#initialize(args) ⇒ Generic
constructor
:nodoc:.
- #parse! ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(args) ⇒ Generic
:nodoc:
13 14 15 16 |
# File 'lib/haml/exec.rb', line 13 def initialize(args) @args = args @options = {} end |
Instance Method Details
#parse! ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/haml/exec.rb', line 18 def parse! begin @opts = OptionParser.new(&method(:set_opts)) @opts.parse!(@args) process_result @options rescue Exception => e raise e if @options[:trace] || e.is_a?(SystemExit) $stderr.puts e. exit 1 end exit 0 end |
#to_s ⇒ Object
35 36 37 |
# File 'lib/haml/exec.rb', line 35 def to_s @opts.to_s end |