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/pops/loader/type_definition_instantiator.rb | lib/puppet/pops/loader/type_definition_instantiator.rb | # frozen_string_literal: true
# The TypeDefinitionInstantiator instantiates a type alias or a type definition
#
module Puppet::Pops
module Loader
class TypeDefinitionInstantiator
def self.create(loader, typed_name, source_ref, pp_code_string)
# parse and validate
parser = Parser::EvaluatingParser.new()
m... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/loader/runtime3_type_loader.rb | lib/puppet/pops/loader/runtime3_type_loader.rb | # frozen_string_literal: true
module Puppet::Pops
module Loader
# Runtime3TypeLoader
# ===
# Loads a resource type using the 3.x type loader
#
# @api private
class Runtime3TypeLoader < BaseLoader
attr_reader :resource_3x_loader
def initialize(parent_loader, loaders, environment, resource_3x_loader)
super(pare... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/loader/base_loader.rb | lib/puppet/pops/loader/base_loader.rb | # frozen_string_literal: true
module Puppet::Pops
module Loader
# BaseLoader
# ===
# An abstract implementation of Loader
#
# A derived class should implement `find(typed_name)` and set entries, and possible handle "miss caching".
#
# @api private
#
class BaseLoader < Loader
# The parent loader
attr_reader :parent... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/loader/ruby_function_instantiator.rb | lib/puppet/pops/loader/ruby_function_instantiator.rb | # frozen_string_literal: true
# The RubyFunctionInstantiator instantiates a Puppet::Functions::Function given the ruby source
# that calls Puppet::Functions.create_function.
#
class Puppet::Pops::Loader::RubyFunctionInstantiator
# Produces an instance of the Function class with the given typed_name, or fails with an... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/loader/predefined_loader.rb | lib/puppet/pops/loader/predefined_loader.rb | # frozen_string_literal: true
module Puppet::Pops::Loader
# A PredefinedLoader is a loader that is manually populated with loaded elements
# before being used. It never loads anything on its own.
#
class PredefinedLoader < BaseLoader
def find(typed_name)
nil
end
def to_s
"(PredefinedLoader '#{loader_nam... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/loader/uri_helper.rb | lib/puppet/pops/loader/uri_helper.rb | # frozen_string_literal: true
module Puppet::Pops::Loader::UriHelper
# Raises an exception if specified gem can not be located
#
def path_for_uri(uri, subdir = 'lib')
case uri.scheme
when "gem"
begin
spec = Gem::Specification.find_by_name(uri.hostname)
# if path given append that, e... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/loader/typed_name.rb | lib/puppet/pops/loader/typed_name.rb | # frozen_string_literal: true
module Puppet::Pops
module Loader
# A namespace/name/type combination that can be used as a compound hash key
#
# @api public
class TypedName
attr_reader :hash
attr_reader :type
attr_reader :name_authority
attr_reader :name
attr_reader :name_parts
attr_reader :compound_name
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb | lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb | # frozen_string_literal: true
# The RubyLegacyFunctionInstantiator instantiates a Puppet::Functions::Function given the ruby source
# that calls Puppet::Functions.create_function.
#
require 'ripper'
class Puppet::Pops::Loader::RubyLegacyFunctionInstantiator
UNKNOWN = '<unknown>'
# Produces an instance of the Func... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/model/model_tree_dumper.rb | lib/puppet/pops/model/model_tree_dumper.rb | # frozen_string_literal: true
# Dumps a Pops::Model in reverse polish notation; i.e. LISP style
# The intention is to use this for debugging output
# TODO: BAD NAME - A DUMP is a Ruby Serialization
#
class Puppet::Pops::Model::ModelTreeDumper < Puppet::Pops::Model::TreeDumper
def dump_Array o
o.collect { |e| do_... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/model/tree_dumper.rb | lib/puppet/pops/model/tree_dumper.rb | # frozen_string_literal: true
# Base class for formatted textual dump of a "model"
#
class Puppet::Pops::Model::TreeDumper
attr_accessor :indent_count
def initialize initial_indentation = 0
@@dump_visitor ||= Puppet::Pops::Visitor.new(nil, "dump", 0, 0)
@indent_count = initial_indentation
end
def dum... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/model/ast_transformer.rb | lib/puppet/pops/model/ast_transformer.rb | # frozen_string_literal: true
require_relative '../../../puppet/parser/ast'
# The receiver of `import(file)` calls; once per imported file, or nil if imports are ignored
#
# Transforms a Pops::Model to classic Puppet AST.
# TODO: Documentation is currently skipped completely (it is only used for Rdoc)
#
class Puppet:... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/model/pn_transformer.rb | lib/puppet/pops/model/pn_transformer.rb | # frozen_string_literal: true
require_relative '../../../puppet/concurrent/thread_local_singleton'
module Puppet::Pops
module Model
class PNTransformer
extend Puppet::Concurrent::ThreadLocalSingleton
def self.transform(ast)
singleton.transform(ast)
end
def initialize
@visitor = Visitor.new(nil, 'tra... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/model/factory.rb | lib/puppet/pops/model/factory.rb | # frozen_string_literal: true
# Factory is a helper class that makes construction of a Pops Model
# much more convenient. It can be viewed as a small internal DSL for model
# constructions.
# For usage see tests using the factory.
#
# @todo All those uppercase methods ... they look bad in one way, but stand out nicely... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | true |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/model/model_label_provider.rb | lib/puppet/pops/model/model_label_provider.rb | # frozen_string_literal: true
module Puppet::Pops
module Model
# A provider of labels for model object, producing a human name for the model object.
# As an example, if object is an ArithmeticExpression with operator +, `#a_an(o)` produces "a '+' Expression",
# #the(o) produces "the + Expression", and #label produces ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/model/ast.rb | lib/puppet/pops/model/ast.rb | # frozen_string_literal: true
# # Generated by Puppet::Pops::Types::RubyGenerator from TypeSet Puppet::AST on -4712-01-01
module Puppet
module Pops
module Model
class PopsObject
def self._pcore_type
@_pcore_type ||= Types::PObjectType.new('Puppet::AST::PopsObject', {
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | true |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/data_provider.rb | lib/puppet/pops/lookup/data_provider.rb | # frozen_string_literal: true
module Puppet::Pops
module Lookup
# @api private
module DataProvider
def self.key_type
@key_type
end
def self.value_type
@value_type
end
def self.register_types(loader)
tp = Types::TypeParser.singleton
@key_type = tp.parse('RichDataKey', loader)
@value_type... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/function_provider.rb | lib/puppet/pops/lookup/function_provider.rb | # frozen_string_literal: true
require_relative 'data_adapter'
require_relative 'context'
require_relative 'data_provider'
module Puppet::Pops
module Lookup
# @api private
class FunctionProvider
include DataProvider
attr_reader :parent_data_provider, :function_name, :locations
# Returns the type that all the r... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/interpolation.rb | lib/puppet/pops/lookup/interpolation.rb | # frozen_string_literal: true
require 'hiera/scope'
require_relative 'sub_lookup'
module Puppet::Pops
module Lookup
# Adds support for interpolation expressions. The expressions may contain keys that uses dot-notation
# to further navigate into hashes and arrays
#
# @api public
module Interpolation
include SubLookup... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/global_data_provider.rb | lib/puppet/pops/lookup/global_data_provider.rb | # frozen_string_literal: true
require 'hiera/scope'
require_relative 'configured_data_provider'
module Puppet::Pops
module Lookup
# @api private
class GlobalDataProvider < ConfiguredDataProvider
def place
'Global'
end
def unchecked_key_lookup(key, lookup_invocation, merge)
config = config(lookup_invoca... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/data_dig_function_provider.rb | lib/puppet/pops/lookup/data_dig_function_provider.rb | # frozen_string_literal: true
require_relative 'function_provider'
module Puppet::Pops
module Lookup
# @api private
class DataDigFunctionProvider < FunctionProvider
TAG = 'data_dig'
# Performs a lookup with the assumption that a recursive check has been made.
#
# @param key [LookupKey] The key to lookup
# ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/lookup_key_function_provider.rb | lib/puppet/pops/lookup/lookup_key_function_provider.rb | # frozen_string_literal: true
require_relative 'function_provider'
module Puppet::Pops
module Lookup
# @api private
class LookupKeyFunctionProvider < FunctionProvider
TAG = 'lookup_key'
# Performs a lookup with the assumption that a recursive check has been made.
#
# @param key [LookupKey] The key to lookup
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/lookup_adapter.rb | lib/puppet/pops/lookup/lookup_adapter.rb | # frozen_string_literal: true
require_relative 'data_adapter'
require_relative 'lookup_key'
module Puppet::Pops
module Lookup
# A LookupAdapter is a specialized DataAdapter that uses its hash to store data providers. It also remembers the compiler
# that it is attached to and maintains a cache of _lookup options_ ret... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/lookup_key.rb | lib/puppet/pops/lookup/lookup_key.rb | # frozen_string_literal: true
require_relative 'sub_lookup'
module Puppet::Pops
module Lookup
# @api private
class LookupKey
include SubLookup
attr_reader :module_name, :root_key, :segments
def initialize(key)
segments = split_key(key) { |problem| Puppet::DataBinding::LookupError.new(_("%{problem} in key:... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/environment_data_provider.rb | lib/puppet/pops/lookup/environment_data_provider.rb | # frozen_string_literal: true
require_relative 'configured_data_provider'
module Puppet::Pops
module Lookup
# @api private
class EnvironmentDataProvider < ConfiguredDataProvider
def place
'Environment'
end
protected
def assert_config_version(config)
if config.version > 3
config
else
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/hiera_config.rb | lib/puppet/pops/lookup/hiera_config.rb | # frozen_string_literal: true
require_relative 'data_dig_function_provider'
require_relative 'data_hash_function_provider'
require_relative 'lookup_key_function_provider'
require_relative 'location_resolver'
module Puppet::Pops
module Lookup
# @api private
class ScopeLookupCollectingInvocation < Invocation
def init... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/key_recorder.rb | lib/puppet/pops/lookup/key_recorder.rb | # frozen_string_literal: true
# This class defines the private API of the Lookup Key Recorder support.
# @api private
#
class Puppet::Pops::Lookup::KeyRecorder
def initialize
end
# rubocop:disable Naming/MemoizedInstanceVariableName
def self.singleton
@null_recorder ||= new
end
# rubocop:enable Naming... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/sub_lookup.rb | lib/puppet/pops/lookup/sub_lookup.rb | # frozen_string_literal: true
module Puppet::Pops
module Lookup
module SubLookup
SPECIAL = /['".]/
# Split key into segments. A segment may be a quoted string (both single and double quotes can
# be used) and the segment separator is the '.' character. Whitespace will be trimmed off on
# both sides of each se... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/explainer.rb | lib/puppet/pops/lookup/explainer.rb | # frozen_string_literal: true
module Puppet::Pops
module Lookup
# The ExplainNode contains information of a specific node in a tree traversed during
# lookup. The tree can be traversed using the `parent` and `branches` attributes of
# each node.
#
# Each leaf node contains information about what happened whe... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/data_hash_function_provider.rb | lib/puppet/pops/lookup/data_hash_function_provider.rb | # frozen_string_literal: true
require_relative 'function_provider'
require_relative 'interpolation'
module Puppet::Pops
module Lookup
# @api private
class DataHashFunctionProvider < FunctionProvider
include SubLookup
include Interpolation
TAG = 'data_hash'
def self.trusted_return_type
@trusted_return_ty... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/invocation.rb | lib/puppet/pops/lookup/invocation.rb | # frozen_string_literal: true
require_relative '../../../puppet/thread_local'
require_relative 'explainer'
module Puppet::Pops
module Lookup
# @api private
class Invocation
attr_reader :scope, :override_values, :default_values, :explainer, :module_name, :top_key, :adapter_class
def self.current
(@current ||... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/context.rb | lib/puppet/pops/lookup/context.rb | # frozen_string_literal: true
require_relative 'interpolation'
module Puppet::Pops
module Lookup
# The EnvironmentContext is adapted to the current environment
#
class EnvironmentContext < Adaptable::Adapter
class FileData
attr_reader :data
def initialize(path, inode, mtime, size, data)
@path = path
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/module_data_provider.rb | lib/puppet/pops/lookup/module_data_provider.rb | # frozen_string_literal: true
require_relative 'configured_data_provider'
module Puppet::Pops
module Lookup
# @api private
class ModuleDataProvider < ConfiguredDataProvider
attr_reader :module_name
def initialize(module_name, config = nil)
super(config)
@module_name = module_name
end
def place
'... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/data_adapter.rb | lib/puppet/pops/lookup/data_adapter.rb | # frozen_string_literal: true
module Puppet::Pops
module Lookup
# A class that adapts a Hash
# @api private
class DataAdapter < Adaptable::Adapter
def self.create_adapter(o)
new
end
def initialize
@data = {}
end
def [](name)
@data[name]
end
def include?(name)
@data.include? name
end
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/location_resolver.rb | lib/puppet/pops/lookup/location_resolver.rb | # frozen_string_literal: true
require 'pathname'
require_relative 'interpolation'
module Puppet::Pops
module Lookup
# Class that keeps track of the original location (as it appears in the declaration, before interpolation),
# and the fully resolved location, and whether or not the resolved location exists.
#
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/lookup/configured_data_provider.rb | lib/puppet/pops/lookup/configured_data_provider.rb | # frozen_string_literal: true
require_relative 'hiera_config'
require_relative 'data_provider'
module Puppet::Pops
module Lookup
# @api private
class ConfiguredDataProvider
include DataProvider
# @param config [HieraConfig,nil] the configuration
def initialize(config = nil)
@config = config.nil? ? nil : as... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/puppet_proc.rb | lib/puppet/pops/evaluator/puppet_proc.rb | # frozen_string_literal: true
# Complies with Proc API by mapping a Puppet::Pops::Evaluator::Closure to a ruby Proc.
# Creating and passing an instance of this class instead of just a plain block makes
# it possible to inherit the parameter info and arity from the closure. Advanced users
# may also access the closure ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/collector_transformer.rb | lib/puppet/pops/evaluator/collector_transformer.rb | # frozen_string_literal: true
module Puppet::Pops
module Evaluator
class CollectorTransformer
def initialize
@@query_visitor ||= Visitor.new(nil, "query", 1, 1)
@@match_visitor ||= Visitor.new(nil, "match", 1, 1)
@@evaluator ||= EvaluatorImpl.new
@@compare_operator ||= CompareOperator.ne... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/runtime3_converter.rb | lib/puppet/pops/evaluator/runtime3_converter.rb | # frozen_string_literal: true
module Puppet::Pops::Evaluator
# Converts nested 4x supported values to 3x values. This is required because
# resources and other objects do not know about the new type system, and does not support
# regular expressions. Unfortunately this has to be done for array and hash as well.
# 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/pops/evaluator/literal_evaluator.rb | lib/puppet/pops/evaluator/literal_evaluator.rb | # frozen_string_literal: true
module Puppet::Pops
module Evaluator
# Literal values for
# String (not containing interpolation)
# Numbers
# Booleans
# Undef (produces nil)
# Array
# Hash
# QualifiedName
# Default (produced :default)
# Regular Expression (produces ruby regular expression)
# QualifiedReference
# AccessE... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/external_syntax_support.rb | lib/puppet/pops/evaluator/external_syntax_support.rb | # frozen_string_literal: true
# This module is an integral part of the evaluator. It deals with the concern of validating
# external syntax in text produced by heredoc and templates.
#
require_relative '../../../puppet/plugins/syntax_checkers'
module Puppet::Pops::Evaluator::ExternalSyntaxSupport
def assert_external... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/access_operator.rb | lib/puppet/pops/evaluator/access_operator.rb | # frozen_string_literal: true
module Puppet::Pops
module Evaluator
# AccessOperator handles operator []
# This operator is part of evaluation.
#
class AccessOperator
# Provides access to the Puppet 3.x runtime (scope, etc.)
# This separation has been made to make it easier to later migrate the evaluator to an impr... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/evaluator_impl.rb | lib/puppet/pops/evaluator/evaluator_impl.rb | # frozen_string_literal: true
require_relative '../../../puppet/parser/scope'
require_relative '../../../puppet/pops/evaluator/compare_operator'
require_relative '../../../puppet/pops/evaluator/relationship_operator'
require_relative '../../../puppet/pops/evaluator/access_operator'
require_relative '../../../puppet/po... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | true |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/runtime3_support.rb | lib/puppet/pops/evaluator/runtime3_support.rb | # frozen_string_literal: true
module Puppet::Pops
module Evaluator
# A module with bindings between the new evaluator and the 3x runtime.
# The intention is to separate all calls into scope, compiler, resource, etc. in this module
# to make it easier to later refactor the evaluator for better implementations of the 3x... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/epp_evaluator.rb | lib/puppet/pops/evaluator/epp_evaluator.rb | # frozen_string_literal: true
# Handler of Epp call/evaluation from the epp and inline_epp functions
#
class Puppet::Pops::Evaluator::EppEvaluator
def self.inline_epp(scope, epp_source, template_args = nil)
unless epp_source.is_a?(String)
# TRANSLATORS 'inline_epp()' is a method name and 'epp' refers to 'E... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/json_strict_literal_evaluator.rb | lib/puppet/pops/evaluator/json_strict_literal_evaluator.rb | # frozen_string_literal: true
# Literal values for
#
# * String
# * Numbers
# * Booleans
# * Undef (produces nil)
# * Array
# * Hash where keys must be Strings
# * QualifiedName
#
# Not considered literal:
#
# * QualifiedReference # i.e. File, FooBar
# * Default is not accepted as being literal
# ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/deferred_resolver.rb | lib/puppet/pops/evaluator/deferred_resolver.rb | # frozen_string_literal: true
require_relative '../../../puppet/parser/script_compiler'
module Puppet::Pops
module Evaluator
class DeferredValue
def initialize(proc)
@proc = proc
end
def resolve
val = @proc.call
# Deferred sensitive values will be marked as such in resolve_futures()
if val.is_a... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/closure.rb | lib/puppet/pops/evaluator/closure.rb | # frozen_string_literal: true
module Puppet::Pops
module Evaluator
class Jumper < Exception # rubocop:disable Lint/InheritException
attr_reader :value
attr_reader :file
attr_reader :line
def initialize(value, file, line)
@value = value
@file = file
@line = line
end
end
cla... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/compare_operator.rb | lib/puppet/pops/evaluator/compare_operator.rb | # frozen_string_literal: true
module Puppet::Pops
module Evaluator
# Compares the puppet DSL way
#
# ==Equality
# All string vs. numeric equalities check for numeric equality first, then string equality
# Arrays are equal to arrays if they have the same length, and each element #equals
# Hashes are equal to hashes if... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/runtime3_resource_support.rb | lib/puppet/pops/evaluator/runtime3_resource_support.rb | # frozen_string_literal: true
module Puppet::Pops
module Evaluator
# @api private
module Runtime3ResourceSupport
CLASS_STRING = 'class'
def self.create_resources(file, line, scope, virtual, exported, type_name, resource_titles, evaluated_parameters)
env = scope.environment
# loader = Adapters::LoaderAd... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/relationship_operator.rb | lib/puppet/pops/evaluator/relationship_operator.rb | # frozen_string_literal: true
module Puppet::Pops
module Evaluator
# The RelationshipOperator implements the semantics of the -> <- ~> <~ operators creating relationships or notification
# relationships between the left and right hand side's references to resources.
#
# This is separate class since a second level of e... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/callable_signature.rb | lib/puppet/pops/evaluator/callable_signature.rb | # frozen_string_literal: true
# CallableSignature
# ===
# A CallableSignature describes how something callable expects to be called.
# Different implementation of this class are used for different types of callables.
#
# @api public
#
class Puppet::Pops::Evaluator::CallableSignature
# Returns the names of the parame... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/collectors/catalog_collector.rb | lib/puppet/pops/evaluator/collectors/catalog_collector.rb | # frozen_string_literal: true
class Puppet::Pops::Evaluator::Collectors::CatalogCollector < Puppet::Pops::Evaluator::Collectors::AbstractCollector
# Creates a CatalogCollector using the AbstractCollector's
# constructor to set the scope and overrides
#
# param [Puppet::CompilableResourceType] type the resource... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/collectors/exported_collector.rb | lib/puppet/pops/evaluator/collectors/exported_collector.rb | # frozen_string_literal: true
class Puppet::Pops::Evaluator::Collectors::ExportedCollector < Puppet::Pops::Evaluator::Collectors::AbstractCollector
# Creates an ExportedCollector using the AbstractCollector's
# constructor to set the scope and overrides
#
# param [Puppet::CompilableResourceType] type the resou... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/collectors/abstract_collector.rb | lib/puppet/pops/evaluator/collectors/abstract_collector.rb | # frozen_string_literal: true
class Puppet::Pops::Evaluator::Collectors::AbstractCollector
attr_reader :scope
# The collector's hash of overrides {:parameters => params}
attr_reader :overrides
# The set of collected resources
attr_reader :collected
# An empty array which will be returned by the unresolv... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/collectors/fixed_set_collector.rb | lib/puppet/pops/evaluator/collectors/fixed_set_collector.rb | # frozen_string_literal: true
class Puppet::Pops::Evaluator::Collectors::FixedSetCollector < Puppet::Pops::Evaluator::Collectors::AbstractCollector
# Creates a FixedSetCollector using the AbstractCollector constructor
# to set the scope. It is not possible for a collection to have
# overrides in this case, since... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/time/timespan.rb | lib/puppet/pops/time/timespan.rb | # frozen_string_literal: true
require_relative '../../../puppet/concurrent/thread_local_singleton'
module Puppet::Pops
module Time
NSECS_PER_USEC = 1000
NSECS_PER_MSEC = NSECS_PER_USEC * 1000
NSECS_PER_SEC = NSECS_PER_MSEC * 1000
NSECS_PER_MIN = NSECS_PER_SEC * 60
NSECS_PER_HOUR = NSECS_PER_MIN * 60
N... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/time/timestamp.rb | lib/puppet/pops/time/timestamp.rb | # frozen_string_literal: true
module Puppet::Pops
module Time
class Timestamp < TimeData
DEFAULT_FORMATS_WO_TZ = ['%FT%T.%N', '%FT%T', '%F %T.%N', '%F %T', '%F']
DEFAULT_FORMATS = ['%FT%T.%N %Z', '%FT%T %Z', '%F %T.%N %Z', '%F %T %Z', '%F %Z'] + DEFAULT_FORMATS_WO_TZ
CURRENT_TIMEZONE = 'current'
KEY_TIMEZONE ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/type_assertion_error.rb | lib/puppet/pops/types/type_assertion_error.rb | # frozen_string_literal: true
module Puppet::Pops::Types
# Raised when an assertion of actual type against an expected type fails.
#
class TypeAssertionError < Puppet::Error
# Returns the expected type
# @return [PAnyType] expected type
attr_reader :expected_type
# Returns the actual type
# ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/type_factory.rb | lib/puppet/pops/types/type_factory.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# Helper module that makes creation of type objects simpler.
# @api public
#
module TypeFactory
@type_calculator = TypeCalculator.singleton
# Clears caches - used when testing
def self.clear
# these types are cached and needs to be nulled as the... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/p_meta_type.rb | lib/puppet/pops/types/p_meta_type.rb | # frozen_string_literal: true
# @abstract base class for PObjectType and other types that implements lazy evaluation of content
# @api private
module Puppet::Pops
module Types
KEY_NAME = 'name'
KEY_TYPE = 'type'
KEY_VALUE = 'value'
class PMetaType < PAnyType
include Annotatable
attr_reader :loader
def self.re... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/ruby_generator.rb | lib/puppet/pops/types/ruby_generator.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# @api private
class RubyGenerator < TypeFormatter
RUBY_RESERVED_WORDS = {
'alias' => '_alias',
'begin' => '_begin',
'break' => '_break',
'def' => '_def',
'do' => '_do',
'end' => '_end',
'ensure' => '_ensure',
'for' => '_f... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/ruby_method.rb | lib/puppet/pops/types/ruby_method.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
class RubyMethod < Annotation
# Register the Annotation type. This is the type that all custom Annotations will inherit from.
def self.register_ptype(loader, ir)
@type = Pcore.create_object_type(loader, ir, self, 'RubyMethod', 'Annotation',... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/p_sem_ver_type.rb | lib/puppet/pops/types/p_sem_ver_type.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# A Puppet Language Type that exposes the {{SemanticPuppet::Version}} and {{SemanticPuppet::VersionRange}}.
# The version type is parameterized with version ranges.
#
# @api public
class PSemVerType < PScalarType
def self.register_ptype(loader, ir)
c... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/p_type_set_type.rb | lib/puppet/pops/types/p_type_set_type.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
KEY_NAME_AUTHORITY = 'name_authority'
KEY_TYPES = 'types'
KEY_ALIAS = 'alias'
KEY_VERSION = 'version'
KEY_VERSION_RANGE = 'version_range'
KEY_REFERENCES = 'references'
class PTypeSetType < PMetaType
# A Loader that makes the types known to the TypeSet v... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/p_runtime_type.rb | lib/puppet/pops/types/p_runtime_type.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# @api public
class PRuntimeType < PAnyType
TYPE_NAME_OR_PATTERN = PVariantType.new([PStringType::NON_EMPTY, PTupleType.new([PRegexpType::DEFAULT, PStringType::NON_EMPTY])])
def self.register_ptype(loader, ir)
create_ptype(loader, ir, 'AnyType',
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/iterable.rb | lib/puppet/pops/types/iterable.rb | # frozen_string_literal: true
module Puppet::Pops::Types
# Implemented by classes that can produce an iterator to iterate over their contents
module IteratorProducer
def iterator
raise ArgumentError, 'iterator() is not implemented'
end
end
# The runtime Iterable type for an Iterable
module Ite... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/type_parser.rb | lib/puppet/pops/types/type_parser.rb | # frozen_string_literal: true
require_relative '../../../puppet/concurrent/thread_local_singleton'
# This class provides parsing of Type Specification from a string into the Type
# Model that is produced by the TypeFactory.
#
# The Type Specifications that are parsed are the same as the stringified forms
# of types p... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/p_sensitive_type.rb | lib/puppet/pops/types/p_sensitive_type.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# A Puppet Language type that wraps sensitive information. The sensitive type is parameterized by
# the wrapped value type.
#
#
# @api public
class PSensitiveType < PTypeWithContainedType
class Sensitive
def initialize(value)
@value = value
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/p_object_type_extension.rb | lib/puppet/pops/types/p_object_type_extension.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# Base class for Parameterized Object implementations. The wrapper impersonates the base
# object and extends it with methods to filter assignable types and instances based on parameter
# values.
#
# @api public
class PObjectTypeExtension < PAnyType
incl... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/string_converter.rb | lib/puppet/pops/types/string_converter.rb | # frozen_string_literal: true
require_relative '../../../puppet/concurrent/thread_local_singleton'
module Puppet::Pops
module Types
# Converts Puppet runtime objects to String under the control of a Format.
# Use from Puppet Language is via the function `new`.
#
# @api private
#
class StringConverter
# @api private... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | true |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/p_uri_type.rb | lib/puppet/pops/types/p_uri_type.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
class PURIType < PAnyType
# Tell evaluator that an members of instances of this type can be invoked using dot notation
include TypeWithMembers
SCHEME = 'scheme'
USERINFO = 'userinfo'
HOST = 'host'
PORT = 'port'
PATH = 'path'
QUERY = 'query... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/annotation.rb | lib/puppet/pops/types/annotation.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# Pcore variant of the Adaptable::Adapter. Uses a Pcore Object type instead of a Class
class Annotation < Adaptable::Adapter
include Types::PuppetObject
CLEAR = 'clear'
# Register the Annotation type. This is the type that all custom Anno... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/p_object_type.rb | lib/puppet/pops/types/p_object_type.rb | # frozen_string_literal: true
require_relative 'ruby_generator'
require_relative 'type_with_members'
module Puppet::Pops
module Types
KEY_ATTRIBUTES = 'attributes'
KEY_CHECKS = 'checks'
KEY_CONSTANTS = 'constants'
KEY_EQUALITY = 'equality'
KEY_EQUALITY_INCLUDE_TYPE = 'equality_include_type'
KEY_FINAL = 'final'
KEY_FU... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | true |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/p_init_type.rb | lib/puppet/pops/types/p_init_type.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# @api public
class PInitType < PTypeWithContainedType
def self.register_ptype(loader, ir)
create_ptype(loader, ir, 'AnyType',
'type' => {
KEY_TYPE => POptionalType.new(PTypeType::DEFAULT),
KEY_V... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/type_asserter.rb | lib/puppet/pops/types/type_asserter.rb | # frozen_string_literal: true
# Utility module for type assertion
#
module Puppet::Pops::Types
module TypeAsserter
# Asserts that a type_to_check is assignable to required_type and raises
# a {Puppet::ParseError} if that's not the case
#
# @param subject [String,Array] String to be prepended to the exception m... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/type_conversion_error.rb | lib/puppet/pops/types/type_conversion_error.rb | # frozen_string_literal: true
module Puppet::Pops::Types
# Raised when a conversion of a value to another type failed.
#
class TypeConversionError < Puppet::Error; 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/pops/types/puppet_object.rb | lib/puppet/pops/types/puppet_object.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# Marker module for implementations that are mapped to Object types
# @api public
module PuppetObject
# Returns the Puppet Type for this instance. The implementing class must
# add the {#_pcore_type} as a class method.
#
# @return [PObjectType] the... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/p_binary_type.rb | lib/puppet/pops/types/p_binary_type.rb | # frozen_string_literal: true
require 'base64'
module Puppet::Pops
module Types
# A Puppet Language Type that represents binary data content (a sequence of 8-bit bytes).
# Instances of this data type can be created from `String` and `Array[Integer[0,255]]`
# values. Also see the `binary_file` function for reading bina... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/class_loader.rb | lib/puppet/pops/types/class_loader.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# The ClassLoader provides a Class instance given a class name or a meta-type.
# If the class is not already loaded, it is loaded using the Puppet Autoloader.
# This means it can load a class from a gem, or from puppet modules.
#
class ClassLoader
@autol... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/tree_iterators.rb | lib/puppet/pops/types/tree_iterators.rb | # frozen_string_literal: true
module Puppet::Pops::Types
module Iterable
class TreeIterator
include Iterable
DEFAULT_CONTAINERS = TypeFactory.variant(
PArrayType::DEFAULT,
PHashType::DEFAULT,
PObjectType::DEFAULT
)
# Creates a TreeIterator that by default treats all Array, Hash and Object instanc... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/type_with_members.rb | lib/puppet/pops/types/type_with_members.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# Interface implemented by a type that has InvocableMembers
module TypeWithMembers
# @return [InvocableMember,nil] An invocable member if it exists, or `nil`
def [](member_name)
raise NotImplementedError, "'#{self.class.name}' should implement #[]"... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/types.rb | lib/puppet/pops/types/types.rb | # frozen_string_literal: true
require_relative 'iterable'
require_relative 'recursion_guard'
require_relative 'type_acceptor'
require_relative 'type_asserter'
require_relative 'type_assertion_error'
require_relative 'type_conversion_error'
require_relative 'type_formatter'
require_relative 'type_calculator'
require_re... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | true |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/type_formatter.rb | lib/puppet/pops/types/type_formatter.rb | # frozen_string_literal: true
require_relative '../../../puppet/concurrent/thread_local_singleton'
module Puppet::Pops
module Types
# String
# ------
# Creates a string representation of a type.
#
# @api public
#
class TypeFormatter
extend Puppet::Concurrent::ThreadLocalSingleton
# Produces a String representati... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/type_mismatch_describer.rb | lib/puppet/pops/types/type_mismatch_describer.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# @api private
class TypePathElement
attr_reader :key
def initialize(key)
@key = key
end
def hash
key.hash
end
def ==(o)
self.class == o.class && key == o.key
end
def eql?(o)
self == o
end... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | true |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/type_acceptor.rb | lib/puppet/pops/types/type_acceptor.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# Implements a standard visitor patter for the Puppet Type system.
#
# An instance of this module is passed as an argument to the {PAnyType#accept}
# method of a Type instance. That type will then use the {TypeAcceptor#visit} callback
# on the acceptor an... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/p_timespan_type.rb | lib/puppet/pops/types/p_timespan_type.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
class PAbstractTimeDataType < PScalarType
# @param from [AbstractTime] lower bound for this type. Nil or :default means unbounded
# @param to [AbstractTime] upper bound for this type. Nil or :default means unbounded
def initialize(from, to = ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/p_sem_ver_range_type.rb | lib/puppet/pops/types/p_sem_ver_range_type.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# An unparameterized type that represents all VersionRange instances
#
# @api public
class PSemVerRangeType < PAnyType
def self.register_ptype(loader, ir)
create_ptype(loader, ir, 'AnyType')
end
# Check if a version is included in a version rang... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/type_set_reference.rb | lib/puppet/pops/types/type_set_reference.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
class TypeSetReference
include Annotatable
attr_reader :name_authority
attr_reader :name
attr_reader :version_range
attr_reader :type_set
def initialize(owner, init_hash)
@owner = owner
@name_authority = (init_hash[KEY_NAME_AUTHORITY]... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/type_calculator.rb | lib/puppet/pops/types/type_calculator.rb | # frozen_string_literal: true
require_relative '../../../puppet/concurrent/thread_local_singleton'
module Puppet::Pops
module Types
# The TypeCalculator can answer questions about puppet types.
#
# The Puppet type system is primarily based on sub-classing. When asking the type calculator to infer types from Ruby in g... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/recursion_guard.rb | lib/puppet/pops/types/recursion_guard.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# Keeps track of self recursion of conceptual 'this' and 'that' instances using two separate maps and
# a state. The class is used when tracking self recursion in two objects ('this' and 'that') simultaneously.
# A typical example of when this is needed is... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/annotatable.rb | lib/puppet/pops/types/annotatable.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
KEY_ANNOTATIONS = 'annotations'
# Behaviour common to all Pcore annotatable classes
#
# @api public
module Annotatable
TYPE_ANNOTATIONS = PHashType.new(PTypeType.new(PTypeReferenceType.new('Annotation')), PHashType::DEFAULT)
# @return [{PTypeType => ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/implementation_registry.rb | lib/puppet/pops/types/implementation_registry.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
# The {ImplementationRegistry} maps names types in the Puppet Type System to names of corresponding implementation
# modules/classes. Each mapping is unique and bidirectional so that for any given type name there is only one
# implementation and vice... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/p_timestamp_type.rb | lib/puppet/pops/types/p_timestamp_type.rb | # frozen_string_literal: true
module Puppet::Pops
module Types
class PTimestampType < PAbstractTimeDataType
def self.register_ptype(loader, ir)
create_ptype(loader, ir, 'ScalarType',
'from' => { KEY_TYPE => POptionalType.new(PTimestampType::DEFAULT), KEY_VALUE => nil },
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/migration/migration_checker.rb | lib/puppet/pops/migration/migration_checker.rb | # frozen_string_literal: true
# This class defines the private API of the MigrationChecker support.
# @api private
#
class Puppet::Pops::Migration::MigrationChecker
def initialize
end
# rubocop:disable Naming/MemoizedInstanceVariableName
def self.singleton
@null_checker ||= new
end
# rubocop:enable Na... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/functions/dispatch.rb | lib/puppet/pops/functions/dispatch.rb | # frozen_string_literal: true
module Puppet::Pops
module Functions
# Defines a connection between a implementation method and the signature that
# the method will handle.
#
# This interface should not be used directly. Instead dispatches should be
# constructed using the DSL defined in {Puppet::Functions}.
#
# @api pr... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/functions/dispatcher.rb | lib/puppet/pops/functions/dispatcher.rb | # frozen_string_literal: true
# Evaluate the dispatches defined as {Puppet::Pops::Functions::Dispatch}
# instances to call the appropriate method on the
# {Puppet::Pops::Functions::Function} instance.
#
# @api private
class Puppet::Pops::Functions::Dispatcher
attr_reader :dispatchers
# @api private
def initiali... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/functions/function.rb | lib/puppet/pops/functions/function.rb | # frozen_string_literal: true
# @note WARNING: This new function API is still under development and may change at
# any time
#
# A function in the puppet evaluator.
#
# Functions are normally defined by another system, which produces subclasses
# of this class as well as constructing delegations to call the appropri... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/parser/parser_support.rb | lib/puppet/pops/parser/parser_support.rb | # frozen_string_literal: true
require_relative '../../../puppet/parser/functions'
require_relative '../../../puppet/parser/files'
require_relative '../../../puppet/resource/type_collection'
require_relative '../../../puppet/resource/type'
require 'monitor'
module Puppet::Pops
module Parser
# Supporting logic for the ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/parser/eparser.rb | lib/puppet/pops/parser/eparser.rb | #
# DO NOT MODIFY!!!!
# This file is automatically generated by Racc 1.5.2
# from Racc grammar file "".
#
require 'racc/parser.rb'
require_relative '../../../puppet'
require_relative '../../../puppet/pops'
module Puppet
class ParseError < Puppet::Error; end
class ImportError < Racc::ParseError; end
class Alrea... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | true |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/parser/code_merger.rb | lib/puppet/pops/parser/code_merger.rb | # frozen_string_literal: true
class Puppet::Pops::Parser::CodeMerger
# Concatenates the logic in the array of parse results into one parse result.
# @return Puppet::Parser::AST::BlockExpression
#
def concatenate(parse_results)
# this is a bit brute force as the result is already 3x ast with wrapped 4x cont... | 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.