Class: Compass::Commands::ListFrameworks

Inherits:
ProjectBase show all
Defined in:
lib/compass/commands/list_frameworks.rb

Instance Attribute Summary collapse

Attributes inherited from ProjectBase

#project_name

Attributes inherited from Base

#working_path

Attributes included from Actions

#logger

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

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

Methods included from Actions

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

Constructor Details

#initialize(working_path, options) ⇒ ListFrameworks

Returns a new instance of ListFrameworks.



6
7
8
# File 'lib/compass/commands/list_frameworks.rb', line 6

def initialize(working_path, options)
  super
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end

Class Method Details

.description(command) ⇒ Object



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

def description(command)
  "List the available frameworks"
end

.option_parser(arguments) ⇒ Object



21
22
23
24
# File 'lib/compass/commands/list_frameworks.rb', line 21

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

.parse!(arguments) ⇒ Object



31
32
33
34
35
# File 'lib/compass/commands/list_frameworks.rb', line 31

def parse!(arguments)
  parser = option_parser(arguments)
  parser.parse!
  parser.options
end

.usageObject



25
26
27
# File 'lib/compass/commands/list_frameworks.rb', line 25

def usage
  option_parser([]).to_s
end

Instance Method Details

#executeObject



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

def execute
  if options[:quiet]
    Compass::Frameworks::ALL.each do |framework|
      puts framework.name unless framework.name =~ /^_/
    end
  else
    puts "Available Frameworks & Patterns:\n\n"
    puts Compass::Frameworks.pretty_print
  end
end