Class: Terradactyl::Terraform::Commands::Base
- Inherits:
-
Object
- Object
- Terradactyl::Terraform::Commands::Base
- Defined in:
- lib/terradactyl/terraform/commands/base.rb
Instance Attribute Summary collapse
-
#dir_or_plan ⇒ Object
Returns the value of attribute dir_or_plan.
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #execute(capture: false) ⇒ Object
-
#initialize(dir_or_plan: nil, options: nil) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(dir_or_plan: nil, options: nil) ⇒ Base
Returns a new instance of Base.
43 44 45 46 47 48 |
# File 'lib/terradactyl/terraform/commands/base.rb', line 43 def initialize(dir_or_plan: nil, options: nil) @dir_or_plan = dir_or_plan.to_s @options = || Options.new Terradactyl::Terraform.select_revision(version, self) inject_env_vars end |
Instance Attribute Details
#dir_or_plan ⇒ Object
Returns the value of attribute dir_or_plan.
41 42 43 |
# File 'lib/terradactyl/terraform/commands/base.rb', line 41 def dir_or_plan @dir_or_plan end |
#options ⇒ Object
Returns the value of attribute options.
41 42 43 |
# File 'lib/terradactyl/terraform/commands/base.rb', line 41 def @options end |
Class Method Details
.execute(dir_or_plan: nil, options: nil, capture: false) ⇒ Object
36 37 38 39 |
# File 'lib/terradactyl/terraform/commands/base.rb', line 36 def self.execute(dir_or_plan: nil, options: nil, capture: false) new(dir_or_plan: dir_or_plan, options: ).execute(capture: capture) end |
Instance Method Details
#execute(capture: false) ⇒ Object
50 51 52 53 54 |
# File 'lib/terradactyl/terraform/commands/base.rb', line 50 def execute(capture: false) cmd = assemble_command echo_cmd(cmd) send((capture ? :capture3 : :popen3), ENV, cmd) end |