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

#initialize(working_path, options) ⇒ Base

Returns 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

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end

#working_pathObject

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

.register(command_name) ⇒ Object



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

#executeObject



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

def execute
  perform
end

#failed!Object



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

def failed!
  @failed = true
end

#performObject

Raises:

  • (StandardError)


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

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

#successful?Boolean

Returns:

  • (Boolean)


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

def successful?
  !@failed
end