Class: Compass::Exec::SwitchUI

Inherits:
Object
  • Object
show all
Includes:
GlobalOptionsParser, ProjectOptionsParser
Defined in:
lib/compass/exec/switch_ui.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ProjectOptionsParser

#set_dir_or_path, #set_options, #set_project_options

Methods included from GlobalOptionsParser

#set_global_options, #set_options

Constructor Details

#initialize(args) ⇒ SwitchUI

Returns a new instance of SwitchUI.



10
11
12
13
14
# File 'lib/compass/exec/switch_ui.rb', line 10

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

Instance Attribute Details

#argsObject

Returns the value of attribute args.



8
9
10
# File 'lib/compass/exec/switch_ui.rb', line 8

def args
  @args
end

#optionsObject

Returns the value of attribute options.



8
9
10
# File 'lib/compass/exec/switch_ui.rb', line 8

def options
  @options
end

#optsObject

Returns the value of attribute opts.



8
9
10
# File 'lib/compass/exec/switch_ui.rb', line 8

def opts
  @opts
end

Instance Method Details

#run!Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/compass/exec/switch_ui.rb', line 16

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::Helpers.report_error(e, @options)
    end
    return 1
  end
  return 0
end