Sha256: e0882ee969ee501df2a9aa94f53a1405760c4d1e083136dc574f56627a70b69a

Contents?: true

Size: 898 Bytes

Versions: 29

Compression:

Stored size: 898 Bytes

Contents

Puppet::Parser::Functions::newfunction(:template, :type => :rvalue, :doc =>
  "Evaluate a template and return its value.  See
  [the templating docs](http://docs.puppetlabs.com/guides/templating.html) for 
  more information.
  
  Note that if multiple templates are specified, their output is all
  concatenated and returned as the output of the function.") do |vals|
    vals.collect do |file|
      # Use a wrapper, so the template can't get access to the full
      # Scope object.
      debug "Retrieving template #{file}"

      wrapper = Puppet::Parser::TemplateWrapper.new(self)
      wrapper.file = file
      begin
        wrapper.result
      rescue => detail
        info = detail.backtrace.first.split(':')
        raise Puppet::ParseError,
          "Failed to parse template #{file}:\n  Filepath: #{info[0]}\n  Line: #{info[1]}\n  Detail: #{detail}\n"
      end
    end.join("")
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
puppet-parse-0.1.4 lib/vendor/puppet/parser/functions/template.rb
puppet-parse-0.1.3 lib/vendor/puppet/parser/functions/template.rb
puppet-parse-0.1.2 lib/vendor/puppet/parser/functions/template.rb
puppet-parse-0.1.1 lib/vendor/puppet/parser/functions/template.rb
puppet-2.7.26 lib/puppet/parser/functions/template.rb
puppet-2.7.25 lib/puppet/parser/functions/template.rb
puppet-2.7.24 lib/puppet/parser/functions/template.rb
puppet-2.7.23 lib/puppet/parser/functions/template.rb
puppet-2.7.22 lib/puppet/parser/functions/template.rb
puppet-parse-0.1.0 lib/vendor/puppet/parser/functions/template.rb
puppet-parse-0.0.6 lib/vendor/puppet/parser/functions/template.rb
puppet-2.7.21 lib/puppet/parser/functions/template.rb
puppet-parse-0.0.5 lib/vendor/puppet/parser/functions/template.rb
puppet-parse-0.0.4 lib/vendor/puppet/parser/functions/template.rb
puppet-3.0.2 lib/puppet/parser/functions/template.rb
puppet-3.0.2.rc3 lib/puppet/parser/functions/template.rb
puppet-3.0.2.rc2 lib/puppet/parser/functions/template.rb
puppet-3.0.2.rc1 lib/puppet/parser/functions/template.rb
puppet-parse-0.0.2 lib/vendor/puppet/parser/functions/template.rb
puppet-2.7.20 lib/puppet/parser/functions/template.rb