source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/issues.rb
Ruby
apache-2.0
7,843
main
42,785
# frozen_string_literal: true # Defines classes to deal with issues, and message formatting and defines constants with Issues. # @api public # module Puppet::Pops module Issues # Describes an issue, and can produce a message for an occurrence of the issue. # class Issue # The issue code # @return [Symbol...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/visitable.rb
Ruby
apache-2.0
7,843
main
215
# frozen_string_literal: true # Visitable is a mix-in module that makes a class visitable by a Visitor module Puppet::Pops::Visitable def accept(visitor, *arguments) visitor.visit(self, *arguments) end end
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/loaders.rb
Ruby
apache-2.0
7,843
main
21,963
# frozen_string_literal: true module Puppet::Pops # This is the container for all Loader instances. Each Loader instance has a `loader_name` by which it can be uniquely # identified within this container. # A Loader can be private or public. In general, code will have access to the private loader associated with the #...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/validation.rb
Ruby
apache-2.0
7,843
main
16,131
# frozen_string_literal: true module Puppet::Pops # A module with base functionality for validation of a model. # # * **Factory** - an abstract factory implementation that makes it easier to create a new validation factory. # * **SeverityProducer** - produces a severity (:error, :warning, :ignore) for a given Issue # ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/utils.rb
Ruby
apache-2.0
7,843
main
3,389
# frozen_string_literal: true # Provides utility methods module Puppet::Pops module Utils # Can the given o be converted to numeric? (or is numeric already) # Accepts a leading '::' # Returns a boolean if the value is numeric # If testing if value can be converted it is more efficient to call {#to_n} or {#to_n...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/merge_strategy.rb
Ruby
apache-2.0
7,843
main
15,410
# frozen_string_literal: true require 'deep_merge/core' module Puppet::Pops # Merges to objects into one based on an implemented strategy. # class MergeStrategy NOT_FOUND = Object.new.freeze def self.strategies @@strategies ||= {} end private_class_method :strategies # Finds the merg...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/patterns.rb
Ruby
apache-2.0
7,843
main
2,576
# frozen_string_literal: true # The Patterns module contains common regular expression patters for the Puppet DSL language module Puppet::Pops::Patterns # NUMERIC matches hex, octal, decimal, and floating point and captures several parts # 0 = entire matched number, leading and trailing whitespace and sign include...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup.rb
Ruby
apache-2.0
7,843
main
4,115
# frozen_string_literal: true # This class is the backing implementation of the Puppet function 'lookup'. # See puppet/functions/lookup.rb for documentation. # module Puppet::Pops module Lookup LOOKUP_OPTIONS = 'lookup_options' GLOBAL = '__global__' # Performs a lookup in the configured scopes and optionally me...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/semantic_error.rb
Ruby
apache-2.0
7,843
main
787
# frozen_string_literal: true # Error that is used to raise an Issue. See {Puppet::Pops::Issues}. # class Puppet::Pops::SemanticError < RuntimeError attr_accessor :issue attr_accessor :semantic attr_accessor :options # @param issue [Puppet::Pops::Issues::Issue] the issue describing the severity and message ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/pn.rb
Ruby
apache-2.0
7,843
main
4,185
# frozen_string_literal: true module Puppet::Pops module PN KEY_PATTERN = /^[A-Za-z_-][0-9A-Za-z_-]*$/ def pnError(message) raise ArgumentError, message end def as_call(name) Call.new(name, self) end def as_parameters [self] end def ==(o) eql?(o) end def to_s s = ''.dup ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/issue_reporter.rb
Ruby
apache-2.0
7,843
main
5,718
# frozen_string_literal: true module Puppet::Pops class IssueReporter # @param acceptor [Validation::Acceptor] the acceptor containing reported issues # @option options [String] :message (nil) A message text to use as prefix in # a single Error message # @option options [Boolean] :emit_warnings (false) wheth...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/label_provider.rb
Ruby
apache-2.0
7,843
main
2,320
# frozen_string_literal: true # Provides a label for an object. # This simple implementation calls #to_s on the given object, and handles articles 'a/an/the'. # module Puppet::Pops::LabelProvider VOWELS = %w[a e i o u y] SKIPPED_CHARACTERS = %w[" '] A = "a" AN = "an" # Provides a label for the given object ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/serialization.rb
Ruby
apache-2.0
7,843
main
1,409
# frozen_string_literal: true module Puppet::Pops module Serialization def self.not_implemented(impl, method_name) raise NotImplementedError, "The class #{impl.class.name} should have implemented the method #{method_name}()" end class SerializationError < Puppet::Error end PCORE_TYPE_KEY = '__ptype' ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/puppet_stack.rb
Ruby
apache-2.0
7,843
main
1,609
# frozen_string_literal: true require_relative '../../puppet/thread_local' module Puppet module Pops # Utility class for keeping track of the "Puppet stack", ie the file # and line numbers of Puppet Code that created the current context. # # To use this make a call with: # # ```rb # Pupp...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/visitor.rb
Ruby
apache-2.0
7,843
main
4,313
# frozen_string_literal: true module Puppet::Pops # A Visitor performs delegation to a given receiver based on the configuration of the Visitor. # A new visitor is created with a given receiver, a method prefix, min, and max argument counts. # e.g. # visitor = Visitor.new(self, "visit_from", 1, 1) # will make the vi...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/pcore.rb
Ruby
apache-2.0
7,843
main
5,804
# frozen_string_literal: true require 'uri' module Puppet::Pops module Pcore include Types::PuppetObject TYPE_URI_RX = Types::TypeFactory.regexp(URI::DEFAULT_PARSER.make_regexp) TYPE_URI = Types::TypeFactory.pattern(TYPE_URI_RX) TYPE_URI_ALIAS = Types::PTypeAliasType.new('Pcore::URI', nil, TYPE_URI) TYPE_S...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/resource/resource_type_impl.rb
Ruby
apache-2.0
7,843
main
11,032
# frozen_string_literal: true require_relative 'param' module Puppet::Pops module Resource def self.register_ptypes(loader, ir) types = [Param, ResourceTypeImpl].map do |c| c.register_ptype(loader, ir) end types.each { |t| t.resolve(loader) } end class ResourceTypeImpl # Make instances of this class dire...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/resource/param.rb
Ruby
apache-2.0
7,843
main
1,696
# frozen_string_literal: true # An implementation of the interface Puppet::Resource # that adapts the 3.x compiler and catalog expectations on # a resource instance. This instance is backed by a # pcore representation of the resource type an instance of this # ruby class. # # This class must inherit from Puppet::Resou...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/time/timespan.rb
Ruby
apache-2.0
7,843
main
20,051
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/time/timestamp.rb
Ruby
apache-2.0
7,843
main
4,786
# 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 ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/lookup_key.rb
Ruby
apache-2.0
7,843
main
2,715
# 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:...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/module_data_provider.rb
Ruby
apache-2.0
7,843
main
2,999
# 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 '...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/sub_lookup.rb
Ruby
apache-2.0
7,843
main
3,645
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/lookup_adapter.rb
Ruby
apache-2.0
7,843
main
22,166
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/global_data_provider.rb
Ruby
apache-2.0
7,843
main
2,811
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/explainer.rb
Ruby
apache-2.0
7,843
main
14,664
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/data_adapter.rb
Ruby
apache-2.0
7,843
main
386
# 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 ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/interpolation.rb
Ruby
apache-2.0
7,843
main
5,934
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/location_resolver.rb
Ruby
apache-2.0
7,843
main
4,269
# 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. # ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/data_dig_function_provider.rb
Ruby
apache-2.0
7,843
main
5,225
# 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 # ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/lookup_key_function_provider.rb
Ruby
apache-2.0
7,843
main
3,229
# 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 ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/context.rb
Ruby
apache-2.0
7,843
main
6,277
# 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 ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/data_hash_function_provider.rb
Ruby
apache-2.0
7,843
main
4,214
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/data_provider.rb
Ruby
apache-2.0
7,843
main
3,636
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/invocation.rb
Ruby
apache-2.0
7,843
main
8,553
# 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 ||...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/hiera_config.rb
Ruby
apache-2.0
7,843
main
32,623
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/environment_data_provider.rb
Ruby
apache-2.0
7,843
main
940
# 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 ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/function_provider.rb
Ruby
apache-2.0
7,843
main
3,391
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/key_recorder.rb
Ruby
apache-2.0
7,843
main
440
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/lookup/configured_data_provider.rb
Ruby
apache-2.0
7,843
main
3,007
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/validation/tasks_checker.rb
Ruby
apache-2.0
7,843
main
2,008
# frozen_string_literal: true module Puppet::Pops module Validation # Validator that limits the set of allowed expressions to not include catalog related operations # @api private class TasksChecker < Checker4_0 def in_ApplyExpression? top = container(0) step = -1 until container(step) == top retur...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/validation/validator_factory_4_0.rb
Ruby
apache-2.0
7,843
main
1,291
# frozen_string_literal: true module Puppet::Pops module Validation # Configures validation suitable for 4.0 # class ValidatorFactory_4_0 < Factory # Produces the checker to use def checker diagnostic_producer if Puppet[:tasks] require_relative 'tasks_checker' TasksChecker.new(diagnostic_producer) ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/validation/checker4_0.rb
Ruby
apache-2.0
7,843
main
34,970
# frozen_string_literal: true require_relative '../../../puppet/pops/evaluator/external_syntax_support' module Puppet::Pops module Validation # A Validator validates a model. # # Validation is performed on each model element in isolation. Each method should validate the model element's state # but not validate its re...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/parser/evaluating_parser.rb
Ruby
apache-2.0
7,843
main
4,660
# frozen_string_literal: true require_relative '../../../puppet/concurrent/thread_local_singleton' module Puppet::Pops module Parser # Does not support "import" and parsing ruby files # class EvaluatingParser extend Puppet::Concurrent::ThreadLocalSingleton attr_reader :parser def initialize @parser = Pars...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/parser/heredoc_support.rb
Ruby
apache-2.0
7,843
main
6,254
# frozen_string_literal: true module Puppet::Pops module Parser module HeredocSupport include LexerSupport # Pattern for heredoc `@(endtag[:syntax][/escapes]) # Produces groups for endtag (group 1), syntax (group 2), and escapes (group 3) # PATTERN_HEREDOC = %r{@\(([^:/\r\n)]+)(?::[[:blank:]]*([a-z][a-zA-Z0...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/parser/locator.rb
Ruby
apache-2.0
7,843
main
12,288
# frozen_string_literal: true module Puppet::Pops module Parser # Helper class that keeps track of where line breaks are located and can answer questions about positions. # class Locator # Creates, or recreates a Locator. A Locator is created if index is not given (a scan is then # performed of the given source st...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/parser/epp_support.rb
Ruby
apache-2.0
7,843
main
9,885
# frozen_string_literal: true module Puppet::Pops module Parser # This module is an integral part of the Lexer. # It handles scanning of EPP (Embedded Puppet), a form of string/expression interpolation similar to ERB. # require 'strscan' module EppSupport TOKEN_RENDER_STRING = [:RENDER_STRING, nil, 0] TOKEN_RENDER...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/parser/code_merger.rb
Ruby
apache-2.0
7,843
main
1,358
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/parser/parser_support.rb
Ruby
apache-2.0
7,843
main
8,491
# 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 ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/parser/lexer_support.rb
Ruby
apache-2.0
7,843
main
6,178
# frozen_string_literal: true module Puppet::Pops module Parser require_relative '../../../puppet/util/multi_match' # This is an integral part of the Lexer. It is broken out into a separate module # for maintainability of the code, and making the various parts of the lexer focused. # module LexerSupport # Returns "...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/parser/slurp_support.rb
Ruby
apache-2.0
7,843
main
4,622
# frozen_string_literal: true module Puppet::Pops module Parser # This module is an integral part of the Lexer. # It defines the string slurping behavior - finding the string and non string parts in interpolated # strings, translating escape sequences in strings to their single character equivalence. # # PERFORMANCE N...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/parser/eparser.rb
Ruby
apache-2.0
7,843
main
108,805
# # 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/parser/pn_parser.rb
Ruby
apache-2.0
7,843
main
6,738
# frozen_string_literal: true module Puppet::Pops module Parser class PNParser LIT_TRUE = 'true' LIT_FALSE = 'false' LIT_NIL = 'nil' TOKEN_END = 0 TOKEN_BOOL = 1 TOKEN_NIL = 2 TOKEN_INT = 3 TOKEN_FLOAT = 4 TOKEN_IDENTIFIER = 5 TOKEN_WS = 0x20 TOKEN_STRING = 0x22 TOKEN_KEY = 0x3a TOKEN_LP = 0...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/parser/lexer2.rb
Ruby
apache-2.0
7,843
main
27,525
# frozen_string_literal: true # The Lexer is responsible for turning source text into tokens. # This version is a performance enhanced lexer (in comparison to the 3.x and earlier "future parser" lexer. # # Old returns tokens [:KEY, value, { locator = } # Could return [[token], locator] # or Token.new([token], locator)...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/parser/interpolation_support.rb
Ruby
apache-2.0
7,843
main
8,418
# frozen_string_literal: true # This module is an integral part of the Lexer. # It defines interpolation support # PERFORMANCE NOTE: There are 4 very similar methods in this module that are designed to be as # performant as possible. While it is possible to parameterize them into one common method, the overhead # of p...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/parser/epp_parser.rb
Ruby
apache-2.0
7,843
main
1,654
# frozen_string_literal: true # The EppParser is a specialized Puppet Parser that starts parsing in Epp Text mode class Puppet::Pops::Parser::EppParser < Puppet::Pops::Parser::Parser # Initializes the epp parser support by creating a new instance of {Puppet::Pops::Parser::Lexer} # configured to start in Epp Lexing...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/parser/locatable.rb
Ruby
apache-2.0
7,843
main
507
# frozen_string_literal: true # Interface for something that is "locatable" (holds offset and length). class Puppet::Pops::Parser::Locatable # The offset in the locator's content def offset end # The length in the locator from the given offset def length end # This class is useful for testing class F...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/migration/migration_checker.rb
Ruby
apache-2.0
7,843
main
1,650
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/evaluator_impl.rb
Ruby
apache-2.0
7,843
main
46,248
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/external_syntax_support.rb
Ruby
apache-2.0
7,843
main
1,800
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/collector_transformer.rb
Ruby
apache-2.0
7,843
main
6,036
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/compare_operator.rb
Ruby
apache-2.0
7,843
main
6,962
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/runtime3_support.rb
Ruby
apache-2.0
7,843
main
26,114
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/json_strict_literal_evaluator.rb
Ruby
apache-2.0
7,843
main
1,671
# 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 # ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/literal_evaluator.rb
Ruby
apache-2.0
7,843
main
1,861
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/puppet_proc.rb
Ruby
apache-2.0
7,843
main
2,217
# 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 ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/deferred_resolver.rb
Ruby
apache-2.0
7,843
main
7,639
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/runtime3_converter.rb
Ruby
apache-2.0
7,843
main
7,820
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/epp_evaluator.rb
Ruby
apache-2.0
7,843
main
5,142
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/runtime3_resource_support.rb
Ruby
apache-2.0
7,843
main
4,296
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/access_operator.rb
Ruby
apache-2.0
7,843
main
26,390
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/closure.rb
Ruby
apache-2.0
7,843
main
12,439
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/relationship_operator.rb
Ruby
apache-2.0
7,843
main
7,555
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/callable_signature.rb
Ruby
apache-2.0
7,843
main
3,374
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/collectors/abstract_collector.rb
Ruby
apache-2.0
7,843
main
2,564
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/collectors/catalog_collector.rb
Ruby
apache-2.0
7,843
main
872
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/collectors/fixed_set_collector.rb
Ruby
apache-2.0
7,843
main
1,081
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/evaluator/collectors/exported_collector.rb
Ruby
apache-2.0
7,843
main
2,280
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/functions/dispatch.rb
Ruby
apache-2.0
7,843
main
3,672
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/functions/dispatcher.rb
Ruby
apache-2.0
7,843
main
2,454
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/functions/function.rb
Ruby
apache-2.0
7,843
main
5,594
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/model/pn_transformer.rb
Ruby
apache-2.0
7,843
main
10,542
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/model/ast_transformer.rb
Ruby
apache-2.0
7,843
main
4,292
# 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:...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/model/ast.rb
Ruby
apache-2.0
7,843
main
146,680
# 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', { ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/model/model_label_provider.rb
Ruby
apache-2.0
7,843
main
8,339
# 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 ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/model/factory.rb
Ruby
apache-2.0
7,843
main
33,766
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/model/model_tree_dumper.rb
Ruby
apache-2.0
7,843
main
10,636
# 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_...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/model/tree_dumper.rb
Ruby
apache-2.0
7,843
main
1,306
# 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...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/serialization/instance_writer.rb
Ruby
apache-2.0
7,843
main
513
# frozen_string_literal: true module Puppet::Pops module Serialization # An instance writer is responsible for writing complex objects using a {Serializer} # @api private module InstanceWriter # @param [Types::PObjectType] type the type of instance to write # @param [Object] value the instance # @par...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/serialization/abstract_reader.rb
Ruby
apache-2.0
7,843
main
4,910
# frozen_string_literal: true require_relative 'extension' require_relative 'time_factory' module Puppet::Pops module Serialization # Abstract class for protocol specific readers such as MsgPack or JSON # The abstract reader is capable of reading the primitive scalars: # - Boolean # - Integer # - Float # - String # a...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/serialization/deserializer.rb
Ruby
apache-2.0
7,843
main
2,783
# frozen_string_literal: true require_relative 'extension' module Puppet::Pops module Serialization # The deserializer is capable of reading, arrays, maps, and complex objects using an underlying protocol reader. It takes care of # resolving tabulations and assembling complex objects. The type of the complex obje...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/serialization/time_factory.rb
Ruby
apache-2.0
7,843
main
1,834
# frozen_string_literal: true module Puppet::Pops module Serialization # Implements all the constructors found in the Time class and ensures that # the created Time object can be serialized and deserialized using its # seconds and nanoseconds without loss of precision. # # @deprecated No longer in use. Funct...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/serialization/json.rb
Ruby
apache-2.0
7,843
main
6,347
# frozen_string_literal: true require_relative '../../../puppet/util/json' module Puppet::Pops module Serialization require_relative 'time_factory' require_relative 'abstract_reader' require_relative 'abstract_writer' module JSON # A Writer that writes output in JSON format # @api private class Writer < Abstra...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/serialization/to_stringified_converter.rb
Ruby
apache-2.0
7,843
main
7,817
# frozen_string_literal: true module Puppet::Pops module Serialization # Class that can process an arbitrary object into a value that is assignable to `Data` # and where contents is converted from rich data to one of: # * Numeric (Integer, Float) # * Boolean # * Undef (nil) # * String # * Array # * Has...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/serialization/instance_reader.rb
Ruby
apache-2.0
7,843
main
1,007
# frozen_string_literal: true module Puppet::Pops module Serialization # An InstanceReader is responsible for reading an instance of a complex object using a deserializer. The read involves creating the # instance, register it with the deserializer (so that self references can be resolved) and then read the instan...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/serialization/serializer.rb
Ruby
apache-2.0
7,843
main
4,718
# frozen_string_literal: true require_relative 'extension' module Puppet::Pops module Serialization # The serializer is capable of writing, arrays, maps, and complex objects using an underlying protocol writer. It takes care of # tabulating and disassembling complex objects. # @api public class Serializer ...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/serialization/json_path.rb
Ruby
apache-2.0
7,843
main
3,628
# frozen_string_literal: true require_relative '../../../puppet/concurrent/thread_local_singleton' module Puppet::Pops module Serialization module JsonPath # Creates a _json_path_ reference from the given `path` argument # # @path path [Array<Integer,String>] An array of integers and strings # @return [String...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/serialization/abstract_writer.rb
Ruby
apache-2.0
7,843
main
6,287
# frozen_string_literal: true require_relative 'extension' module Puppet::Pops module Serialization MAX_INTEGER = 0x7fffffffffffffff MIN_INTEGER = -0x8000000000000000 # Abstract class for protocol specific writers such as MsgPack or JSON # The abstract write is capable of writing the primitive scalars: # - Boolean #...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/serialization/from_data_converter.rb
Ruby
apache-2.0
7,843
main
6,885
# frozen_string_literal: true module Puppet::Pops module Serialization class Builder def initialize(values) @values = values @resolved = true end def [](key) @values[key] end def []=(key, value) @values[key] = value @resolved = false if value.is_a?(Builder) end...
github
puppetlabs/puppet
https://github.com/puppetlabs/puppet
lib/puppet/pops/serialization/object.rb
Ruby
apache-2.0
7,843
main
2,373
# frozen_string_literal: true require_relative 'instance_reader' require_relative 'instance_writer' module Puppet::Pops module Serialization # Instance reader for objects that implement {Types::PuppetObject} # @api private class ObjectReader include InstanceReader def read(type, impl_class, value_count, deserial...