Class: Pangea::CLI::Config
Overview
Resolves workspace configuration from pangea.yml files. Handles namespace resolution, state backend config, and workspace paths.
Instance Attribute Summary collapse
-
#backend_config ⇒ Object
readonly
Returns the value of attribute backend_config.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#template_dir ⇒ Object
readonly
Returns the value of attribute template_dir.
-
#template_file ⇒ Object
readonly
Returns the value of attribute template_file.
-
#template_name ⇒ Object
readonly
Returns the value of attribute template_name.
-
#workspace_dir ⇒ Object
readonly
Returns the value of attribute workspace_dir.
Instance Method Summary collapse
-
#initialize(template_file, namespace: nil) ⇒ Config
constructor
A new instance of Config.
- #template_content ⇒ Object
Constructor Details
#initialize(template_file, namespace: nil) ⇒ Config
Returns a new instance of Config.
14 15 16 17 18 19 20 21 |
# File 'lib/pangea/cli/config.rb', line 14 def initialize(template_file, namespace: nil) @template_file = File.(template_file) @template_dir = File.dirname(@template_file) @template_name = File.basename(@template_file, '.rb') @namespace = resolve_namespace(namespace) @workspace_dir = build_workspace_dir @backend_config = resolve_backend_config end |
Instance Attribute Details
#backend_config ⇒ Object (readonly)
Returns the value of attribute backend_config.
11 12 13 |
# File 'lib/pangea/cli/config.rb', line 11 def backend_config @backend_config end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
11 12 13 |
# File 'lib/pangea/cli/config.rb', line 11 def namespace @namespace end |
#template_dir ⇒ Object (readonly)
Returns the value of attribute template_dir.
11 12 13 |
# File 'lib/pangea/cli/config.rb', line 11 def template_dir @template_dir end |
#template_file ⇒ Object (readonly)
Returns the value of attribute template_file.
11 12 13 |
# File 'lib/pangea/cli/config.rb', line 11 def template_file @template_file end |
#template_name ⇒ Object (readonly)
Returns the value of attribute template_name.
11 12 13 |
# File 'lib/pangea/cli/config.rb', line 11 def template_name @template_name end |
#workspace_dir ⇒ Object (readonly)
Returns the value of attribute workspace_dir.
11 12 13 |
# File 'lib/pangea/cli/config.rb', line 11 def workspace_dir @workspace_dir end |
Instance Method Details
#template_content ⇒ Object
23 24 25 |
# File 'lib/pangea/cli/config.rb', line 23 def template_content @template_content ||= File.read(@template_file) end |