Module: Terraspace::Plugin::Config::Interface
- Includes:
- DslEvaluator
- Defined in:
- lib/terraspace/plugin/config/interface.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #configure {|@config| ... } ⇒ Object
-
#defaults ⇒ Object
meant to be overridden by plugin.
- #initialize ⇒ Object
- #load_project_config ⇒ Object
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/terraspace/plugin/config/interface.rb', line 8 def config @config end |
Instance Method Details
#configure {|@config| ... } ⇒ Object
23 24 25 |
# File 'lib/terraspace/plugin/config/interface.rb', line 23 def configure yield(@config) end |
#defaults ⇒ Object
meant to be overridden by plugin
14 15 16 |
# File 'lib/terraspace/plugin/config/interface.rb', line 14 def defaults ActiveSupport::OrderedOptions.new end |
#initialize ⇒ Object
9 10 11 |
# File 'lib/terraspace/plugin/config/interface.rb', line 9 def initialize @config = defaults # plugin should implement defaults end |
#load_project_config ⇒ Object
18 19 20 21 |
# File 'lib/terraspace/plugin/config/interface.rb', line 18 def load_project_config evaluate_file("#{Terraspace.root}/config/plugins/#{provider}.rb") evaluate_file("#{Terraspace.root}/config/plugins/#{provider}/#{Terraspace.env}.rb") end |