Module: Flak::Template::MergeEngine
- Included in:
- Cpp::Settings, Delight::Settings, Doc::Settings, Environment::Settings, Gl::Settings, Flak::Template::Mac::Settings, Flak::Template::Max::Settings, Flak::Template::Maya::Settings, Flak::Template::MayaApp::Settings, Flak::Template::MayaPlugin::Settings, Nuke::Settings, Release::Settings, Shell::Settings
- Defined in:
- lib/flak/rake/templates/merge_engine.rb
Class Method Summary collapse
-
.flatten_yaml_file(settings, file) ⇒ Object
substutute environment variables in yaml file and faltten out the os and configuration keys.
Instance Method Summary collapse
-
#flatten_yaml(settings) ⇒ Object
open the yaml file associated with the current module and flatten it.
- #infuse(target) ⇒ Object
-
#settings_modifications(settings) ⇒ Object
fallback modifications method for #selfself.name.
Class Method Details
.flatten_yaml_file(settings, file) ⇒ Object
substutute environment variables in yaml file and faltten out the os and configuration keys.
16 17 18 19 20 21 22 23 24 |
# File 'lib/flak/rake/templates/merge_engine.rb', line 16 def self.flatten_yaml_file(settings, file) if File.exists? file content = File.open(file, "rb").read.substitute_env_vars yml = YAML::load(content) || {} yml.flak_flatten(settings[:configuration], settings[:os]) else {} end end |
Instance Method Details
#flatten_yaml(settings) ⇒ Object
open the yaml file associated with the current module and flatten it
28 29 30 31 |
# File 'lib/flak/rake/templates/merge_engine.rb', line 28 def flatten_yaml settings file = settings[:root] + '/config/'+self.name.split("::")[2].underscoreize+'.yml' Flak::Template::MergeEngine.flatten_yaml_file(settings,file) end |
#infuse(target) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/flak/rake/templates/merge_engine.rb', line 5 def infuse target settings = target.settings flat = flatten_yaml settings settings = settings.flak_merge(flat) module_mods = settings_modifications(settings) target.settings = settings.flak_merge(module_mods) end |
#settings_modifications(settings) ⇒ Object
fallback modifications method for #Flak::Template::MergeEngine.selfself.name
36 37 38 |
# File 'lib/flak/rake/templates/merge_engine.rb', line 36 def settings_modifications settings {} end |