Module: Terraspace::Plugin::Config::Interface

Includes:
DslEvaluator
Defined in:
lib/terraspace/plugin/config/interface.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject (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

Yields:



23
24
25
# File 'lib/terraspace/plugin/config/interface.rb', line 23

def configure
  yield(@config)
end

#defaultsObject

meant to be overridden by plugin



14
15
16
# File 'lib/terraspace/plugin/config/interface.rb', line 14

def defaults
  ActiveSupport::OrderedOptions.new
end

#initializeObject



9
10
11
# File 'lib/terraspace/plugin/config/interface.rb', line 9

def initialize
  @config = defaults # plugin should implement defaults
end

#load_project_configObject



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