Method: Pec::Handler::Templates.load_template
- Defined in:
- lib/pec/handler/templates.rb
.load_template(config) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/pec/handler/templates.rb', line 10 def load_template(config) config.templates.inject({}) do |merge_template, template| template.to_s.concat('.yaml') unless template.to_s.match(/.*\.yaml/) Pec::Logger.notice "load template #{template}" raise "#{template} not fond!" unless FileTest.exist?("user_data/#{template}") merge_template.deep_merge!(YAML.load_file("user_data/#{template}").to_hash) end if config.templates end |