Class: Co2::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/co2/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments, output, errors) ⇒ Cli

Returns a new instance of Cli.



11
12
13
14
15
16
17
18
19
20
# File 'lib/co2/cli.rb', line 11

def initialize(arguments, output, errors)
  @arguments = arguments
  @output = output
  @errors = errors

  @options = {
    :config => File.expand_path('../../../vendor/assets/stylesheets/co2.scss', __FILE__),
    :directory => '.'
  }
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/co2/cli.rb', line 9

def options
  @options
end

Instance Method Details

#runObject



22
23
24
25
26
# File 'lib/co2/cli.rb', line 22

def run
  if options? and valid?
    process!
  end
end