Parent

Included Modules

Files

Class/Module Index [+]

Quicksearch

Capistrano::Command::Tree

Attributes

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

Public Class Methods

new(config) click to toggle source
# File lib/capistrano/command.rb, line 98
def initialize(config)
  @configuration = config
  @branches = []
  yield self if block_given?
end

Public Instance Methods

branches_for(server) click to toggle source
# File lib/capistrano/command.rb, line 112
def branches_for(server)
  seen_last = false
  matches = branches.select do |branch|
    success = !seen_last && !branch.skip? && branch.match(server)
    seen_last = success && branch.last?
    success
  end

  matches << fallback if matches.empty? && fallback
  return matches
end
each() click to toggle source
# File lib/capistrano/command.rb, line 124
def each
  branches.each { |branch| yield branch }
  yield fallback if fallback
  return self
end
else(command, &block) click to toggle source
# File lib/capistrano/command.rb, line 108
def else(command, &block)
  @fallback = Branch.new(command, {}, block)
end
when(condition, command, options={}, &block) click to toggle source
# File lib/capistrano/command.rb, line 104
def when(condition, command, options={}, &block)
  branches << ConditionBranch.new(configuration, condition, command, options, block)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.