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

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

Direct Known Subclasses

ConditionBranch

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, options, callback) ⇒ Branch

Returns a new instance of Branch.



22
23
24
25
26
27
# File 'lib/capistrano/command.rb', line 22

def initialize(command, options, callback)
  @command = command.strip.gsub(/\r?\n/, "\\\n")
  @callback = callback || Capistrano::Configuration.default_io_proc
  @options = options
  @skip = false
end

Instance Attribute Details

#callbackObject

Returns the value of attribute callback.



19
20
21
# File 'lib/capistrano/command.rb', line 19

def callback
  @callback
end

#commandObject

Returns the value of attribute command.



19
20
21
# File 'lib/capistrano/command.rb', line 19

def command
  @command
end

#optionsObject (readonly)

Returns the value of attribute options.



20
21
22
# File 'lib/capistrano/command.rb', line 20

def options
  @options
end

Instance Method Details

#last?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/capistrano/command.rb', line 29

def last?
  options[:last]
end

#match(server) ⇒ Object



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

def match(server)
  true
end

#skip!Object



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

def skip!
  @skip = true
end

#skip?Boolean

Returns:

  • (Boolean)


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

def skip?
  @skip
end

#to_sObject



45
46
47
# File 'lib/capistrano/command.rb', line 45

def to_s
  command.inspect
end