Class: Rubble::Command::Base
- Inherits:
-
Object
- Object
- Rubble::Command::Base
- Defined in:
- lib/rubble/command/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#local ⇒ Object
readonly
Returns the value of attribute local.
-
#plan ⇒ Object
readonly
Returns the value of attribute plan.
-
#remote ⇒ Object
readonly
Returns the value of attribute remote.
Instance Method Summary collapse
- #deploy_dir ⇒ Object
- #env ⇒ Object
-
#initialize(plan, context) ⇒ Base
constructor
A new instance of Base.
- #resolve(string) ⇒ Object
- #resource ⇒ Object
- #server ⇒ Object
- #target ⇒ Object
Constructor Details
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
7 8 9 |
# File 'lib/rubble/command/base.rb', line 7 def context @context end |
#local ⇒ Object (readonly)
Returns the value of attribute local.
8 9 10 |
# File 'lib/rubble/command/base.rb', line 8 def local @local end |
#plan ⇒ Object (readonly)
Returns the value of attribute plan.
6 7 8 |
# File 'lib/rubble/command/base.rb', line 6 def plan @plan end |
#remote ⇒ Object (readonly)
Returns the value of attribute remote.
9 10 11 |
# File 'lib/rubble/command/base.rb', line 9 def remote @remote end |
Instance Method Details
#deploy_dir ⇒ Object
52 53 54 |
# File 'lib/rubble/command/base.rb', line 52 def deploy_dir resolve(File.join(server.rubble_dir, server.deploy_dir)) end |
#env ⇒ Object
29 30 31 |
# File 'lib/rubble/command/base.rb', line 29 def env @plan.env end |
#resolve(string) ⇒ Object
47 48 49 50 |
# File 'lib/rubble/command/base.rb', line 47 def resolve(string) string = '"' << string.gsub('"', '\"') << '"' eval(string, binding) end |
#resource ⇒ Object
25 26 27 |
# File 'lib/rubble/command/base.rb', line 25 def resource @plan.resource end |
#server ⇒ Object
17 18 19 |
# File 'lib/rubble/command/base.rb', line 17 def server @plan.server end |
#target ⇒ Object
21 22 23 |
# File 'lib/rubble/command/base.rb', line 21 def target @plan.target end |