Class: Pot::Actor
- Inherits:
-
Object
- Object
- Pot::Actor
- Defined in:
- lib/pot/actor.rb
Instance Method Summary collapse
- #execute(commands) ⇒ Object
-
#initialize(instance, options = {}) ⇒ Actor
constructor
A new instance of Actor.
- #install(installer) ⇒ Object
- #teardown ⇒ Object
- #transfer(source, destination, recursive = true) ⇒ Object
- #verify(verifier) ⇒ Object
Constructor Details
Instance Method Details
#execute(commands) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/pot/actor.rb', line 9 def execute(commands) commands.each do |command| command = "sudo #{command}" if @sudo @transport.execute(command) end end |
#install(installer) ⇒ Object
16 17 18 |
# File 'lib/pot/actor.rb', line 16 def install(installer) execute(installer.commands) end |
#teardown ⇒ Object
29 30 31 |
# File 'lib/pot/actor.rb', line 29 def teardown @transport if @transport.respond_to?(:teardown) end |
#transfer(source, destination, recursive = true) ⇒ Object
25 26 27 |
# File 'lib/pot/actor.rb', line 25 def transfer(source, destination, recursive = true) @transport.transfer(source, destination, recursive) end |
#verify(verifier) ⇒ Object
20 21 22 23 |
# File 'lib/pot/actor.rb', line 20 def verify(verifier) command = verifier.commands.join(" && ") @transport.execute(command) == 0 end |