Sha256: 38282c2fea676b094e875bfaeaad1fd97299d688937c775a4cf214816b9cc6c5

Contents?: true

Size: 841 Bytes

Versions: 22

Compression:

Stored size: 841 Bytes

Contents

# Include the specified classes
Puppet::Parser::Functions::newfunction(:include, :arity => -2, :doc => "Evaluate one or more classes.") do |vals|
    if vals.is_a?(Array)
      # Protect against array inside array
      vals = vals.flatten
    else
      vals = [vals]
    end

    # The 'false' disables lazy evaluation.
    klasses = compiler.evaluate_classes(vals, self, false)

    missing = vals.find_all do |klass|
      ! klasses.include?(klass)
    end

    unless missing.empty?
      # Throw an error if we didn't evaluate all of the classes.
      str = "Could not find class"
      str += "es" if missing.length > 1

      str += " " + missing.join(", ")

      if n = namespaces and ! n.empty? and n != [""]
        str += " in namespaces #{@namespaces.join(", ")}"
      end
      self.fail Puppet::ParseError, str
    end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
puppet-3.3.2 lib/puppet/parser/functions/include.rb
puppet-3.3.1 lib/puppet/parser/functions/include.rb
puppet-3.3.1.rc3 lib/puppet/parser/functions/include.rb
puppet-3.3.1.rc2 lib/puppet/parser/functions/include.rb
puppet-3.3.1.rc1 lib/puppet/parser/functions/include.rb
puppet-3.3.0 lib/puppet/parser/functions/include.rb
puppet-3.3.0.rc3 lib/puppet/parser/functions/include.rb
puppet-3.3.0.rc2 lib/puppet/parser/functions/include.rb
puppet-3.2.4 lib/puppet/parser/functions/include.rb
puppet-3.2.3 lib/puppet/parser/functions/include.rb
puppet-3.2.3.rc1 lib/puppet/parser/functions/include.rb
puppet-3.2.2 lib/puppet/parser/functions/include.rb
puppet-3.2.1 lib/puppet/parser/functions/include.rb
puppet-3.2.1.rc1 lib/puppet/parser/functions/include.rb
puppet-3.2.0.rc2 lib/puppet/parser/functions/include.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/lib/puppet/parser/functions/include.rb
puppet-3.2.0.rc1 lib/puppet/parser/functions/include.rb
puppet-3.1.1 lib/puppet/parser/functions/include.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/lib/puppet/parser/functions/include.rb
puppet-3.1.0 lib/puppet/parser/functions/include.rb