Class: Proteus::ContextManagement::Context
- Inherits:
-
Object
- Object
- Proteus::ContextManagement::Context
- Includes:
- Helpers::PathHelpers
- Defined in:
- lib/proteus/context_management/context.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #environments ⇒ Object
-
#initialize(name:) ⇒ Context
constructor
A new instance of Context.
Methods included from Helpers::PathHelpers
#config_dir, #config_path, #context_path, #context_temp_directory, #contexts_path, #environments_path, #module_config_path, #module_data_path, #module_hooks_path, #module_io_file, #module_path, #module_templates_path, #modules_path, #plan_file, #root_path, #state_file, #var_file
Constructor Details
#initialize(name:) ⇒ Context
Returns a new instance of Context.
10 11 12 13 14 |
# File 'lib/proteus/context_management/context.rb', line 10 def initialize(name:) @name = name ensure_temp_directory end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/proteus/context_management/context.rb', line 8 def name @name end |
Instance Method Details
#environments ⇒ Object
16 17 18 19 20 |
# File 'lib/proteus/context_management/context.rb', line 16 def environments Dir.glob("#{File.(File.join(environments_path(@name)))}/*.tfvars").map do |vars_file| File.basename(vars_file).split('.')[1] end end |