class Compass::Commands::PrintVersion
Attributes
options[RW]
Public Class Methods
description(command)
click to toggle source
# File lib/compass/commands/print_version.rb, line 45 def description(command) "Print out version information" end
long_output_string()
click to toggle source
# File lib/compass/commands/print_version.rb, line 53 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 69 def initialize(working_path, options) self.options = options end
option_parser(arguments)
click to toggle source
# File lib/compass/commands/print_version.rb, line 38 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 48 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 42 def usage option_parser([]).to_s end
Public Instance Methods
execute()
click to toggle source
# File lib/compass/commands/print_version.rb, line 73 def execute if options[:custom] version = "" version << "#{Compass.version[:major]}" if options[:major] version << ".#{Compass.version[:minor]}" if options[:minor] version << ".#{Compass.version[:patch]}" if options[:patch] puts version elsif options[:quiet] puts ::Compass.version[:string] else puts self.class.long_output_string end end