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/functions/map.rb | lib/puppet/functions/map.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 containing the results.
#
# This function takes two mandatory arguments, in this order:
#
# 1. An array, hash, or other iterable object that the 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/import.rb | lib/puppet/functions/import.rb | # frozen_string_literal: true
# The import function raises an error when called to inform the user that import is no longer supported.
#
Puppet::Functions.create_function(:import) do
def import(*args)
raise Puppet::Pops::SemanticError, Puppet::Pops::Issues::DISCONTINUED_IMPORT
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/functions/return.rb | lib/puppet/functions/return.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`
#
# @since 4.7.0
#
Puppet::Functions.create_function(:return, Puppet::Functions::InternalFunction) do
dispatch :return_impl do
optional_... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/min.rb | lib/puppet/functions/min.rb | # frozen_string_literal: true
# Returns the lowest 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 conve... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/err.rb | lib/puppet/functions/err.rb | # frozen_string_literal: true
# Logs a message on the server at level `err`.
Puppet::Functions.create_function(:err, Puppet::Functions::InternalFunction) do
# @param values The values to log.
# @return [Undef]
dispatch :err do
scope_param
repeated_param 'Any', :values
return_type 'Undef'
end
def... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/downcase.rb | lib/puppet/functions/downcase.rb | # frozen_string_literal: true
# Converts a String, Array or Hash (recursively) into lower case.
#
# This function is compatible with the stdlib function with the same name.
#
# The function does the following:
# * For a `String`, its lower 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/each.rb | lib/puppet/functions/each.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, then returns the values unchanged.
#
# This function takes two mandatory arguments, in this order:
#
# 1. An array, hash, or other iterable object that the functio... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/lookup.rb | lib/puppet/functions/lookup.rb | # frozen_string_literal: true
# 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
# available), but you can configure it to merge multiple values into one, fail
# gracefully, and more.
#
# When looking up a key, P... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/lstrip.rb | lib/puppet/functions/lstrip.rb | # frozen_string_literal: true
# Strips leading 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 ASCII white space characters such as space, tab, newline, and return.
# It does n... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/capitalize.rb | lib/puppet/functions/capitalize.rb | # frozen_string_literal: true
# Capitalizes the first character of a String, or the first character of every String in an Iterable value (such as an Array).
#
# This function is compatible with the stdlib function with the same name.
#
# The function does the following:
# * For a `String`, a string is returned in whic... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/versioncmp.rb | lib/puppet/functions/versioncmp.rb | # frozen_string_literal: true
require_relative '../../puppet/util/package'
# Compares two version numbers.
#
# Prototype:
#
# $result = versioncmp(a, b)
#
# Where a and b are arbitrary version strings.
#
# Optional parameter ignore_trailing_zeroes is used to ignore unnecessary
# trailing version numbers like .0 o... | 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_template.rb | lib/puppet/functions/find_template.rb | # frozen_string_literal: true
# Finds an existing template from a module and returns its path.
#
# This function accepts an argument that is a String as a `<MODULE NAME>/<TEMPLATE>`
# reference, which searches for `<TEMPLATE>` relative to a module's `templates`
# directory on the primary server. (For example, the refe... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/inline_epp.rb | lib/puppet/functions/inline_epp.rb | # frozen_string_literal: true
# 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 should be a string containing an EPP
# template. In most cases, the last argument is... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/regsubst.rb | lib/puppet/functions/regsubst.rb | # frozen_string_literal: true
# Performs regexp replacement on a string or array of strings.
Puppet::Functions.create_function(:regsubst) do
# @param target [String]
# The string or array of strings to operate on. If an array, the replacement will be
# performed on each of the elements in the array, 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/group_by.rb | lib/puppet/functions/group_by.rb | # frozen_string_literal: true
# Groups the collection by result of the block. Returns a hash where the keys are the evaluated result from the block
# and the values are arrays of elements in the collection that correspond to the key.
Puppet::Functions.create_function(:group_by) do
# @param collection A collection 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/break.rb | lib/puppet/functions/break.rb | # frozen_string_literal: true
# Breaks an 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 until either terminating the innermost iteration or
# raising an error if the end of the c... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/dig.rb | lib/puppet/functions/dig.rb | # frozen_string_literal: true
# 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 sequence of keys / indexes to access a value from which
# the next key/index is accessed recursively.
#
# 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/hocon_data.rb | lib/puppet/functions/hocon_data.rb | # frozen_string_literal: true
# The `hocon_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.
#
# Note that this function is ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/alert.rb | lib/puppet/functions/alert.rb | # frozen_string_literal: true
# Logs a message on the server at level `alert`.
Puppet::Functions.create_function(:alert, Puppet::Functions::InternalFunction) do
# @param values The values to log.
# @return [Undef]
dispatch :alert 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/then.rb | lib/puppet/functions/then.rb | # frozen_string_literal: true
# Calls a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html)
# with the given argument unless the argument is `undef`.
# Returns `undef` if the argument is `undef`, and otherwise the result of giving the
# argument to the lambda.
#
# This is useful to process a sequence 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/reverse_each.rb | lib/puppet/functions/reverse_each.rb | # frozen_string_literal: true
# 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
# element.
#
# This function takes one to two arguments:
#
# 1. An `Iterable` that the function will iterate over.
# 2. An ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/call.rb | lib/puppet/functions/call.rb | # frozen_string_literal: true
# Calls an arbitrary Puppet function by name.
#
# This function takes one mandatory argument and one or more optional arguments:
#
# 1. A string corresponding to a function name.
# 2. Any number of arguments to be passed to the called function.
# 3. An optional lambda, if the function bei... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/flatten.rb | lib/puppet/functions/flatten.rb | # frozen_string_literal: true
# Returns a flat Array produced from its possibly deeply nested given arguments.
#
# One or more arguments of any data type can be given to this function.
# The result is always a flat array representation where any nested arrays are recursively flattened.
#
# @example Typical use of `fla... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/functions/with.rb | lib/puppet/functions/with.rb | # frozen_string_literal: true
# Calls a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html)
# with the given arguments and returns the result.
#
# Since a lambda's scope is
# [local](https://puppet.com/docs/puppet/latest/lang_lambdas.html#lambda-scope)
# to the lambda, you can use the `with` function 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/round.rb | lib/puppet/functions/round.rb | # frozen_string_literal: true
# Returns an `Integer` value rounded to the nearest value.
# Takes a single `Numeric` value as an argument.
#
# @example 'rounding a value'
#
# ```puppet
# notice(round(2.9)) # would notice 3
# notice(round(2.1)) # would notice 2
# notice(round(-2.9)) # would notice -3
# ```
#
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/all.rb | lib/puppet/functions/all.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 non "truthy" value which
# makes the function return `false`, or if the end of the iteration is reached, `true` is returned.
#
# This fun... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/authconfig.rb | lib/puppet/network/authconfig.rb | # frozen_string_literal: true
module Puppet
class Network::AuthConfig
def self.authprovider_class=(_)
# legacy auth is not supported, ignore
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/network/format.rb | lib/puppet/network/format.rb | # frozen_string_literal: true
require_relative '../../puppet/confiner'
# A simple class for modeling encoding formats for moving
# instances around the network.
class Puppet::Network::Format
include Puppet::Confiner
attr_reader :name, :mime
attr_accessor :intern_method, :render_method, :intern_multiple_method,... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/format_support.rb | lib/puppet/network/format_support.rb | # frozen_string_literal: true
require_relative '../../puppet/network/format_handler'
# Provides network serialization support when included
# @api public
module Puppet::Network::FormatSupport
def self.included(klass)
klass.extend(ClassMethods)
end
module ClassMethods
def convert_from(format, data)
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http.rb | lib/puppet/network/http.rb | # frozen_string_literal: true
# This module is used to handle puppet REST requests in puppetserver.
module Puppet::Network::HTTP
HEADER_ENABLE_PROFILING = "X-Puppet-Profiling"
HEADER_PUPPET_VERSION = "X-Puppet-Version"
SERVER_URL_PREFIX = "/puppet"
SERVER_URL_VERSIONS = "v3"
MASTER_URL_PREFIX = SERVER_URL_... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/uri.rb | lib/puppet/network/uri.rb | # frozen_string_literal: true
# This module holds funtions for network URI's
module Puppet::Network::Uri
# Mask credentials in given URI or address as string. Resulting string will
# contain '***' in place of password. It will only be replaced if actual
# password is given.
#
# @param uri [URI|String] an uri... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http_pool.rb | lib/puppet/network/http_pool.rb | # frozen_string_literal: true
require_relative '../../puppet/network/http/connection'
module Puppet::Network; end
# This module is deprecated.
#
# @api public
# @deprecated Use {Puppet::HTTP::Client} instead.
#
module Puppet::Network::HttpPool
@http_client_class = Puppet::Network::HTTP::Connection
def self.http... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/client_request.rb | lib/puppet/network/client_request.rb | # frozen_string_literal: true
module Puppet::Network # :nodoc:
# A struct-like class for passing around a client request. It's mostly
# just used for validation and authorization.
class ClientRequest
attr_accessor :name, :ip, :authenticated, :handler, :method
def authenticated?
authenticated
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/authorization.rb | lib/puppet/network/authorization.rb | # frozen_string_literal: true
module Puppet::Network
module Authorization
class << self
# This method is deprecated and will be removed in a future release.
def authconfigloader_class=(klass)
@authconfigloader_class = klass
end
# Verify something external to puppet is authorizing... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/format_handler.rb | lib/puppet/network/format_handler.rb | # frozen_string_literal: true
require 'yaml'
require_relative '../../puppet/network'
require_relative '../../puppet/network/format'
module Puppet::Network::FormatHandler
class FormatError < Puppet::Error; end
ALL_MEDIA_TYPES = '*/*'
@formats = {}
def self.create(*args, &block)
instance = Puppet::Networ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/formats.rb | lib/puppet/network/formats.rb | # frozen_string_literal: true
require_relative '../../puppet/network/format_handler'
require_relative '../../puppet/util/json'
Puppet::Network::FormatHandler.create_serialized_formats(:msgpack, :weight => 20, :mime => "application/x-msgpack", :required_methods => [:render_method, :intern_method], :intern_method => :f... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/issues.rb | lib/puppet/network/http/issues.rb | # frozen_string_literal: true
module Puppet::Network::HTTP::Issues
NO_INDIRECTION_REMOTE_REQUESTS = :NO_INDIRECTION_REMOTE_REQUESTS
HANDLER_NOT_FOUND = :HANDLER_NOT_FOUND
RESOURCE_NOT_FOUND = :RESOURCE_NOT_FOUND
ENVIRONMENT_NOT_FOUND = :ENVIRONMENT_NOT_FOUND
RUNTIME_ERROR = :RUNTIME_ERROR
MISSING_HEADER_FI... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/response.rb | lib/puppet/network/http/response.rb | # frozen_string_literal: true
class Puppet::Network::HTTP::Response
def initialize(handler, response)
@handler = handler
@response = response
end
def respond_with(code, type, body)
format = Puppet::Network::FormatHandler.format_for(type)
mime = format.mime
charset = format.charset
if ch... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/route.rb | lib/puppet/network/http/route.rb | # frozen_string_literal: true
class Puppet::Network::HTTP::Route
MethodNotAllowedHandler = lambda do |req, _res|
raise Puppet::Network::HTTP::Error::HTTPMethodNotAllowedError.new("method #{req.method} not allowed for route #{req.path}", Puppet::Network::HTTP::Issues::UNSUPPORTED_METHOD)
end
NO_HANDLERS = [M... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/api.rb | lib/puppet/network/http/api.rb | # frozen_string_literal: true
class Puppet::Network::HTTP::API
require_relative '../../../puppet/version'
def self.not_found
Puppet::Network::HTTP::Route
.path(/.*/)
.any(lambda do |req, _res|
raise Puppet::Network::HTTP::Error::HTTPNotFoundError.new("No route for #{req.method} #{req.path}... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/handler.rb | lib/puppet/network/http/handler.rb | # frozen_string_literal: true
module Puppet::Network::HTTP
end
require_relative '../../../puppet/network/http'
require_relative '../../../puppet/util/profiler'
require_relative '../../../puppet/util/profiler/aggregate'
require 'resolv'
module Puppet::Network::HTTP::Handler
include Puppet::Network::HTTP::Issues
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/connection.rb | lib/puppet/network/http/connection.rb | # frozen_string_literal: true
require_relative '../../../puppet/http'
# This will be raised if too many redirects happen for a given HTTP request
class Puppet::Network::HTTP::RedirectionLimitExceededException < Puppet::Error; end
# This class provides simple methods for issuing various types of HTTP
# requests. It'... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/memory_response.rb | lib/puppet/network/http/memory_response.rb | # frozen_string_literal: true
class Puppet::Network::HTTP::MemoryResponse
attr_reader :code, :type, :body
def initialize
@body = ''.dup
end
def respond_with(code, type, body)
@code = code
@type = type
@body += body
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/network/http/request.rb | lib/puppet/network/http/request.rb | # frozen_string_literal: true
# This class is effectively public API, because a Request object is passed as a
# parameter to the current Handler subclass. Puppetserver implements its own
# Handler
# https://github.com/puppetlabs/puppetserver/blob/8.3.0/src/ruby/puppetserver-lib/puppet/server/network/http/handler.rb#L9... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/error.rb | lib/puppet/network/http/error.rb | # frozen_string_literal: true
require_relative '../../../puppet/util/json'
module Puppet::Network::HTTP::Error
Issues = Puppet::Network::HTTP::Issues
class HTTPError < Exception # rubocop:disable Lint/InheritException
attr_reader :status, :issue_kind
def initialize(message, status, issue_kind)
sup... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/api/master.rb | lib/puppet/network/http/api/master.rb | # frozen_string_literal: true
require_relative '../../../../puppet/network/http/api/server'
Puppet::Network::HTTP::API::Master = Puppet::Network::HTTP::API::Server
| ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/api/indirection_type.rb | lib/puppet/network/http/api/indirection_type.rb | # frozen_string_literal: true
class Puppet::Network::HTTP::API::IndirectionType
INDIRECTION_TYPE_MAP = {
"certificate" => :ca,
"certificate_request" => :ca,
"certificate_revocation_list" => :ca,
"certificate_status" => :ca
}
def self.master_url_prefix
"#{Puppet::Network::HTTP::MASTER_URL_PRE... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/api/server.rb | lib/puppet/network/http/api/server.rb | # frozen_string_literal: true
module Puppet
module Network
module HTTP
class API
module Server
end
end
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/network/http/api/indirected_routes.rb | lib/puppet/network/http/api/indirected_routes.rb | # frozen_string_literal: true
require_relative '../../../../puppet/network/http/api/indirection_type'
class Puppet::Network::HTTP::API::IndirectedRoutes
# How we map http methods and the indirection name in the URI
# to an indirection method.
METHOD_MAP = {
"GET" => {
:plural => :search,
:singul... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/api/server/v3.rb | lib/puppet/network/http/api/server/v3.rb | # frozen_string_literal: true
require_relative 'v3/environments'
require_relative '../../../../../puppet/network/http/api/indirected_routes'
module Puppet
module Network
module HTTP
class API
module Server
class V3
def self.wrap(&block)
lambda do |request, respo... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/api/server/v3/environments.rb | lib/puppet/network/http/api/server/v3/environments.rb | # frozen_string_literal: true
require_relative '../../../../../../puppet/util/json'
module Puppet
module Network
module HTTP
class API
module Server
class V3
class Environments
def initialize(env_loader)
@env_loader = env_loader
end... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/api/master/v3.rb | lib/puppet/network/http/api/master/v3.rb | # frozen_string_literal: true
require_relative '../../../../../puppet/network/http/api/master'
require_relative '../../../../../puppet/network/http/api/server/v3'
| ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/network/http/api/master/v3/environments.rb | lib/puppet/network/http/api/master/v3/environments.rb | # frozen_string_literal: true
require_relative '../../../../../../puppet/network/http/api/master'
require_relative '../../../../../../puppet/network/http/api/server/v3/environments'
| ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/content.rb | lib/puppet/file_serving/content.rb | # frozen_string_literal: true
require_relative '../../puppet/indirector'
require_relative '../../puppet/file_serving'
require_relative '../../puppet/file_serving/base'
# A class that handles retrieving file contents.
# It only reads the file when its content is specifically
# asked for.
class Puppet::FileServing::Con... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/http_metadata.rb | lib/puppet/file_serving/http_metadata.rb | # frozen_string_literal: true
require_relative '../../puppet/file_serving/metadata'
# Simplified metadata representation, suitable for the information
# that is available from HTTP headers.
class Puppet::FileServing::HttpMetadata < Puppet::FileServing::Metadata
def initialize(http_response, path = '/dev/null')
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/terminus_helper.rb | lib/puppet/file_serving/terminus_helper.rb | # frozen_string_literal: true
require_relative '../../puppet/file_serving'
require_relative '../../puppet/file_serving/fileset'
# Define some common methods for FileServing termini.
module Puppet::FileServing::TerminusHelper
# Create model instance for a file in a file server.
def path2instance(request, path, op... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/terminus_selector.rb | lib/puppet/file_serving/terminus_selector.rb | # frozen_string_literal: true
require_relative '../../puppet/file_serving'
# This module is used to pick the appropriate terminus
# in file-serving indirections. This is necessary because
# the terminus varies based on the URI asked for.
module Puppet::FileServing::TerminusSelector
def select(request)
# We rel... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/base.rb | lib/puppet/file_serving/base.rb | # frozen_string_literal: true
require_relative '../../puppet/file_serving'
require_relative '../../puppet/util'
# The base class for Content and Metadata; provides common
# functionality like the behaviour around links.
class Puppet::FileServing::Base
# This is for external consumers to store the source that was us... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/configuration.rb | lib/puppet/file_serving/configuration.rb | # frozen_string_literal: true
require_relative '../../puppet'
require_relative '../../puppet/file_serving'
require_relative '../../puppet/file_serving/mount'
require_relative '../../puppet/file_serving/mount/file'
require_relative '../../puppet/file_serving/mount/modules'
require_relative '../../puppet/file_serving/mo... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/fileset.rb | lib/puppet/file_serving/fileset.rb | # frozen_string_literal: true
require 'find'
require_relative '../../puppet/file_serving'
require_relative '../../puppet/file_serving/metadata'
# Operate recursively on a path, returning a set of file paths.
class Puppet::FileServing::Fileset
attr_reader :path, :ignore, :links
attr_accessor :recurse, :recurselimi... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/mount.rb | lib/puppet/file_serving/mount.rb | # frozen_string_literal: true
require_relative '../../puppet/util/logging'
require_relative '../../puppet/file_serving'
require_relative '../../puppet/file_serving/metadata'
require_relative '../../puppet/file_serving/content'
# Broker access to the filesystem, converting local URIs into metadata
# or content objects... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/metadata.rb | lib/puppet/file_serving/metadata.rb | # frozen_string_literal: true
require_relative '../../puppet'
require_relative '../../puppet/indirector'
require_relative '../../puppet/file_serving'
require_relative '../../puppet/file_serving/base'
require_relative '../../puppet/util/checksums'
require 'uri'
# A class that handles retrieving file metadata.
class Pu... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/mount/plugins.rb | lib/puppet/file_serving/mount/plugins.rb | # frozen_string_literal: true
require_relative '../../../puppet/file_serving/mount'
# Find files in the modules' plugins directories.
# This is a very strange mount because it merges
# many directories into one.
class Puppet::FileServing::Mount::Plugins < Puppet::FileServing::Mount
# Return an instance of the appro... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/mount/file.rb | lib/puppet/file_serving/mount/file.rb | # frozen_string_literal: true
require_relative '../../../puppet/file_serving/mount'
class Puppet::FileServing::Mount::File < Puppet::FileServing::Mount
def self.localmap
@localmap ||= {
"h" => Puppet.runtime[:facter].value('networking.hostname'),
"H" => [
Puppet.runtime[:facter].value('netwo... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/mount/scripts.rb | lib/puppet/file_serving/mount/scripts.rb | # frozen_string_literal: true
require 'puppet/file_serving/mount'
class Puppet::FileServing::Mount::Scripts < Puppet::FileServing::Mount
# Return an instance of the appropriate class.
def find(path, request)
raise _("No module specified") if path.to_s.empty?
module_name, relative_path = path.split("/", 2... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/mount/pluginfacts.rb | lib/puppet/file_serving/mount/pluginfacts.rb | # frozen_string_literal: true
require_relative '../../../puppet/file_serving/mount'
# Find files in the modules' pluginfacts directories.
# This is a very strange mount because it merges
# many directories into one.
class Puppet::FileServing::Mount::PluginFacts < Puppet::FileServing::Mount
# Return an instance of t... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/mount/locales.rb | lib/puppet/file_serving/mount/locales.rb | # frozen_string_literal: true
require_relative '../../../puppet/file_serving/mount'
# Find files in the modules' locales directories.
# This is a very strange mount because it merges
# many directories into one.
class Puppet::FileServing::Mount::Locales < Puppet::FileServing::Mount
# Return an instance of the appro... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/mount/tasks.rb | lib/puppet/file_serving/mount/tasks.rb | # frozen_string_literal: true
require_relative '../../../puppet/file_serving/mount'
class Puppet::FileServing::Mount::Tasks < Puppet::FileServing::Mount
def find(path, request)
raise _("No task specified") if path.to_s.empty?
module_name, task_path = path.split("/", 2)
mod = request.environment.module(... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/mount/modules.rb | lib/puppet/file_serving/mount/modules.rb | # frozen_string_literal: true
require_relative '../../../puppet/file_serving/mount'
# This is the modules-specific mount: it knows how to search through
# modules for files. Yay.
class Puppet::FileServing::Mount::Modules < Puppet::FileServing::Mount
# Return an instance of the appropriate class.
def find(path, r... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/configuration/parser.rb | lib/puppet/file_serving/configuration/parser.rb | # frozen_string_literal: true
require_relative '../../../puppet/file_serving/configuration'
require_relative '../../../puppet/util/watched_file'
class Puppet::FileServing::Configuration::Parser
Mount = Puppet::FileServing::Mount
MODULES = 'modules'
# Parse our configuration file.
def parse
raise(_("File ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module/task.rb | lib/puppet/module/task.rb | # frozen_string_literal: true
require_relative '../../puppet/util/logging'
class Puppet::Module
class Task
class Error < Puppet::Error
attr_accessor :kind, :details
def initialize(message, kind, details = nil)
super(message)
@details = details || {}
@kind = kind
end
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module/plan.rb | lib/puppet/module/plan.rb | # frozen_string_literal: true
require_relative '../../puppet/util/logging'
class Puppet::Module
class Plan
class Error < Puppet::Error
attr_accessor :kind, :details
def initialize(message, kind, details = nil)
super(message)
@details = details || {}
@kind = kind
end
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/errors.rb | lib/puppet/module_tool/errors.rb | # frozen_string_literal: true
require_relative '../../puppet/module_tool'
module Puppet::ModuleTool
module Errors
require_relative 'errors/base'
require_relative 'errors/installer'
require_relative 'errors/uninstaller'
require_relative 'errors/upgrader'
require_relative 'errors/shared'
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/module_tool/tar.rb | lib/puppet/module_tool/tar.rb | # frozen_string_literal: true
require_relative '../../puppet/module_tool'
require_relative '../../puppet/util'
module Puppet::ModuleTool::Tar
require_relative 'tar/gnu'
require_relative 'tar/mini'
def self.instance
if Puppet.features.minitar? && Puppet.features.zlib?
Mini.new
elsif 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/module_tool/applications.rb | lib/puppet/module_tool/applications.rb | # frozen_string_literal: true
require_relative '../../puppet/module_tool'
module Puppet::ModuleTool
module Applications
require_relative 'applications/application'
require_relative 'applications/checksummer'
require_relative 'applications/installer'
require_relative 'applications/unpacker'
requi... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/shared_behaviors.rb | lib/puppet/module_tool/shared_behaviors.rb | # frozen_string_literal: true
module Puppet::ModuleTool::Shared
include Puppet::ModuleTool::Errors
def get_local_constraints
@local = Hash.new { |h, k| h[k] = {} }
@conditions = Hash.new { |h, k| h[k] = [] }
@installed = Hash.new { |h, k| h[k] = [] }
@environment.modules_by_path.values.flat... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/contents_description.rb | lib/puppet/module_tool/contents_description.rb | # frozen_string_literal: true
require_relative '../../puppet/module_tool'
module Puppet::ModuleTool
# = ContentsDescription
#
# This class populates +Metadata+'s Puppet type information.
class ContentsDescription
# Instantiate object for string +module_path+.
def initialize(module_path)
@module_... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/installed_modules.rb | lib/puppet/module_tool/installed_modules.rb | # frozen_string_literal: true
require 'pathname'
require_relative '../../puppet/forge'
require_relative '../../puppet/module_tool'
module Puppet::ModuleTool
class InstalledModules < SemanticPuppet::Dependency::Source
attr_reader :modules, :by_name
def priority
10
end
def initialize(env)
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/local_tarball.rb | lib/puppet/module_tool/local_tarball.rb | # frozen_string_literal: true
require 'pathname'
require 'tmpdir'
require_relative '../../puppet/forge'
require_relative '../../puppet/module_tool'
module Puppet::ModuleTool
class LocalTarball < SemanticPuppet::Dependency::Source
attr_accessor :release
def initialize(filename)
unpack(filename, tmpdi... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/install_directory.rb | lib/puppet/module_tool/install_directory.rb | # frozen_string_literal: true
require_relative '../../puppet/module_tool'
require_relative '../../puppet/module_tool/errors'
module Puppet
module ModuleTool
# Control the install location for modules.
class InstallDirectory
include Puppet::ModuleTool::Errors
attr_reader :target
def initi... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/dependency.rb | lib/puppet/module_tool/dependency.rb | # frozen_string_literal: true
require_relative '../../puppet/module_tool'
require_relative '../../puppet/network/format_support'
module Puppet::ModuleTool
class Dependency
include Puppet::Network::FormatSupport
attr_reader :full_module_name, :username, :name, :version_requirement, :repository
# Instan... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/metadata.rb | lib/puppet/module_tool/metadata.rb | # frozen_string_literal: true
require_relative '../../puppet/module_tool'
require_relative '../../puppet/network/format_support'
require 'uri'
require_relative '../../puppet/util/json'
require 'set'
module Puppet::ModuleTool
# This class provides a data structure representing a module's metadata.
# @api private
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/checksums.rb | lib/puppet/module_tool/checksums.rb | # frozen_string_literal: true
require 'digest/md5'
require_relative '../../puppet/network/format_support'
module Puppet::ModuleTool
# = Checksums
#
# This class provides methods for generating checksums for data and adding
# them to +Metadata+.
class Checksums
include Puppet::Network::FormatSupport
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/errors/upgrader.rb | lib/puppet/module_tool/errors/upgrader.rb | # frozen_string_literal: true
module Puppet::ModuleTool::Errors
class UpgradeError < ModuleToolError
def initialize(msg)
@action = :upgrade
super
end
end
class VersionAlreadyInstalledError < UpgradeError
attr_reader :newer_versions
def initialize(options)
@module_name = ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/errors/base.rb | lib/puppet/module_tool/errors/base.rb | # frozen_string_literal: true
module Puppet::ModuleTool::Errors
class ModuleToolError < Puppet::Error
def v(version)
(version || '???').to_s.sub(/^(?=\d)/, 'v')
end
def vstring
if @action == :upgrade
"#{v(@installed_version)} -> #{v(@requested_version)}"
else
v(@install... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/errors/installer.rb | lib/puppet/module_tool/errors/installer.rb | # frozen_string_literal: true
module Puppet::ModuleTool::Errors
class InstallError < ModuleToolError; end
class AlreadyInstalledError < InstallError
def initialize(options)
@module_name = options[:module_name]
@installed_version = v(options[:installed_version])
@requested_version = v(o... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/errors/shared.rb | lib/puppet/module_tool/errors/shared.rb | # frozen_string_literal: true
module Puppet::ModuleTool::Errors
class NoVersionsSatisfyError < ModuleToolError
def initialize(options)
@requested_name = options[:requested_name]
@requested_version = options[:requested_version]
@installed_version = options[:installed_version]
@condition... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/errors/uninstaller.rb | lib/puppet/module_tool/errors/uninstaller.rb | # frozen_string_literal: true
module Puppet::ModuleTool::Errors
class UninstallError < ModuleToolError; end
class NoVersionMatchesError < UninstallError
def initialize(options)
@module_name = options[:module_name]
@modules = options[:installed_modules]
@version = options[:version_ran... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/tar/gnu.rb | lib/puppet/module_tool/tar/gnu.rb | # frozen_string_literal: true
require 'shellwords'
class Puppet::ModuleTool::Tar::Gnu
def unpack(sourcefile, destdir, owner)
safe_sourcefile = Shellwords.shellescape(File.expand_path(sourcefile))
destdir = File.expand_path(destdir)
safe_destdir = Shellwords.shellescape(destdir)
Puppet::Util::Execut... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/tar/mini.rb | lib/puppet/module_tool/tar/mini.rb | # frozen_string_literal: true
class Puppet::ModuleTool::Tar::Mini
def unpack(sourcefile, destdir, _)
Zlib::GzipReader.open(sourcefile) do |reader|
# puppet doesn't have a hard dependency on minitar, so we
# can't be certain which version is installed. If it's 0.9
# or above then we can prevent ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/applications/application.rb | lib/puppet/module_tool/applications/application.rb | # frozen_string_literal: true
require 'net/http'
require_relative '../../../puppet/util/json'
require_relative '../../../puppet/util/colors'
module Puppet::ModuleTool
module Applications
class Application
include Puppet::Util::Colors
def self.run(*args)
new(*args).run
end
attr_... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/applications/checksummer.rb | lib/puppet/module_tool/applications/checksummer.rb | # frozen_string_literal: true
require_relative '../../../puppet/util/json'
require_relative '../../../puppet/module_tool/checksums'
module Puppet::ModuleTool
module Applications
class Checksummer < Application
def initialize(path, options = {})
@path = Pathname.new(path)
super(options)
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/applications/upgrader.rb | lib/puppet/module_tool/applications/upgrader.rb | # frozen_string_literal: true
require 'pathname'
require_relative '../../../puppet/forge'
require_relative '../../../puppet/module_tool'
require_relative '../../../puppet/module_tool/shared_behaviors'
require_relative '../../../puppet/module_tool/install_directory'
require_relative '../../../puppet/module_tool/instal... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/applications/installer.rb | lib/puppet/module_tool/applications/installer.rb | # frozen_string_literal: true
require 'open-uri'
require 'pathname'
require 'fileutils'
require 'tmpdir'
require_relative '../../../puppet/forge'
require_relative '../../../puppet/module_tool'
require_relative '../../../puppet/module_tool/shared_behaviors'
require_relative '../../../puppet/module_tool/install_directo... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/applications/unpacker.rb | lib/puppet/module_tool/applications/unpacker.rb | # frozen_string_literal: true
require 'pathname'
require 'tmpdir'
require_relative '../../../puppet/util/json'
require_relative '../../../puppet/file_system'
module Puppet::ModuleTool
module Applications
class Unpacker < Application
def self.unpack(filename, target)
app = new(filename, :target_dir... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/applications/uninstaller.rb | lib/puppet/module_tool/applications/uninstaller.rb | # frozen_string_literal: true
module Puppet::ModuleTool
module Applications
class Uninstaller < Application
include Puppet::ModuleTool::Errors
def initialize(name, options)
@name = name
@options = options
@errors = Hash.new { |h, k| h[k] = {} }
@unfilt... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/agent/disabler.rb | lib/puppet/agent/disabler.rb | # frozen_string_literal: true
require_relative '../../puppet/util/json_lockfile'
# This module is responsible for encapsulating the logic for
# "disabling" the puppet agent during a run; in other words,
# keeping track of enough state to answer the question
# "has the puppet agent been administratively disabled?"
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/agent/locker.rb | lib/puppet/agent/locker.rb | # frozen_string_literal: true
require_relative '../../puppet/util/pidlock'
require_relative '../../puppet/error'
# This module is responsible for encapsulating the logic for "locking" the
# puppet agent during a catalog run; in other words, keeping track of enough
# state to answer the question "is there a puppet age... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/resource.rb | lib/puppet/face/resource.rb | # frozen_string_literal: true
require_relative '../../puppet/indirector/face'
Puppet::Indirector::Face.define(:resource, '0.0.1') do
copyright "Puppet Inc.", 2011
license _("Apache 2 license; see COPYING")
summary _("API only: interact directly with resources via the RAL.")
description <<-'EOT'
API onl... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/report.rb | lib/puppet/face/report.rb | # frozen_string_literal: true
require_relative '../../puppet/indirector/face'
Puppet::Indirector::Face.define(:report, '0.0.1') do
copyright "Puppet Inc.", 2011
license _("Apache 2 license; see COPYING")
summary _("Create, display, and submit reports.")
save = get_action(:save)
save.summary _("API only:... | 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.