Class: Rundock::Backend::Base
Instance Attribute Summary collapse
-
#backend ⇒ Object
readonly
Returns the value of attribute backend.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options) ⇒ Base
constructor
A new instance of Base.
- #run_commands(cmd, exec_options = {}) ⇒ Object
- #send_file(from, to) ⇒ Object
- #specinfra_run_command(command) ⇒ Object
Constructor Details
#initialize(options) ⇒ Base
Returns a new instance of Base.
24 25 26 27 |
# File 'lib/rundock/backend.rb', line 24 def initialize() @options = parse() @backend = create_specinfra_backend end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object (private)
100 101 102 |
# File 'lib/rundock/backend.rb', line 100 def method_missing(method, *args) @backend.send(method, *args) end |
Instance Attribute Details
#backend ⇒ Object (readonly)
Returns the value of attribute backend.
22 23 24 |
# File 'lib/rundock/backend.rb', line 22 def backend @backend end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
21 22 23 |
# File 'lib/rundock/backend.rb', line 21 def @options end |
Instance Method Details
#run_commands(cmd, exec_options = {}) ⇒ Object
29 30 31 32 33 |
# File 'lib/rundock/backend.rb', line 29 def run_commands(cmd, = {}) Array(cmd).each do |c| run_command(c, ) end end |
#send_file(from, to) ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/rundock/backend.rb', line 35 def send_file(from, to) system("test -d #{from}") recursive = $?.to_i == 0 if !recursive @backend.send_file(from, to) else @backend.send_directory(from, to) end end |
#specinfra_run_command(command) ⇒ Object
46 47 48 |
# File 'lib/rundock/backend.rb', line 46 def specinfra_run_command(command) @backend.run_command(command) end |