Class: Capistrano::TaskCallback

Inherits:
Callback
  • Object
show all
Defined in:
lib/capistrano/callback.rb

Instance Attribute Summary collapse

Attributes inherited from Callback

#except, #only, #options, #source

Instance Method Summary collapse

Constructor Details

#initialize(config, source, options = {}) ⇒ TaskCallback

Returns a new instance of TaskCallback.



32
33
34
35
# File 'lib/capistrano/callback.rb', line 32

def initialize(config, source, options={})
  super(source, options)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



30
31
32
# File 'lib/capistrano/callback.rb', line 30

def config
  @config
end

Instance Method Details

#applies_to?(task) ⇒ Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/capistrano/callback.rb', line 41

def applies_to?(task)
  super && (task.nil? || task.fully_qualified_name != source.to_s)
end

#callObject



37
38
39
# File 'lib/capistrano/callback.rb', line 37

def call
  config.find_and_execute_task(source)
end