Class: Compass::Commands::PrintVersion

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(working_path, options) ⇒ PrintVersion

Returns a new instance of PrintVersion.



5
6
7
# File 'lib/compass/commands/print_version.rb', line 5

def initialize(working_path, options)
  self.options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/compass/commands/print_version.rb', line 4

def options
  @options
end

Instance Method Details

#performObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/compass/commands/print_version.rb', line 9

def perform
  if options[:quiet]
    # The quiet option may make scripting easier
    puts ::Compass.version[:string]
  else
    lines = []
    lines << "Compass #{::Compass.version[:string]}"
    lines << "Copyright (c) 2008 Chris Eppstein"
    lines << "Released under the MIT License."
    puts lines.join("\n")
  end
end