repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/generate.rb | lib/puppet/face/generate.rb | # frozen_string_literal: true
require_relative '../../puppet/face'
require_relative '../../puppet/generate/type'
# Create the Generate face
Puppet::Face.define(:generate, '0.1.0') do
copyright 'Puppet Inc.', 2016
license _('Apache 2 license; see COPYING')
summary _('Generates Puppet code from Ruby definition... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/node.rb | lib/puppet/face/node.rb | # frozen_string_literal: true
require_relative '../../puppet/indirector/face'
Puppet::Indirector::Face.define(:node, '0.0.1') do
copyright "Puppet Inc.", 2011
license _("Apache 2 license; see COPYING")
summary _("View and manage node definitions.")
description <<-'EOT'
This subcommand interacts with nod... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/plugin.rb | lib/puppet/face/plugin.rb | # frozen_string_literal: true
require_relative '../../puppet/face'
require_relative '../../puppet/configurer/plugin_handler'
Puppet::Face.define(:plugin, '0.0.1') do
copyright "Puppet Inc.", 2011
license _("Apache 2 license; see COPYING")
summary _("Interact with the Puppet plugin system.")
description <<-... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/parser.rb | lib/puppet/face/parser.rb | # frozen_string_literal: true
require_relative '../../puppet/face'
require_relative '../../puppet/parser'
Puppet::Face.define(:parser, '0.0.1') do
copyright "Puppet Inc.", 2014
license _("Apache 2 license; see COPYING")
summary _("Interact directly with the parser.")
action :validate do
summary _("Val... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/catalog.rb | lib/puppet/face/catalog.rb | # frozen_string_literal: true
require_relative '../../puppet/indirector/face'
Puppet::Indirector::Face.define(:catalog, '0.0.1') do
copyright "Puppet Inc.", 2011
license "Apache 2 license; see COPYING"
summary _("Compile, save, view, and convert catalogs.")
description <<-'EOT'
This subcommand deals wi... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/epp.rb | lib/puppet/face/epp.rb | # frozen_string_literal: true
require_relative '../../puppet/face'
require_relative '../../puppet/pops'
require_relative '../../puppet/parser/files'
require_relative '../../puppet/file_system'
Puppet::Face.define(:epp, '0.0.1') do
copyright "Puppet Inc.", 2014
license _("Apache 2 license; see COPYING")
summa... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/help.rb | lib/puppet/face/help.rb | # frozen_string_literal: true
require_relative '../../puppet/face'
require_relative '../../puppet/application/face_base'
require_relative '../../puppet/util/constant_inflector'
require 'pathname'
require 'erb'
Puppet::Face.define(:help, '0.0.1') do
copyright "Puppet Inc.", 2011
license _("Apache 2 license; see ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/facts.rb | lib/puppet/face/facts.rb | # frozen_string_literal: true
require_relative '../../puppet/indirector/face'
require_relative '../../puppet/node/facts'
Puppet::Indirector::Face.define(:facts, '0.0.1') do
copyright "Puppet Inc.", 2011
license _("Apache 2 license; see COPYING")
summary _("Retrieve and store facts.")
description <<-'EOT'
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/config.rb | lib/puppet/face/config.rb | # frozen_string_literal: true
require_relative '../../puppet/face'
require_relative '../../puppet/settings/ini_file'
Puppet::Face.define(:config, '0.0.1') do
extend Puppet::Util::Colors
copyright "Puppet Inc.", 2011
license _("Apache 2 license; see COPYING")
summary _("Interact with Puppet's settings.")
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/module.rb | lib/puppet/face/module.rb | # frozen_string_literal: true
require_relative '../../puppet/face'
require_relative '../../puppet/module_tool'
require_relative '../../puppet/util/colors'
Puppet::Face.define(:module, '1.0.0') do
extend Puppet::Util::Colors
copyright "Puppet Inc.", 2012
license _("Apache 2 license; see COPYING")
summary _... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/catalog/select.rb | lib/puppet/face/catalog/select.rb | # frozen_string_literal: true
# Select and show a list of resources of a given type.
Puppet::Face.define(:catalog, '0.0.1') do
action :select do
summary _("Retrieve a catalog and filter it for resources of a given type.")
arguments _("<host> <resource_type>")
returns _(<<-'EOT')
A list of resource ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/node/clean.rb | lib/puppet/face/node/clean.rb | # frozen_string_literal: true
Puppet::Face.define(:node, '0.0.1') do
action(:clean) do
summary _("Clean up signed certs, cached facts, node objects, and reports for a node stored by the puppetmaster")
arguments _("<host1> [<host2> ...]")
description <<-'EOT'
Cleans up the following information a pu... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/module/uninstall.rb | lib/puppet/face/module/uninstall.rb | # frozen_string_literal: true
Puppet::Face.define(:module, '1.0.0') do
action(:uninstall) do
summary _("Uninstall a puppet module.")
description <<-EOT
Uninstalls a puppet module from the modulepath (or a specific
target directory).
Note: Module uninstall uses MD5 checksums, which are prohi... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/module/changes.rb | lib/puppet/face/module/changes.rb | # frozen_string_literal: true
Puppet::Face.define(:module, '1.0.0') do
action(:changes) do
summary _("Show modified files of an installed module.")
description <<-EOT
Shows any files in a module that have been modified since it was
installed. This action compares the files on disk to the md5 chec... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/module/upgrade.rb | lib/puppet/face/module/upgrade.rb | # encoding: UTF-8
# frozen_string_literal: true
Puppet::Face.define(:module, '1.0.0') do
action(:upgrade) do
summary _("Upgrade a puppet module.")
description <<-EOT
Upgrades a puppet module.
Note: Module upgrade uses MD5 checksums, which are prohibited on FIPS enabled systems.
EOT
retur... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/module/list.rb | lib/puppet/face/module/list.rb | # encoding: UTF-8
# frozen_string_literal: true
Puppet::Face.define(:module, '1.0.0') do
action(:list) do
summary _("List installed modules")
description <<-HEREDOC
Lists the installed puppet modules. By default, this action scans the
modulepath from puppet.conf's `[main]` block; use the --module... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/module/install.rb | lib/puppet/face/module/install.rb | # encoding: UTF-8
# frozen_string_literal: true
require_relative '../../../puppet/forge'
require_relative '../../../puppet/module_tool/install_directory'
require 'pathname'
Puppet::Face.define(:module, '1.0.0') do
action(:install) do
summary _("Install a module from the Puppet Forge or a release archive.")
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/confine/any.rb | lib/puppet/confine/any.rb | # frozen_string_literal: true
class Puppet::Confine::Any < Puppet::Confine
def self.summarize(confines)
confines.inject(0) { |count, confine| count + confine.summary }
end
def pass?(value)
!!value
end
def message(value)
"0 confines (of #{value.length}) were true"
end
def summary
result... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/confine/boolean.rb | lib/puppet/confine/boolean.rb | # frozen_string_literal: true
require_relative '../../puppet/confine'
# Common module for the Boolean confines. It currently
# contains just enough code to implement PUP-9336.
class Puppet::Confine
module Boolean
# Returns the passing value for the Boolean confine.
def passing_value
raise NotImplement... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/confine/feature.rb | lib/puppet/confine/feature.rb | # frozen_string_literal: true
require_relative '../../puppet/confine'
class Puppet::Confine::Feature < Puppet::Confine
def self.summarize(confines)
confines.collect(&:values).flatten.uniq.find_all { |value| !confines[0].pass?(value) }
end
# Is the named feature available?
def pass?(value)
Puppet.feat... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/confine/false.rb | lib/puppet/confine/false.rb | # frozen_string_literal: true
require_relative '../../puppet/confine/boolean'
class Puppet::Confine::False < Puppet::Confine
include Puppet::Confine::Boolean
def passing_value
false
end
def self.summarize(confines)
confines.inject(0) { |count, confine| count + confine.summary }
end
def pass?(va... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/confine/variable.rb | lib/puppet/confine/variable.rb | # frozen_string_literal: true
require_relative '../../puppet/confine'
# Require a specific value for a variable, either a Puppet setting
# or a Facter value. This class is a bit weird because the name
# is set explicitly by the ConfineCollection class -- from this class,
# it's not obvious how the name would ever ge... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/confine/true.rb | lib/puppet/confine/true.rb | # frozen_string_literal: true
require_relative '../../puppet/confine/boolean'
class Puppet::Confine::True < Puppet::Confine
include Puppet::Confine::Boolean
def passing_value
true
end
def self.summarize(confines)
confines.inject(0) { |count, confine| count + confine.summary }
end
def pass?(valu... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/confine/exists.rb | lib/puppet/confine/exists.rb | # frozen_string_literal: true
require_relative '../../puppet/confine'
class Puppet::Confine::Exists < Puppet::Confine
def self.summarize(confines)
confines.inject([]) { |total, confine| total + confine.summary }
end
def pass?(value)
value && (for_binary? ? which(value) : Puppet::FileSystem.exist?(value... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/resource.rb | lib/puppet/parser/resource.rb | # frozen_string_literal: true
require_relative '../../puppet/resource'
# The primary difference between this class and its
# parent is that this class has rules on who can set
# parameters
class Puppet::Parser::Resource < Puppet::Resource
require_relative 'resource/param'
require_relative '../../puppet/util/taggi... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/templatewrapper.rb | lib/puppet/parser/templatewrapper.rb | # frozen_string_literal: true
require_relative '../../puppet/parser/files'
require 'erb'
require_relative '../../puppet/file_system'
# A simple wrapper for templates, so they don't have full access to
# the scope objects.
#
# @api private
class Puppet::Parser::TemplateWrapper
include Puppet::Util
Puppet::Util.log... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/files.rb | lib/puppet/parser/files.rb | # frozen_string_literal: true
module Puppet::Parser::Files
module_function
# Return a list of manifests as absolute filenames matching the given
# pattern.
#
# @param pattern [String] A reference for a file in a module. It is the
# format "<modulename>/<file glob>"
# @param environment [Puppet::Node::... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/compiler.rb | lib/puppet/parser/compiler.rb | # frozen_string_literal: true
require 'forwardable'
require_relative '../../puppet/node'
require_relative '../../puppet/resource/catalog'
require_relative '../../puppet/util/errors'
require_relative '../../puppet/loaders'
require_relative '../../puppet/pops'
# Maintain a graph of scopes, along with a bunch of data
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/e4_parser_adapter.rb | lib/puppet/parser/e4_parser_adapter.rb | # frozen_string_literal: true
require_relative '../../puppet/pops'
module Puppet
module Parser
# Adapts an egrammar/eparser to respond to the public API of the classic parser
# and makes use of the new evaluator.
#
class E4ParserAdapter
def initialize
@file = ''
@string = ''
@use = :unspecified
end
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/relationship.rb | lib/puppet/parser/relationship.rb | # frozen_string_literal: true
class Puppet::Parser::Relationship
attr_accessor :source, :target, :type
PARAM_MAP = { :relationship => :before, :subscription => :notify }
def arrayify(resources, left)
case resources
when Puppet::Pops::Evaluator::Collectors::AbstractCollector
# on the LHS, go as fa... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/script_compiler.rb | lib/puppet/parser/script_compiler.rb | # frozen_string_literal: true
require_relative '../../puppet/loaders'
require_relative '../../puppet/pops'
# A Script "compiler" that does not support catalog operations
#
# The Script compiler is "one shot" - it does not support rechecking if underlying source has changed or
# deal with possible errors in a cached e... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/catalog_compiler.rb | lib/puppet/parser/catalog_compiler.rb | # frozen_string_literal: true
require_relative '../../puppet/loaders'
require_relative '../../puppet/pops'
# A Catalog "compiler" that is like the regular compiler but with an API
# that is harmonized with the ScriptCompiler
#
# The Script compiler is "one shot" - it does not support rechecking if underlying source h... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/scope.rb | lib/puppet/parser/scope.rb | # frozen_string_literal: true
# The scope class, which handles storing and retrieving variables and types and
# such.
require 'forwardable'
require_relative '../../puppet/parser'
require_relative '../../puppet/parser/templatewrapper'
require_relative '../../puppet/parser/resource'
# This class is part of the interna... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | true |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/parser_factory.rb | lib/puppet/parser/parser_factory.rb | # frozen_string_literal: true
module Puppet; end
module Puppet::Parser
# The ParserFactory makes selection of parser possible.
# Currently, it is possible to switch between two different parsers:
# * classic_parser, the parser in 3.1
# * eparser, the Expression Based Parser
#
class ParserFactory
# Pro... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/type_loader.rb | lib/puppet/parser/type_loader.rb | # frozen_string_literal: true
require 'find'
require 'forwardable'
require_relative '../../puppet/parser/parser_factory'
class Puppet::Parser::TypeLoader
extend Forwardable
class TypeLoaderError < StandardError; end
# Import manifest files that match a given file glob pattern.
#
# @param pattern [String] ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions.rb | lib/puppet/parser/functions.rb | # frozen_string_literal: true
require_relative '../../puppet/util/autoload'
require_relative '../../puppet/parser/scope'
require_relative '../../puppet/pops/adaptable'
require_relative '../../puppet/concurrent/lock'
# A module for managing parser functions. Each specified function
# is added to a central module that... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/abstract_compiler.rb | lib/puppet/parser/abstract_compiler.rb | # frozen_string_literal: true
module Puppet::Parser::AbstractCompiler
# Returns the catalog for a compilation. Must return a Puppet::Resource::Catalog or fail with an
# error if the specific compiler does not support catalog operations.
#
def catalog
raise Puppet::DevError("Class '#{self.class}' should hav... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/ast.rb | lib/puppet/parser/ast.rb | # frozen_string_literal: true
# The base class for the 3x "parse tree", now only used by the top level
# constructs and the compiler.
# Handles things like file name, line #, and also does the initialization
# for all of the parameters of all of the child objects.
#
class Puppet::Parser::AST
AST = Puppet::Parser::AS... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/resource/param.rb | lib/puppet/parser/resource/param.rb | # frozen_string_literal: true
# The parameters we stick in Resources.
class Puppet::Parser::Resource::Param
include Puppet::Util
include Puppet::Util::Errors
attr_accessor :name, :value, :source, :add, :file, :line
def initialize(name: nil, value: nil, source: nil, line: nil, file: nil, add: nil)
@value ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/shellquote.rb | lib/puppet/parser/functions/shellquote.rb | # frozen_string_literal: true
# Copyright (C) 2009 Thomas Bellman
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, cop... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/tag.rb | lib/puppet/parser/functions/tag.rb | # frozen_string_literal: true
# Tag the current scope with each passed name
Puppet::Parser::Functions.newfunction(:tag, :arity => -2, :doc => "Add the specified tags to the containing class
or definition. All contained objects will then acquire that tag, also.
") do |vals|
if Puppet[:tasks]
raise Puppet::Pa... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/find_file.rb | lib/puppet/parser/functions/find_file.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:find_file,
:type => :rvalue,
:arity => -2,
:doc => <<~DOC
Finds an existing file from a module and returns its path.
The argument to this function should be a String as a `<MODULE NAME>/<FILE>`
reference, which will search for `... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/hiera_array.rb | lib/puppet/parser/functions/hiera_array.rb | # frozen_string_literal: true
require 'hiera_puppet'
module Puppet::Parser::Functions
newfunction(
:hiera_array,
:type => :rvalue,
:arity => -2,
:doc => <<~DOC
Finds all matches of a key throughout the hierarchy and returns them as a single flattened
array of unique values. If any of the... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/binary_file.rb | lib/puppet/parser/functions/binary_file.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:binary_file,
:type => :rvalue,
:arity => 1,
:doc => <<~DOC
Loads a binary file from a module or file system and returns its contents as a Binary.
The argument to this function should be a `<MODULE NAME>/<FILE>`
reference, which ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/reduce.rb | lib/puppet/parser/functions/reduce.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:reduce,
:type => :rvalue,
:arity => -3,
:doc => <<~DOC
Applies a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html)
to every value in a data structure from the first argument, carrying over the returned
value of ea... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/slice.rb | lib/puppet/parser/functions/slice.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:slice,
:type => :rvalue,
:arity => -3,
:doc => <<~DOC
This function takes two mandatory arguments: the first should be an array or hash, and the second specifies
the number of elements to include in each slice.
When the first ar... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/include.rb | lib/puppet/parser/functions/include.rb | # frozen_string_literal: true
# Include the specified classes
Puppet::Parser::Functions.newfunction(:include, :arity => -2, :doc =>
"Declares one or more classes, causing the resources in them to be
evaluated and added to the catalog. Accepts a class name, an array of class
names, or a comma-separated list of class na... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/generate.rb | lib/puppet/parser/functions/generate.rb | # frozen_string_literal: true
# Runs an external command and returns the results
Puppet::Parser::Functions.newfunction(:generate, :arity => -2, :type => :rvalue,
:doc => "Calls an external command on the Puppet master and returns
the results of the command. Any argu... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/fqdn_rand.rb | lib/puppet/parser/functions/fqdn_rand.rb | # frozen_string_literal: true
require 'digest/md5'
require 'digest/sha2'
Puppet::Parser::Functions.newfunction(:fqdn_rand, :arity => -2, :type => :rvalue, :doc =>
"Usage: `fqdn_rand(MAX, [SEED], [DOWNCASE])`. MAX is required and must be a positive
integer; SEED is optional and may be any number or string; DOWNCAS... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/type.rb | lib/puppet/parser/functions/type.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:type,
:type => :rvalue,
:arity => -1,
:doc => <<~DOC
Returns the data type of a given value with a given degree of generality.
```puppet
type InferenceFidelity = Enum[generalized, reduced, detailed]
function type(Any $value... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/hiera_hash.rb | lib/puppet/parser/functions/hiera_hash.rb | # frozen_string_literal: true
require 'hiera_puppet'
module Puppet::Parser::Functions
newfunction(
:hiera_hash,
:type => :rvalue,
:arity => -2,
:doc => <<~DOC
Finds all matches of a key throughout the hierarchy and returns them in a merged hash.
If any of the matched hashes share keys, t... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/new.rb | lib/puppet/parser/functions/new.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:new,
:type => :rvalue,
:arity => -1,
:doc => <<~DOC
Creates a new instance/object of a given data type.
This function makes it possible to create new instances of
concrete data types. If a block is given it is called with the
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | true |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/hiera_include.rb | lib/puppet/parser/functions/hiera_include.rb | # frozen_string_literal: true
require 'hiera_puppet'
module Puppet::Parser::Functions
newfunction(
:hiera_include,
:arity => -2,
:doc => <<~DOC
Assigns classes to a node using an
[array merge lookup](https://puppet.com/docs/hiera/latest/lookup_types.html#array-merge)
that retrieves the... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/digest.rb | lib/puppet/parser/functions/digest.rb | # frozen_string_literal: true
require_relative '../../../puppet/util/checksums'
Puppet::Parser::Functions.newfunction(:digest, :type => :rvalue, :arity => 1, :doc => "Returns a hash value from a provided string using the digest_algorithm setting from the Puppet config file.") do |args|
algo = Puppet[:digest_algorith... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/filter.rb | lib/puppet/parser/functions/filter.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:filter,
:type => :rvalue,
:arity => -3,
:doc => <<~DOC
Applies a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html)
to every value in a data structure and returns an array or hash containing any elements
for which ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/file.rb | lib/puppet/parser/functions/file.rb | # frozen_string_literal: true
require_relative '../../../puppet/file_system'
Puppet::Parser::Functions.newfunction(
:file, :arity => -2, :type => :rvalue,
:doc => "Loads a file from a module and returns its contents as a string.
The argument to this function should be a `<MODULE NAME>/<FILE>`
referenc... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/realize.rb | lib/puppet/parser/functions/realize.rb | # frozen_string_literal: true
# This is just syntactic sugar for a collection, although it will generally
# be a good bit faster.
Puppet::Parser::Functions.newfunction(:realize, :arity => -2, :doc => "Make a virtual object real. This is useful
when you want to know the name of the virtual object and don't want t... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/tagged.rb | lib/puppet/parser/functions/tagged.rb | # frozen_string_literal: true
# Test whether a given tag is set. This functions as a big OR -- if any of the specified tags are unset, we return false.
Puppet::Parser::Functions.newfunction(:tagged, :type => :rvalue, :arity => -2, :doc => "A boolean function that
tells you whether the current container is tagged wi... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/hiera.rb | lib/puppet/parser/functions/hiera.rb | # frozen_string_literal: true
require 'hiera_puppet'
module Puppet::Parser::Functions
newfunction(
:hiera,
:type => :rvalue,
:arity => -2,
:doc => <<~DOC
Performs a standard priority lookup of the hierarchy and returns the most specific value
for a given key. The returned value can be an... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/step.rb | lib/puppet/parser/functions/step.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:step,
:type => :rvalue,
:arity => -1,
:doc => <<~DOC
Provides stepping with given interval over elements in an iterable and optionally runs a
[lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) for each
element.
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/md5.rb | lib/puppet/parser/functions/md5.rb | # frozen_string_literal: true
require 'digest/md5'
Puppet::Parser::Functions.newfunction(:md5, :type => :rvalue, :arity => 1, :doc => "Returns a MD5 hash value from a provided string.") do |args|
Digest::MD5.hexdigest(args[0])
end
| ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/epp.rb | lib/puppet/parser/functions/epp.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(:epp, :type => :rvalue, :arity => -2, :doc =>
"Evaluates an Embedded Puppet (EPP) template file and returns the rendered text
result as a String.
`epp('<MODULE NAME>/<TEMPLATE FILE>', <PARAMETER HASH>)`
The first argument to this function should be ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/defined.rb | lib/puppet/parser/functions/defined.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:defined,
:type => :rvalue,
:arity => -2,
:doc => <<~DOC
Determines whether a given class or resource type is defined and returns a Boolean
value. You can also use `defined` to determine whether a specific resource is defined,
or ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/contain.rb | lib/puppet/parser/functions/contain.rb | # frozen_string_literal: true
# Called within a class definition, establishes a containment
# relationship with another class
Puppet::Parser::Functions.newfunction(
:contain,
:arity => -2,
:doc => "Contain one or more classes inside the current class. If any of
these classes are undeclared, they will be declare... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/sprintf.rb | lib/puppet/parser/functions/sprintf.rb | # frozen_string_literal: true
# Copyright (C) 2009 Thomas Bellman
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, cop... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/strftime.rb | lib/puppet/parser/functions/strftime.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:strftime,
:type => :rvalue,
:arity => -3,
:doc => <<~DOC
Formats timestamp or timespan according to the directives in the given format string. The directives begins with a percent (%) character.
Any text not listed as a directive wil... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/sha1.rb | lib/puppet/parser/functions/sha1.rb | # frozen_string_literal: true
require 'digest/sha1'
Puppet::Parser::Functions.newfunction(:sha1, :type => :rvalue, :arity => 1, :doc => "Returns a SHA1 hash value from a provided string.") do |args|
Digest::SHA1.hexdigest(args[0])
end
| ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/match.rb | lib/puppet/parser/functions/match.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:match,
:arity => 2,
:doc => <<~DOC
Matches a regular expression against a string and returns an array containing the match
and any matched capturing groups.
The first argument is a string or array of strings. The second argument i... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/lest.rb | lib/puppet/parser/functions/lest.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:lest,
:type => :rvalue,
:arity => -2,
:doc => <<~DOC
Call a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html)
(which should accept no arguments) if the argument given to the function is `undef`.
Returns the result... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/template.rb | lib/puppet/parser/functions/template.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(:template, :type => :rvalue, :arity => -2, :doc =>
"Loads an ERB template from a module, evaluates it, and returns the resulting
value as a string.
The argument to this function should be a `<MODULE NAME>/<TEMPLATE FILE>`
reference, which wil... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/require.rb | lib/puppet/parser/functions/require.rb | # frozen_string_literal: true
# Requires the specified classes
Puppet::Parser::Functions.newfunction(
:require,
:arity => -2,
:doc => "Evaluate one or more classes, adding the required class as a dependency.
The relationship metaparameters work well for specifying relationships
between individual resources, b... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/assert_type.rb | lib/puppet/parser/functions/assert_type.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:assert_type,
:type => :rvalue,
:arity => -3,
:doc => <<~DOC
Returns the given value if it is of the given
[data type](https://puppet.com/docs/puppet/latest/lang_data.html), or
otherwise either raises an error or executes an optio... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/next.rb | lib/puppet/parser/functions/next.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:next,
:arity => -2,
:doc => <<~DOC
Immediately returns the given optional value from a block (lambda), function, class body or user defined type body.
If a value is not given, an `undef` value is returned. This function does not return... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/fail.rb | lib/puppet/parser/functions/fail.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:fail,
:arity => -1,
:doc => <<~DOC
Fail with a parse error. Any parameters will be stringified,
concatenated, and passed to the exception-handler.
DOC
) do |vals|
vals = vals.collect(&:to_s).join(" ") if vals.is_a? Array
raise Pu... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/create_resources.rb | lib/puppet/parser/functions/create_resources.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(:create_resources, :arity => -3, :doc => <<-'ENDHEREDOC') do |args|
Converts a hash into a set of resources and adds them to the catalog.
**Note**: Use this function selectively. It's generally better to write resources in
[Puppet](https... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/split.rb | lib/puppet/parser/functions/split.rb | # frozen_string_literal: true
module Puppet::Parser::Functions
newfunction(
:split, :type => :rvalue,
:arity => 2,
:doc => "\
Split a string variable into an array using the specified split regexp.
*Example:*
$string = 'v1.v2:v3.v4'
$array_var1 = split($string, ':')
$ar... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/scanf.rb | lib/puppet/parser/functions/scanf.rb | # frozen_string_literal: true
require 'scanf'
Puppet::Parser::Functions.newfunction(
:scanf,
:type => :rvalue,
:arity => 2,
:doc => <<~DOC
Scans a string and returns an array of one or more converted values based on the given format string.
See the documentation of Ruby's String#scanf method for detai... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/map.rb | lib/puppet/parser/functions/map.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:map,
:type => :rvalue,
:arity => -3,
:doc => <<~DOC
Applies a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html)
to every value in a data structure and returns an array containing the results.
This function takes ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/inline_template.rb | lib/puppet/parser/functions/inline_template.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(:inline_template, :type => :rvalue, :arity => -2, :doc =>
"Evaluate a template string and return its value. See
[the templating docs](https://puppet.com/docs/puppet/latest/lang_template.html) for
more information. Note that if multiple template... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/return.rb | lib/puppet/parser/functions/return.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:return,
:arity => -2,
:doc => <<~DOC
Immediately returns the given optional value from a function, class body or user defined type body.
If a value is not given, an `undef` value is returned. This function does not return to the immedi... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/each.rb | lib/puppet/parser/functions/each.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:each,
:type => :rvalue,
:arity => -3,
:doc => <<~DOC
Runs a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html)
repeatedly using each value in a data structure, then returns the values unchanged.
This function take... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/lookup.rb | lib/puppet/parser/functions/lookup.rb | # frozen_string_literal: true
module Puppet::Parser::Functions
newfunction(:lookup, :type => :rvalue, :arity => -2, :doc => <<~'ENDHEREDOC') do |_args|
Uses the Puppet lookup system to retrieve a value for a given key. By default,
this returns the first value found (and fails compilation if no values are
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/versioncmp.rb | lib/puppet/parser/functions/versioncmp.rb | # frozen_string_literal: true
require_relative '../../../puppet/util/package'
Puppet::Parser::Functions.newfunction(:versioncmp, :type => :rvalue, :arity => 2, :doc =>
"Compares two version numbers.
Prototype:
\$result = versioncmp(a, b)
Where a and b are arbitrary version strings.
This function returns:
* `... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/inline_epp.rb | lib/puppet/parser/functions/inline_epp.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(:inline_epp, :type => :rvalue, :arity => -2, :doc =>
"Evaluates an Embedded Puppet (EPP) template string and returns the rendered
text result as a String.
`inline_epp('<EPP TEMPLATE STRING>', <PARAMETER HASH>)`
The first argument to this function sh... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/regsubst.rb | lib/puppet/parser/functions/regsubst.rb | # frozen_string_literal: true
# Copyright (C) 2009 Thomas Bellman
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, cop... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/break.rb | lib/puppet/parser/functions/break.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:break,
:arity => 0,
:doc => <<~DOC
Breaks the innermost iteration as if it encountered an end of input.
This function does not return to the caller.
The signal produced to stop the iteration bubbles up through
the call stack u... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/dig.rb | lib/puppet/parser/functions/dig.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:dig,
:type => :rvalue,
:arity => -1,
:doc => <<~DOC
Returns a value for a sequence of given keys/indexes into a structure, such as
an array or hash.
This function is used to "dig into" a complex data structure by
using a sequ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/then.rb | lib/puppet/parser/functions/then.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:then,
:type => :rvalue,
:arity => -2,
:doc => <<~DOC
Call a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html)
with the given argument unless the argument is undef. Return `undef` if argument is
`undef`, and otherw... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/reverse_each.rb | lib/puppet/parser/functions/reverse_each.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:reverse_each,
:type => :rvalue,
:arity => -1,
:doc => <<~DOC
Reverses the order of the elements of something that is iterable and optionally runs a
[lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) for each
elemen... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/with.rb | lib/puppet/parser/functions/with.rb | # frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:with,
:type => :rvalue,
:arity => -1,
:doc => <<~DOC
Call a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html)
with the given arguments and return the result. Since a lambda's scope is
local to the lambda, you can ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/sha256.rb | lib/puppet/parser/functions/sha256.rb | # frozen_string_literal: true
require 'digest/sha2'
Puppet::Parser::Functions.newfunction(:sha256, :type => :rvalue, :arity => 1, :doc => "Returns a SHA256 hash value from a provided string.") do |args|
Digest::SHA256.hexdigest(args[0])
end
| ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/ast/resource.rb | lib/puppet/parser/ast/resource.rb | # frozen_string_literal: true
# Instruction for Resource instantiation.
# Instantiates resources of both native and user defined types.
#
class Puppet::Parser::AST::Resource < Puppet::Parser::AST::Branch
attr_accessor :type, :instances, :exported, :virtual
def initialize(argshash)
Puppet.warn_once('deprecatio... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/ast/resourceparam.rb | lib/puppet/parser/ast/resourceparam.rb | # frozen_string_literal: true
# The AST object for the parameters inside resource expressions
#
class Puppet::Parser::AST::ResourceParam < Puppet::Parser::AST::Branch
attr_accessor :value, :param, :add
def initialize(argshash)
Puppet.warn_once('deprecations', 'AST::ResourceParam', _('Use of Puppet::Parser::AS... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/ast/node.rb | lib/puppet/parser/ast/node.rb | # frozen_string_literal: true
class Puppet::Parser::AST::Node < Puppet::Parser::AST::TopLevelConstruct
attr_accessor :names, :context
def initialize(names, context = {})
raise ArgumentError, _("names should be an array") unless names.is_a? Array
if context[:parent]
raise Puppet::DevError, _("Node in... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/ast/block_expression.rb | lib/puppet/parser/ast/block_expression.rb | # frozen_string_literal: true
# Evaluates contained expressions, produce result of the last
#
class Puppet::Parser::AST::BlockExpression < Puppet::Parser::AST::Branch
def evaluate(scope)
@children.reduce(nil) { |_, child| child.safeevaluate(scope) }
end
def sequence_with(other)
Puppet::Parser::AST::Bloc... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/ast/resource_instance.rb | lib/puppet/parser/ast/resource_instance.rb | # frozen_string_literal: true
# A simple container for a parameter for an object. Consists of a
# title and a set of parameters.
#
class Puppet::Parser::AST::ResourceInstance < Puppet::Parser::AST::Branch
attr_accessor :title, :parameters
def initialize(argshash)
Puppet.warn_once('deprecations', 'AST::Resour... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/ast/pops_bridge.rb | lib/puppet/parser/ast/pops_bridge.rb | # frozen_string_literal: true
require_relative '../../../puppet/parser/ast/top_level_construct'
require_relative '../../../puppet/pops'
# The AST::Bridge contains classes that bridges between the new Pops based model
# and the 3.x AST. This is required to be able to reuse the Puppet::Resource::Type which is
# fundame... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/ast/leaf.rb | lib/puppet/parser/ast/leaf.rb | # frozen_string_literal: true
# The base class for all of the leaves of the parse trees. These
# basically just have types and values. Both of these parameters
# are simple values, not AST objects.
#
class Puppet::Parser::AST::Leaf < Puppet::Parser::AST
attr_accessor :value, :type
# Return our value.
def eval... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/ast/top_level_construct.rb | lib/puppet/parser/ast/top_level_construct.rb | # frozen_string_literal: true
# The base class for AST nodes representing top level things:
# hostclasses, definitions, and nodes.
class Puppet::Parser::AST::TopLevelConstruct < Puppet::Parser::AST
end
| ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/ast/hostclass.rb | lib/puppet/parser/ast/hostclass.rb | # frozen_string_literal: true
require_relative '../../../puppet/parser/ast/top_level_construct'
class Puppet::Parser::AST::Hostclass < Puppet::Parser::AST::TopLevelConstruct
attr_accessor :name, :context
def initialize(name, context = {})
@context = context
@name = name
end
def instantiate(modname)
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.