Class: Capistrano::Callback

Class | Capistrano::Callback
In: | lib/capistrano/callback.rb lib/capistrano/callback.rb
Parent: | Object

### Methods

applies_to? applies_to? new new

### Attributes

except | [R] |
except | [R] |
only | [R] |
only | [R] |
options | [R] |
options | [R] |
source | [R] |
source | [R] |

### Public Class methods

new(source, options={})

[Source]

        # File lib/capistrano/callback.rb, line 5
     5:     def initialize(source, options={})
     6:       @source = source
     7:       @options = options
     8:       @only = Array(options[:only]).map { |v| v.to_s }
     9:       @except = Array(options[:except]).map { |v| v.to_s }
    10:     end

new(source, options={})

[Source]

        # File lib/capistrano/callback.rb, line 5
     5:     def initialize(source, options={})
     6:       @source = source
     7:       @options = options
     8:       @only = Array(options[:only]).map { |v| v.to_s }
     9:       @except = Array(options[:except]).map { |v| v.to_s }
    10:     end

### Public Instance methods

applies_to?(task)

[Source]

        # File lib/capistrano/callback.rb, line 12
    12:     def applies_to?(task)
    13:       if task && only.any?
    14:         return only.include?(task.fully_qualified_name)
    15:       elsif task && except.any?
    16:         return !except.include?(task.fully_qualified_name)
    17:       else
    18:         return true
    19:       end
    20:     end

applies_to?(task)

[Source]

        # File lib/capistrano/callback.rb, line 12
    12:     def applies_to?(task)
    13:       if task && only.any?
    14:         return only.include?(task.fully_qualified_name)
    15:       elsif task && except.any?
    16:         return !except.include?(task.fully_qualified_name)
    17:       else
    18:         return true
    19:       end
    20:     end

[Validate]