Class/Module Index [+]

Quicksearch

Compass::Commands::PrintVersion

Attributes

options[RW]

Public Class Methods

description(command) click to toggle source
# File lib/compass/commands/print_version.rb, line 49
def description(command)
  "Print out version information"
end
long_output_string() click to toggle source
# File lib/compass/commands/print_version.rb, line 57
def long_output_string
  lines = []
  lines << "Compass #{::Compass.version[:string]}"
  if name = ::Compass.version[:name]
    lines.last << " (#{name})"
  end
  lines << "Copyright (c) 2008-#{Time.now.year} Chris Eppstein"
  lines << "Released under the MIT License."
  lines << "Compass is charityware."
  lines << "Please make a tax deductable donation for a worthy cause: http://umdf.org/compass"
  lines.join("\n")
end
new(working_path, options) click to toggle source
# File lib/compass/commands/print_version.rb, line 73
def initialize(working_path, options)
  self.options = options
end
option_parser(arguments) click to toggle source
# File lib/compass/commands/print_version.rb, line 42
def option_parser(arguments)
  parser = Compass::Exec::CommandOptionParser.new(arguments)
  parser.extend(VersionOptionsParser)
end
parse!(arguments) click to toggle source
# File lib/compass/commands/print_version.rb, line 52
def parse!(arguments)
  parser = option_parser(arguments)
  parser.parse!
  parser.options
end
usage() click to toggle source
# File lib/compass/commands/print_version.rb, line 46
def usage
  option_parser([]).to_s
end

Public Instance Methods

execute() click to toggle source
# File lib/compass/commands/print_version.rb, line 77
def execute
  if options[:custom]
    version = ""
    version << "#{Compass.version[:major]}" if options[:major]
    version << ".#{Compass.version[:minor]}" if options[:minor]
    version << ".#{Compass.version[:teeny]}" if options[:patch]
    if options[:revision]
      if version.size > 0
        version << " [#{Compass.version[:rev][0..6]}]"
      else
        version << Compass.version[:rev]
      end
    end
    puts version
  elsif options[:quiet]
    puts ::Compass.version[:string]
  else
    puts self.class.long_output_string
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.