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/provider/package/ports.rb
lib/puppet/provider/package/ports.rb
# frozen_string_literal: true Puppet::Type.type(:package).provide :ports, :parent => :freebsd, :source => :freebsd do desc "Support for FreeBSD's ports. Note that this, too, mixes packages and ports." commands :portupgrade => "/usr/local/sbin/portupgrade", :portversion => "/usr/local/sbin/portversion"...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/pkg.rb
lib/puppet/provider/package/pkg.rb
# frozen_string_literal: true require_relative '../../../puppet/provider/package' Puppet::Type.type(:package).provide :pkg, :parent => Puppet::Provider::Package do desc "OpenSolaris image packaging system. See pkg(5) for more information. This provider supports the `install_options` attribute, which allows ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/rug.rb
lib/puppet/provider/package/rug.rb
# frozen_string_literal: true Puppet::Type.type(:package).provide :rug, :parent => :rpm do desc "Support for suse `rug` package manager." has_feature :versionable commands :rug => "/usr/bin/rug" commands :rpm => "rpm" confine 'os.name' => [:suse, :sles] # Install a package using 'rug'. def install ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/windows.rb
lib/puppet/provider/package/windows.rb
# frozen_string_literal: true require_relative '../../../puppet/provider/package' require_relative '../../../puppet/util/windows' require_relative 'windows/package' Puppet::Type.type(:package).provide(:windows, :parent => Puppet::Provider::Package) do desc "Windows package management. This provider supports ei...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/gem.rb
lib/puppet/provider/package/gem.rb
# frozen_string_literal: true require_relative '../../../puppet/util/package/version/gem' require_relative '../../../puppet/util/package/version/range' require_relative '../../../puppet/provider/package_targetable' require 'uri' # Ruby gems support. Puppet::Type.type(:package).provide :gem, :parent => Puppet::Provide...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/pkgdmg.rb
lib/puppet/provider/package/pkgdmg.rb
# frozen_string_literal: true # # Motivation: DMG files provide a true HFS file system # and are easier to manage and .pkg bundles. # # Note: the 'apple' Provider checks for the package name # in /L/Receipts. Since we install multiple pkg's from a single # source, we treat the source .pkg.dmg file as the package name...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/dpkg.rb
lib/puppet/provider/package/dpkg.rb
# frozen_string_literal: true require_relative '../../../puppet/provider/package' Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package do desc "Package management via `dpkg`. Because this only uses `dpkg` and not `apt`, you must specify the source of any packages you want to mana...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/fink.rb
lib/puppet/provider/package/fink.rb
# frozen_string_literal: true Puppet::Type.type(:package).provide :fink, :parent => :dpkg, :source => :dpkg do # Provide sorting functionality include Puppet::Util::Package desc "Package management via `fink`." commands :fink => "/sw/bin/fink" commands :aptget => "/sw/bin/apt-get" commands :aptcache => "...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/rpm.rb
lib/puppet/provider/package/rpm.rb
# frozen_string_literal: true require_relative '../../../puppet/provider/package' require_relative '../../../puppet/util/rpm_compare' # RPM packaging. Should work anywhere that has rpm installed. Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Provider::Package do # provides Rpm parsi...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/windows/package.rb
lib/puppet/provider/package/windows/package.rb
# frozen_string_literal: true require_relative '../../../../puppet/provider/package' require_relative '../../../../puppet/util/windows' class Puppet::Provider::Package::Windows class Package extend Enumerable extend Puppet::Util::Errors include Puppet::Util::Windows::Registry extend Puppet::Util::W...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/windows/exe_package.rb
lib/puppet/provider/package/windows/exe_package.rb
# frozen_string_literal: true require_relative '../../../../puppet/provider/package/windows/package' class Puppet::Provider::Package::Windows class ExePackage < Puppet::Provider::Package::Windows::Package attr_reader :uninstall_string # registry values to load under each product entry in # HKLM\SOFTWAR...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/windows/msi_package.rb
lib/puppet/provider/package/windows/msi_package.rb
# frozen_string_literal: true require_relative '../../../../puppet/provider/package/windows/package' class Puppet::Provider::Package::Windows class MsiPackage < Puppet::Provider::Package::Windows::Package attr_reader :productcode, :packagecode # From msi.h INSTALLSTATE_DEFAULT = 5 # product is installe...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_bucket/file.rb
lib/puppet/file_bucket/file.rb
# frozen_string_literal: true require_relative '../../puppet/file_bucket' require_relative '../../puppet/indirector' require_relative '../../puppet/util/checksums' require 'digest/md5' require 'stringio' class Puppet::FileBucket::File # This class handles the abstract notion of a file in a filebucket. # There are...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_bucket/dipper.rb
lib/puppet/file_bucket/dipper.rb
# frozen_string_literal: true require 'pathname' require_relative '../../puppet/file_bucket' require_relative '../../puppet/file_bucket/file' require_relative '../../puppet/indirector/request' require_relative '../../puppet/util/diff' require 'tempfile' class Puppet::FileBucket::Dipper include Puppet::Util::Checksu...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/state_machine.rb
lib/puppet/ssl/state_machine.rb
# frozen_string_literal: true require_relative '../../puppet/ssl' require_relative '../../puppet/util/pidlock' # This class implements a state machine for bootstrapping a host's CA and CRL # bundles, private key and signed client certificate. Each state has a frozen # SSLContext that it uses to make network connectio...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/ssl_context.rb
lib/puppet/ssl/ssl_context.rb
# frozen_string_literal: true require_relative '../../puppet/ssl' module Puppet::SSL # The `keyword_init: true` option is no longer needed in Ruby >= 3.2 SSLContext = Struct.new( :store, :cacerts, :crls, :private_key, :client_cert, :client_chain, :revocation, :verify_peer, keyw...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/verifier.rb
lib/puppet/ssl/verifier.rb
# frozen_string_literal: true require_relative '../../puppet/ssl' # Verify an SSL connection. # # @api private class Puppet::SSL::Verifier FIVE_MINUTES_AS_SECONDS = 5 * 60 attr_reader :ssl_context # Create a verifier using an `ssl_context`. # # @param hostname [String] FQDN of the server we're attempting ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/digest.rb
lib/puppet/ssl/digest.rb
# frozen_string_literal: true class Puppet::SSL::Digest attr_reader :digest def initialize(algorithm, content) algorithm ||= 'SHA256' @digest = OpenSSL::Digest.new(algorithm, content) end def to_s "(#{name}) #{to_hex}" end def to_hex @digest.hexdigest.scan(/../).join(':').upcase end ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/certificate_request.rb
lib/puppet/ssl/certificate_request.rb
# frozen_string_literal: true require_relative '../../puppet/ssl/base' require_relative '../../puppet/ssl/certificate_signer' # This class creates and manages X509 certificate signing requests. # # ## CSR attributes # # CSRs may contain a set of attributes that includes supplementary information # about the CSR or in...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/base.rb
lib/puppet/ssl/base.rb
# frozen_string_literal: true require_relative '../../puppet/ssl/openssl_loader' require_relative '../../puppet/ssl' require_relative '../../puppet/ssl/digest' # The base class for wrapping SSL instances. class Puppet::SSL::Base # For now, use the YAML separator. SEPARATOR = "\n---\n" # Only allow printing asc...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/ssl_provider.rb
lib/puppet/ssl/ssl_provider.rb
# frozen_string_literal: true require_relative '../../puppet/ssl' # SSL Provider creates `SSLContext` objects that can be used to create # secure connections. # # @example To load an SSLContext from an existing private key and related certs/crls: # ssl_context = provider.load_context # # @example To load an SSLCont...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/openssl_loader.rb
lib/puppet/ssl/openssl_loader.rb
# frozen_string_literal: true require_relative '../../puppet/util/platform' # This file should be required instead of writing `require 'openssl'` # or any library that loads openssl like `net/https`. This allows the # core Puppet code to load correctly in JRuby environments that do not # have a functioning openssl (e...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/certificate_request_attributes.rb
lib/puppet/ssl/certificate_request_attributes.rb
# frozen_string_literal: true require_relative '../../puppet/ssl' require_relative '../../puppet/util/yaml' # This class transforms simple key/value pairs into the equivalent ASN1 # structures. Values may be strings or arrays of strings. # # @api private class Puppet::SSL::CertificateRequestAttributes attr_reader :...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/certificate_signer.rb
lib/puppet/ssl/certificate_signer.rb
# frozen_string_literal: true # Take care of signing a certificate in a FIPS 140-2 compliant manner. # # @see https://projects.puppetlabs.com/issues/17295 # # @api private class Puppet::SSL::CertificateSigner # @!attribute [r] digest # @return [OpenSSL::Digest] attr_reader :digest def initialize if Open...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/error.rb
lib/puppet/ssl/error.rb
# frozen_string_literal: true module Puppet::SSL class SSLError < Puppet::Error; end class CertVerifyError < Puppet::SSL::SSLError attr_reader :code, :cert def initialize(message, code, cert) super(message) @code = code @cert = cert end end class CertMismatchError < Puppet::SSL...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/certificate.rb
lib/puppet/ssl/certificate.rb
# frozen_string_literal: true require_relative '../../puppet/ssl/base' # Manage certificates themselves. This class has no # 'generate' method because the CA is responsible # for turning CSRs into certificates; we can only # retrieve them from the CA (or not, as is often # the case). # # @deprecated Use {Puppet::SSL...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/oids.rb
lib/puppet/ssl/oids.rb
# frozen_string_literal: true require_relative '../../puppet/ssl' # This module defines OIDs for use within Puppet. # # # ASN.1 Definition # # The following is the formal definition of OIDs specified in this file. # # ``` # puppetCertExtensions OBJECT IDENTIFIER ::= {iso(1) identified-organization(3) # dod(6) inte...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ffi/posix.rb
lib/puppet/ffi/posix.rb
# frozen_string_literal: true require 'ffi' module Puppet module FFI module POSIX require_relative 'posix/functions' require_relative 'posix/constants' end end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ffi/windows.rb
lib/puppet/ffi/windows.rb
# frozen_string_literal: true require 'ffi' module Puppet module FFI module Windows require_relative 'windows/api_types' require_relative 'windows/constants' require_relative 'windows/structs' require_relative 'windows/functions' end end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ffi/posix/constants.rb
lib/puppet/ffi/posix/constants.rb
# frozen_string_literal: true require_relative '../../../puppet/ffi/posix' module Puppet::FFI::POSIX module Constants extend FFI::Library # Maximum number of supplementary groups (groups # that a user can be in plus its primary group) # (64 + 1 primary group) # Chosen a reasonable middle number...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ffi/posix/functions.rb
lib/puppet/ffi/posix/functions.rb
# frozen_string_literal: true require_relative '../../../puppet/ffi/posix' module Puppet::FFI::POSIX module Functions extend FFI::Library ffi_convention :stdcall # https://man7.org/linux/man-pages/man3/getgrouplist.3.html # int getgrouplist ( # const char *user, # gid_t group, # ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ffi/windows/api_types.rb
lib/puppet/ffi/windows/api_types.rb
# frozen_string_literal: true require_relative '../../../puppet/ffi/windows' require_relative '../../../puppet/util/windows/string' module Puppet::FFI::Windows module APITypes module ::FFI WIN32_FALSE = 0 # standard Win32 error codes ERROR_SUCCESS = 0 end module ::FFI::Library ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ffi/windows/constants.rb
lib/puppet/ffi/windows/constants.rb
# frozen_string_literal: true require_relative '../../../puppet/ffi/windows' module Puppet::FFI::Windows module Constants extend FFI::Library FILE_ATTRIBUTE_READONLY = 0x00000001 FILE_ATTRIBUTE_DIRECTORY = 0x00000010 # https://msdn.microsoft.com/en-us/library/windows/desktop/aa379607(v=vs...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ffi/windows/structs.rb
lib/puppet/ffi/windows/structs.rb
# coding: utf-8 # frozen_string_literal: true require_relative '../../../puppet/ffi/windows' module Puppet::FFI::Windows module Structs extend FFI::Library extend Puppet::FFI::Windows::APITypes # https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/aa379560(v=vs.85) # typedef s...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ffi/windows/functions.rb
lib/puppet/ffi/windows/functions.rb
# frozen_string_literal: true require_relative '../../../puppet/ffi/windows' module Puppet::FFI::Windows module Functions extend FFI::Library include Puppet::FFI::Windows::Constants ffi_convention :stdcall # https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-sethandleinforma...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/gettext/stubs.rb
lib/puppet/gettext/stubs.rb
# frozen_string_literal: true # These stub the translation methods normally brought in # by FastGettext. Used when Gettext could not be properly # initialized. def _(msg) msg end def n_(*args, &block) plural = args[2] == 1 ? args[0] : args[1] block ? block.call : plural end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/gettext/module_translations.rb
lib/puppet/gettext/module_translations.rb
# frozen_string_literal: true require_relative '../../puppet/gettext/config' module Puppet::ModuleTranslations # @api private # Loads translation files for each of the specified modules, # if present. Requires the modules to have `forge_name` specified. # @param [[Module]] modules a list of modules 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/gettext/config.rb
lib/puppet/gettext/config.rb
# frozen_string_literal: true require_relative '../../puppet/util/platform' require_relative '../../puppet/file_system' module Puppet::GettextConfig LOCAL_PATH = File.absolute_path('../../../locales', File.dirname(__FILE__)) POSIX_PATH = File.absolute_path('../../../../../share/locale', File.dirname(__FILE__)) ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/module_directory.rb
lib/puppet/functions/module_directory.rb
# frozen_string_literal: true # Finds an existing module and returns the path to its root directory. # # The argument to this function should be a module name String # For example, the reference `mysql` will search for the # directory `<MODULES DIRECTORY>/mysql` and return the first # found on the modulepath. # # This...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/ceiling.rb
lib/puppet/functions/ceiling.rb
# frozen_string_literal: true # Returns the smallest `Integer` greater or equal to the argument. # Takes a single numeric value as an argument. # # This function is backwards compatible with the same function in stdlib # and accepts a `Numeric` value. A `String` that can be converted # to a floating point number can a...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/find_file.rb
lib/puppet/functions/find_file.rb
# frozen_string_literal: true # Finds an existing file from a module and returns its path. # # This function accepts an argument that is a String as a `<MODULE NAME>/<FILE>` # reference, which searches for `<FILE>` relative to a module's `files` # directory. (For example, the reference `mysql/mysqltuner.pl` will searc...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/hiera_array.rb
lib/puppet/functions/hiera_array.rb
# frozen_string_literal: true require 'hiera/puppet_function' # Finds all matches of a key throughout the hierarchy and returns them as a single flattened # array of unique values. If any of the matched values are arrays, they're flattened and # included in the results. This is called an # [array merge lookup](https:...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/binary_file.rb
lib/puppet/functions/binary_file.rb
# frozen_string_literal: true # 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 will load `<FILE>` from a module's `files` # directory. (For example, the reference `mysql/mysqltuner.pl` will l...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/reduce.rb
lib/puppet/functions/reduce.rb
# frozen_string_literal: true # 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 each iteration, and returns the result of the lambda's final iteration. This # lets you create a new value or d...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/slice.rb
lib/puppet/functions/slice.rb
# frozen_string_literal: true # Slices an array or hash into pieces of a given size. # # 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 argument is a hash, each key value pair is counted a...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/empty.rb
lib/puppet/functions/empty.rb
# frozen_string_literal: true # Returns `true` if the given argument is an empty collection of values. # # This function can answer if one of the following is empty: # * `Array`, `Hash` - having zero entries # * `String`, `Binary` - having zero length # # For backwards compatibility with the stdlib function with the s...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/include.rb
lib/puppet/functions/include.rb
# frozen_string_literal: true # 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 names. # # The `include` function can be used multiple times on the same class and will # only decl...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/yaml_data.rb
lib/puppet/functions/yaml_data.rb
# frozen_string_literal: true require 'yaml' # The `yaml_data` is a hiera 5 `data_hash` data provider function. # See [the configuration guide documentation](https://puppet.com/docs/puppet/latest/hiera_config_yaml_5.html#configuring-a-hierarchy-level-built-in-backends) for # how to use this function. # # @since 4.8.0...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/tree_each.rb
lib/puppet/functions/tree_each.rb
# frozen_string_literal: true # Runs a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) # recursively and repeatedly using values from a data structure, then returns the unchanged data structure, or if # a lambda is not given, returns an `Iterator` for the tree. # # This function takes one mandatory a...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/eyaml_lookup_key.rb
lib/puppet/functions/eyaml_lookup_key.rb
# frozen_string_literal: true # The `eyaml_lookup_key` is a hiera 5 `lookup_key` data provider function. # See [the configuration guide documentation](https://puppet.com/docs/puppet/latest/hiera_config_yaml_5.html#configuring-a-hierarchy-level-hiera-eyaml) for # how to use this function. # # @since 5.0.0 # Puppet::Fun...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/upcase.rb
lib/puppet/functions/upcase.rb
# frozen_string_literal: true # Converts a String, Array or Hash (recursively) into upper case. # # This function is compatible with the stdlib function with the same name. # # The function does the following: # * For a `String`, its upper case version is returned. This is done using Ruby system locale which handles s...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/type.rb
lib/puppet/functions/type.rb
# frozen_string_literal: true # 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, InferenceFidelity $fidelity = 'detailed') # returns Type # ``` # # @example Using `type` # # ``` puppet #...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/hiera_hash.rb
lib/puppet/functions/hiera_hash.rb
# frozen_string_literal: true require 'hiera/puppet_function' # Finds all matches of a key throughout the hierarchy and returns them in a merged hash. # # This function is deprecated in favor of the `lookup` function. While this function # continues to work, it does **not** support: # * `lookup_options` stored in the...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/annotate.rb
lib/puppet/functions/annotate.rb
# frozen_string_literal: true # Handles annotations on objects. The function can be used in four different ways. # # With two arguments, an `Annotation` type and an object, the function returns the annotation # for the object of the given type, or `undef` if no such annotation exists. # # @example Using `annotate` wit...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/index.rb
lib/puppet/functions/index.rb
# frozen_string_literal: true # Returns the index (or key in a hash) to a first-found value in an `Iterable` value. # # When called with a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) # the lambda is called repeatedly using each value in a data structure until the lambda returns a "truthy" value ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/new.rb
lib/puppet/functions/new.rb
# frozen_string_literal: true # 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 # just created instance as an argument. # # Calling this function is equivalent to directly # calling the d...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
true
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/hiera_include.rb
lib/puppet/functions/hiera_include.rb
# frozen_string_literal: true require 'hiera/puppet_function' # Assigns classes to a node using an # [array merge lookup](https://puppet.com/docs/hiera/latest/lookup_types.html#array-merge) # that retrieves the value for a user-specified key from Hiera's data. # # This function is deprecated in favor of the `lookup` ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/keys.rb
lib/puppet/functions/keys.rb
# frozen_string_literal: true # Returns the keys of a hash as an Array # # @example Using `keys` # # ```puppet # $hsh = {"apples" => 3, "oranges" => 4 } # $hsh.keys() # keys($hsh) # # both results in the array ["apples", "oranges"] # ``` # # * Note that a hash in the puppet language accepts any data value (including `...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/filter.rb
lib/puppet/functions/filter.rb
# frozen_string_literal: true # 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 the lambda evaluates to a truthy value (not `false` or `undef`). # # This function takes two mandatory argume...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/sort.rb
lib/puppet/functions/sort.rb
# frozen_string_literal: true # Sorts an Array numerically or lexicographically or the characters of a String lexicographically. # Please note: This function is based on Ruby String comparison and as such may not be entirely UTF8 compatible. # To ensure compatibility please use this function with Ruby 2.4.0 or greater...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/chomp.rb
lib/puppet/functions/chomp.rb
# frozen_string_literal: true # Returns a new string with the record separator character(s) removed. # The record separator is the line ending characters `\r` and `\n`. # # This function is compatible with the stdlib function with the same name. # # The function does the following: # * For a `String` the conversion re...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/length.rb
lib/puppet/functions/length.rb
# frozen_string_literal: true # Returns the length of an Array, Hash, String, or Binary value. # # The returned value is a positive integer indicating the number # of elements in the container; counting (possibly multibyte) characters for a `String`, # bytes in a `Binary`, number of elements in an `Array`, and number ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/unique.rb
lib/puppet/functions/unique.rb
# frozen_string_literal: true # Produces a unique set of values from an `Iterable` argument. # # * If the argument is a `String`, the unique set of characters are returned as a new `String`. # * If the argument is a `Hash`, the resulting hash associates a set of keys with a set of unique values. # * For all other type...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/getvar.rb
lib/puppet/functions/getvar.rb
# frozen_string_literal: true # Digs into a variable with dot notation to get a value from a structure. # # **To get the value from a variable** (that may or may not exist), call the function with # one or two arguments: # # * The **first** argument must be a string, and must start with a variable name without leading...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/max.rb
lib/puppet/functions/max.rb
# frozen_string_literal: true # Returns the highest value among a variable number of arguments. # Takes at least one argument. # # This function is (with one exception) compatible with the stdlib function # with the same name and performs deprecated type conversion before # comparison as follows: # # * If a value conv...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/any.rb
lib/puppet/functions/any.rb
# frozen_string_literal: true # Runs a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) # repeatedly using each value in a data structure until the lambda returns a "truthy" value which # makes the function return `true`, or if the end of the iteration is reached, false is returned. # # This function ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/chop.rb
lib/puppet/functions/chop.rb
# frozen_string_literal: true # Returns a new string with the last character removed. # If the string ends with `\r\n`, both characters are removed. Applying chop to an empty # string returns an empty string. If you wish to merely remove record # separators then you should use the `chomp` function. # # This function i...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/warning.rb
lib/puppet/functions/warning.rb
# frozen_string_literal: true # Logs a message on the server at level `warning`. Puppet::Functions.create_function(:warning, Puppet::Functions::InternalFunction) do # @param values The values to log. # @return [Undef] dispatch :warning do scope_param repeated_param 'Any', :values return_type 'Undef' ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/json_data.rb
lib/puppet/functions/json_data.rb
# frozen_string_literal: true # The `json_data` is a hiera 5 `data_hash` data provider function. # See [the configuration guide documentation](https://puppet.com/docs/puppet/latest/hiera_config_yaml_5.html#configuring-a-hierarchy-level-built-in-backends) for # how to use this function. # # @since 4.8.0 # Puppet::Funct...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/abs.rb
lib/puppet/functions/abs.rb
# frozen_string_literal: true # Returns the absolute value of a Numeric value, for example -34.56 becomes # 34.56. Takes a single `Integer` or `Float` value as an argument. # # *Deprecated behavior* # # For backwards compatibility reasons this function also works when given a # number in `String` format such that it f...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/crit.rb
lib/puppet/functions/crit.rb
# frozen_string_literal: true # Logs a message on the server at level `crit`. Puppet::Functions.create_function(:crit, Puppet::Functions::InternalFunction) do # @param values The values to log. # @return [Undef] dispatch :crit do scope_param repeated_param 'Any', :values return_type 'Undef' end ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/size.rb
lib/puppet/functions/size.rb
# frozen_string_literal: true # The same as length() - returns the size of an Array, Hash, String, or Binary value. # # @since 6.0.0 - also supporting Binary # Puppet::Functions.create_function(:size) do dispatch :generic_size do param 'Variant[Collection, String, Binary]', :arg end def generic_size(arg) ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/strip.rb
lib/puppet/functions/strip.rb
# frozen_string_literal: true # Strips leading and trailing spaces from a String # # This function is compatible with the stdlib function with the same name. # # The function does the following: # * For a `String` the conversion removes all leading and trailing ASCII white space characters such as space, tab, newline,...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/rstrip.rb
lib/puppet/functions/rstrip.rb
# frozen_string_literal: true # Strips trailing spaces from a String # # This function is compatible with the stdlib function with the same name. # # The function does the following: # * For a `String` the conversion removes all trailing ASCII white space characters such as space, tab, newline, and return. # It does...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/hiera.rb
lib/puppet/functions/hiera.rb
# frozen_string_literal: true require 'hiera/puppet_function' # Performs a standard priority lookup of the hierarchy and returns the most specific value # for a given key. The returned value can be any type of data. # # This function is deprecated in favor of the `lookup` function. While this function # continues to ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/step.rb
lib/puppet/functions/step.rb
# frozen_string_literal: true # 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. # # This function takes two to three arguments: # # 1. An 'Iterable' that the function will iterate over. # 2....
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/floor.rb
lib/puppet/functions/floor.rb
# frozen_string_literal: true # Returns the largest `Integer` less or equal to the argument. # Takes a single numeric value as an argument. # # This function is backwards compatible with the same function in stdlib # and accepts a `Numeric` value. A `String` that can be converted # to a floating point number can also ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/epp.rb
lib/puppet/functions/epp.rb
# frozen_string_literal: true # 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 a `<MODULE NAME>/<TEMPLATE FILE>` # reference, which loads `<TEMPLATE FILE>...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/defined.rb
lib/puppet/functions/defined.rb
# frozen_string_literal: true # 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 whether a variable has a value (including `undef`, as opposed to the variable never # being declared or assign...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/info.rb
lib/puppet/functions/info.rb
# frozen_string_literal: true # Logs a message on the server at level `info`. Puppet::Functions.create_function(:info, Puppet::Functions::InternalFunction) do # @param values The values to log. # @return [Undef] dispatch :info do scope_param repeated_param 'Any', :values return_type 'Undef' end ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/contain.rb
lib/puppet/functions/contain.rb
# frozen_string_literal: true # Makes one or more classes be contained inside the current class. # If any of these classes are undeclared, they will be declared as if # there were declared with the `include` function. # Accepts a class name, an array of class names, or a comma-separated # list of class names. # # A co...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/debug.rb
lib/puppet/functions/debug.rb
# frozen_string_literal: true # Logs a message on the server at level `debug`. Puppet::Functions.create_function(:debug, Puppet::Functions::InternalFunction) do # @param values The values to log. # @return [Undef] dispatch :debug do scope_param repeated_param 'Any', :values return_type 'Undef' end ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/partition.rb
lib/puppet/functions/partition.rb
# frozen_string_literal: true # Returns two arrays, the first containing the elements of enum for which the block evaluates to true, # the second containing the rest. Puppet::Functions.create_function(:partition) do # @param collection A collection of things to partition. # @example Partition array of empty string...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/strftime.rb
lib/puppet/functions/strftime.rb
# frozen_string_literal: true # 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 will be passed through to the output string. # # A third optional timezone argument can be provided. The first a...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/match.rb
lib/puppet/functions/match.rb
# frozen_string_literal: true # 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 is either a # regular expression, regular expression represented as a string, or Regex ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/values.rb
lib/puppet/functions/values.rb
# frozen_string_literal: true # Returns the values of a hash as an Array # # @example Using `values` # # ```puppet # $hsh = {"apples" => 3, "oranges" => 4 } # $hsh.values() # values($hsh) # # both results in the array [3, 4] # ``` # # * Note that a hash in the puppet language accepts any data value (including `undef`)...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/unwrap.rb
lib/puppet/functions/unwrap.rb
# frozen_string_literal: true # Unwraps a Sensitive value and returns the wrapped object. # Returns the Value itself, if it is not Sensitive. # # @example Usage of unwrap # # ```puppet # $plaintext = 'hunter2' # $pw = Sensitive.new($plaintext) # notice("Wrapped object is $pw") #=> Prints "Wrapped object is Sensitive [...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/lest.rb
lib/puppet/functions/lest.rb
# frozen_string_literal: true # Calls a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) # without arguments if the value given to `lest` is `undef`. # Returns the result of calling the lambda if the argument is `undef`, otherwise the # given argument. # # The `lest` function is useful in a chain of `...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/join.rb
lib/puppet/functions/join.rb
# frozen_string_literal: true # Joins the values of an Array into a string with elements separated by a delimiter. # # Supports up to two arguments # * **values** - first argument is required and must be an an `Array` # * **delimiter** - second arguments is the delimiter between elements, must be a `String` if given, ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/compare.rb
lib/puppet/functions/compare.rb
# frozen_string_literal: true # Compares two values and returns -1, 0 or 1 if first value is smaller, equal or larger than the second value. # The compare function accepts arguments of the data types `String`, `Numeric`, `Timespan`, `Timestamp`, and `Semver`, # such that: # # * two of the same data type can be compare...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/emerg.rb
lib/puppet/functions/emerg.rb
# frozen_string_literal: true # Logs a message on the server at level `emerg`. Puppet::Functions.create_function(:emerg, Puppet::Functions::InternalFunction) do # @param values The values to log. # @return [Undef] dispatch :emerg do scope_param repeated_param 'Any', :values return_type 'Undef' end ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/notice.rb
lib/puppet/functions/notice.rb
# frozen_string_literal: true # Logs a message on the server at level `notice`. Puppet::Functions.create_function(:notice, Puppet::Functions::InternalFunction) do # @param values The values to log. # @return [Undef] dispatch :notice do scope_param repeated_param 'Any', :values return_type 'Undef' e...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/require.rb
lib/puppet/functions/require.rb
# frozen_string_literal: true # Requires the specified classes. # Evaluate one or more classes, adding the required class as a dependency. # # The relationship metaparameters work well for specifying relationships # between individual resources, but they can be clumsy for specifying # relationships between classes. T...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/camelcase.rb
lib/puppet/functions/camelcase.rb
# frozen_string_literal: true # Creates a Camel Case version of a String # # This function is compatible with the stdlib function with the same name. # # The function does the following: # * For a `String` the conversion replaces all combinations of `*_<char>*` with an upcased version of the # character following th...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/get.rb
lib/puppet/functions/get.rb
# frozen_string_literal: true # Digs into a value with dot notation to get a value from within a structure. # # **To dig into a given value**, call the function with (at least) two arguments: # # * The **first** argument must be an Array, or Hash. Value can also be `undef` # (which also makes the result `undef` unle...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/assert_type.rb
lib/puppet/functions/assert_type.rb
# frozen_string_literal: true # 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 optional two-parameter # [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html). # # The function takes two ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/next.rb
lib/puppet/functions/next.rb
# frozen_string_literal: true # Makes iteration continue with the next value, optionally with a given value for this iteration. # If a value is not given it defaults to `undef` # # @example Using the `next()` function # # ```puppet # $data = ['a','b','c'] # $data.each |Integer $index, String $value| { # if $index ==...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/convert_to.rb
lib/puppet/functions/convert_to.rb
# frozen_string_literal: true # The `convert_to(value, type)` is a convenience function that does the same as `new(type, value)`. # The difference in the argument ordering allows it to be used in chained style for # improved readability "left to right". # # When the function is given a lambda, it is called with the co...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/split.rb
lib/puppet/functions/split.rb
# frozen_string_literal: true # Splits a string into an array using a given pattern. # The pattern can be a string, regexp or regexp type. # # @example Splitting a String value # # ```puppet # $string = 'v1.v2:v3.v4' # $array_var1 = split($string, /:/) # $array_var2 = split($string, '[.]') # $array_var3 = split($s...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/scanf.rb
lib/puppet/functions/scanf.rb
# frozen_string_literal: true # 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 details about the supported formats (which # are similar but not identical to the formats used in Puppet's `sprintf` function.)...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false