Class: EEx2Slime::Command
- Inherits:
-
Object
- Object
- EEx2Slime::Command
- Defined in:
- lib/eex2slime/command.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ Command
constructor
A new instance of Command.
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ Command
Returns a new instance of Command.
9 10 11 12 |
# File 'lib/eex2slime/command.rb', line 9 def initialize(args) @args = args @options = {} end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/eex2slime/command.rb', line 14 def run @opts = OptionParser.new(&method(:set_opts)) @opts.parse!(@args) process! exit 0 rescue => error raise error if @options[:trace] || SystemExit === error $stderr.print "#{error.class}: " if error.class != RuntimeError $stderr.puts error. $stderr.puts ' Use --trace for backtrace.' exit 1 end |