Class: Compass::Commands::Base

Inherits:
Object
  • Object
show all
Includes:
Actions
Defined in:
lib/compass/commands/base.rb

Direct Known Subclasses

Default, ExtensionCommand, Help, PrintVersion, ProjectBase

Instance Attribute Summary (collapse)

Attributes included from Actions

#logger

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from Actions

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

Constructor Details

- (Base) initialize(working_path, options)

A new instance of Base



12
13
14
15
# File 'lib/compass/commands/base.rb', line 12

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

Instance Attribute Details

- (Object) options

Returns the value of attribute options



10
11
12
# File 'lib/compass/commands/base.rb', line 10

def options
  @options
end

- (Object) working_path

Returns the value of attribute working_path



10
11
12
# File 'lib/compass/commands/base.rb', line 10

def working_path
  @working_path
end

Class Method Details

+ (Object) register(command_name)



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

def self.register(command_name)
  Compass::Commands[command_name] = self
end

Instance Method Details

- (Object) execute



17
18
19
# File 'lib/compass/commands/base.rb', line 17

def execute
  perform
end

- (Object) failed!



29
30
31
# File 'lib/compass/commands/base.rb', line 29

def failed!
  @failed = true
end

- (Object) perform

Raises:

  • (StandardError)


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

def perform
  raise StandardError.new("Not Implemented")
end

- (Boolean) successful?

Returns:

  • (Boolean)


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

def successful?
  !@failed
end