Class: Capistrano::Command::Tree

Class | Capistrano::Command::Tree
In: | lib/capistrano/command.rb lib/capistrano/command.rb
Parent: | Object

### Methods

branches_for branches_for each each else else new new when when

### Included Modules

Enumerable Enumerable

### Classes and Modules

Class Capistrano::Command::Tree::Branch
Class Capistrano::Command::Tree::ConditionBranch

### Attributes

branches | [R] |
branches | [R] |
configuration | [R] |
configuration | [R] |
fallback | [R] |
fallback | [R] |

### Public Class methods

new(config) {|self if block_given?| ...}

[Source]

         # File lib/capistrano/command.rb, line 97
     97:       def initialize(config)
     98:         @configuration = config
     99:         @branches = []
    100:         yield self if block_given?
    101:       end

new(config) {|self if block_given?| ...}

[Source]

         # File lib/capistrano/command.rb, line 97
     97:       def initialize(config)
     98:         @configuration = config
     99:         @branches = []
    100:         yield self if block_given?
    101:       end

### Public Instance methods

branches_for(server)

[Source]

         # File lib/capistrano/command.rb, line 111
    111:       def branches_for(server)
    112:         seen_last = false
    113:         matches = branches.select do |branch|
    114:           success = !seen_last && !branch.skip? && branch.match(server)
    115:           seen_last = success && branch.last?
    116:           success
    117:         end
    118:
    119:         matches << fallback if matches.empty? && fallback
    120:         return matches
    121:       end

branches_for(server)

[Source]

         # File lib/capistrano/command.rb, line 111
    111:       def branches_for(server)
    112:         seen_last = false
    113:         matches = branches.select do |branch|
    114:           success = !seen_last && !branch.skip? && branch.match(server)
    115:           seen_last = success && branch.last?
    116:           success
    117:         end
    118:
    119:         matches << fallback if matches.empty? && fallback
    120:         return matches
    121:       end

each() {|branch| ...}

[Source]

         # File lib/capistrano/command.rb, line 123
    123:       def each
    124:         branches.each { |branch| yield branch }
    125:         yield fallback if fallback
    126:         return self
    127:       end

each() {|branch| ...}

[Source]

         # File lib/capistrano/command.rb, line 123
    123:       def each
    124:         branches.each { |branch| yield branch }
    125:         yield fallback if fallback
    126:         return self
    127:       end

else(command, &block)

[Source]

         # File lib/capistrano/command.rb, line 107
    107:       def else(command, &block)
    108:         @fallback = Branch.new(command, {}, block)
    109:       end

else(command, &block)

[Source]

         # File lib/capistrano/command.rb, line 107
    107:       def else(command, &block)
    108:         @fallback = Branch.new(command, {}, block)
    109:       end

when(condition, command, options={}, &block)

[Source]

         # File lib/capistrano/command.rb, line 103
    103:       def when(condition, command, options={}, &block)
    104:         branches << ConditionBranch.new(configuration, condition, command, options, block)
    105:       end

when(condition, command, options={}, &block)

[Source]

         # File lib/capistrano/command.rb, line 103
    103:       def when(condition, command, options={}, &block)
    104:         branches << ConditionBranch.new(configuration, condition, command, options, block)
    105:       end

[Validate]