Class: Compass::Commands::Default

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

Instance Attribute Summary

Attributes inherited from Base

#options, #working_path

Attributes included from Actions

#logger

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#failed!, #initialize, #perform, register, #successful?

Methods included from Actions

#basename, #copy, #directory, #log_action, #process_erb, #relativize, #remove, #separate, #strip_trailing_separator, #write_file

Constructor Details

This class inherits a constructor from Compass::Commands::Base

Class Method Details

.option_parser(arguments) ⇒ Object



27
28
29
30
# File 'lib/compass/commands/default.rb', line 27

def option_parser(arguments)
  parser = Compass::Exec::CommandOptionParser.new(arguments)
  parser.extend(DefaultOptionsParser)
end

.parse!(arguments) ⇒ Object

def usage

$stderr.puts caller.join("\n")
"XXX"

end



35
36
37
38
39
40
41
42
# File 'lib/compass/commands/default.rb', line 35

def parse!(arguments)
  parser = option_parser(arguments)
  parser.parse!
  parser.options[:command] ||= Proc.new do
    Help.new(working_path, options.merge(:help_command => "help"))
  end
  parser.options
end

Instance Method Details

#executeObject



45
46
47
# File 'lib/compass/commands/default.rb', line 45

def execute
  instance_eval(&options[:command]).execute
end