Class: Capistrano::Command::Tree::Branch
- Inherits:
-
Object
- Object
- Capistrano::Command::Tree::Branch
- Defined in:
- lib/capistrano/command.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#callback ⇒ Object
Returns the value of attribute callback.
-
#command ⇒ Object
Returns the value of attribute command.
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(command, options, callback) ⇒ Branch
constructor
A new instance of Branch.
- #last? ⇒ Boolean
- #match(server) ⇒ Object
- #skip! ⇒ Object
- #skip? ⇒ Boolean
- #to_s(parallel = false) ⇒ Object
Constructor Details
#initialize(command, options, callback) ⇒ Branch
Returns a new instance of Branch.
23 24 25 26 27 28 |
# File 'lib/capistrano/command.rb', line 23 def initialize(command, , callback) @command = command.strip.gsub(/\r?\n/, "\\\n") @callback = callback || Capistrano::Configuration.default_io_proc @options = @skip = false end |
Instance Attribute Details
#callback ⇒ Object
Returns the value of attribute callback.
20 21 22 |
# File 'lib/capistrano/command.rb', line 20 def callback @callback end |
#command ⇒ Object
Returns the value of attribute command.
20 21 22 |
# File 'lib/capistrano/command.rb', line 20 def command @command end |
#condition ⇒ Object
Returns the value of attribute condition.
20 21 22 |
# File 'lib/capistrano/command.rb', line 20 def condition @condition end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
21 22 23 |
# File 'lib/capistrano/command.rb', line 21 def @options end |
Instance Method Details
#last? ⇒ Boolean
30 31 32 |
# File 'lib/capistrano/command.rb', line 30 def last? [:last] end |
#match(server) ⇒ Object
42 43 44 |
# File 'lib/capistrano/command.rb', line 42 def match(server) true end |
#skip! ⇒ Object
38 39 40 |
# File 'lib/capistrano/command.rb', line 38 def skip! @skip = true end |
#skip? ⇒ Boolean
34 35 36 |
# File 'lib/capistrano/command.rb', line 34 def skip? @skip end |
#to_s(parallel = false) ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/capistrano/command.rb', line 46 def to_s(parallel=false) if parallel && @condition "#{condition.inspect} :: #{command.inspect}" else command.inspect end end |