Class: Compass::Exec::Compass

Inherits:
Object
  • Object
show all
Defined in:
lib/compass/exec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Compass

Returns a new instance of Compass.



32
33
34
35
36
# File 'lib/compass/exec.rb', line 32

def initialize(args)
  self.args = args
  self.options = {}
  parse!
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



30
31
32
# File 'lib/compass/exec.rb', line 30

def args
  @args
end

#optionsObject

Returns the value of attribute options.



30
31
32
# File 'lib/compass/exec.rb', line 30

def options
  @options
end

#optsObject

Returns the value of attribute opts.



30
31
32
# File 'lib/compass/exec.rb', line 30

def opts
  @opts
end

Instance Method Details

#run!Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/compass/exec.rb', line 38

def run!
  begin
    perform!
  rescue Exception => e
    raise e if e.is_a? SystemExit
    if e.is_a?(::Compass::Error) || e.is_a?(OptionParser::ParseError)
      $stderr.puts e.message
    else
      ::Compass::Exec.report_error(e, @options)
    end
    return 1
  end
  return 0
end