Sha256: 5e154578cd1aa456b714f5ccf7b94acbcc48519f031df4e37375d339d4fb47b5

Contents?: true

Size: 819 Bytes

Versions: 134

Compression:

Stored size: 819 Bytes

Contents

Puppet::Parser::Functions::newfunction(:inline_template, :type => :rvalue, :arity => -2, :doc =>
  "Evaluate a template string and return its value.  See
  [the templating docs](https://docs.puppetlabs.com/puppet/latest/reference/lang_template.html) for
  more information. Note that if multiple template strings are specified, their
  output is all concatenated and returned as the output of the function.") do |vals|

  require 'erb'

    vals.collect do |string|
      # Use a wrapper, so the template can't get access to the full
      # Scope object.

      wrapper = Puppet::Parser::TemplateWrapper.new(self)
      begin
        wrapper.result(string)
      rescue => detail
        raise Puppet::ParseError,
          "Failed to parse inline template: #{detail}", detail.backtrace
      end
    end.join("")
end

Version data entries

134 entries across 134 versions & 2 rubygems

Version Path
puppet-retrospec-1.8.0 vendor/pup410/lib/puppet/parser/functions/inline_template.rb
puppet-retrospec-1.7.0 vendor/pup410/lib/puppet/parser/functions/inline_template.rb
puppet-4.10.12 lib/puppet/parser/functions/inline_template.rb
puppet-4.10.12-x86-mingw32 lib/puppet/parser/functions/inline_template.rb
puppet-4.10.12-x64-mingw32 lib/puppet/parser/functions/inline_template.rb
puppet-4.10.12-universal-darwin lib/puppet/parser/functions/inline_template.rb
puppet-4.10.11 lib/puppet/parser/functions/inline_template.rb
puppet-4.10.11-x86-mingw32 lib/puppet/parser/functions/inline_template.rb
puppet-4.10.11-x64-mingw32 lib/puppet/parser/functions/inline_template.rb
puppet-4.10.11-universal-darwin lib/puppet/parser/functions/inline_template.rb
puppet-4.10.10 lib/puppet/parser/functions/inline_template.rb
puppet-4.10.10-x86-mingw32 lib/puppet/parser/functions/inline_template.rb
puppet-4.10.10-x64-mingw32 lib/puppet/parser/functions/inline_template.rb
puppet-4.10.10-universal-darwin lib/puppet/parser/functions/inline_template.rb
puppet-retrospec-1.6.1 vendor/pup410/lib/puppet/parser/functions/inline_template.rb
puppet-retrospec-1.6.0 vendor/pup410/lib/puppet/parser/functions/inline_template.rb
puppet-4.10.9 lib/puppet/parser/functions/inline_template.rb
puppet-4.10.9-x86-mingw32 lib/puppet/parser/functions/inline_template.rb
puppet-4.10.9-x64-mingw32 lib/puppet/parser/functions/inline_template.rb
puppet-4.10.9-universal-darwin lib/puppet/parser/functions/inline_template.rb