Class: CloudRunner::DigitalOcean::Cli::Base
- Inherits:
-
Object
- Object
- CloudRunner::DigitalOcean::Cli::Base
- Defined in:
- lib/cloud_runner/digital_ocean/cli/base.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Base
constructor
A new instance of Base.
- #run_script(out, err) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Base
Returns a new instance of Base.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cloud_runner/digital_ocean/cli/base.rb', line 12 def initialize(opts={}) @options = opts.clone.freeze raise "Client id must be specified" \ unless @client_id = [:client_id] raise "Api key must be specified" \ unless @api_key = [:api_key] raise "Script must be specified" \ unless @script_path = [:script] @script_path = File.realpath(@script_path) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/cloud_runner/digital_ocean/cli/base.rb', line 10 def @options end |
Instance Method Details
#run_script(out, err) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/cloud_runner/digital_ocean/cli/base.rb', line 27 def run_script(out, err) @out, @err = out, err set_up execute_script ensure clean_up end |