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
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/file.rb
lib/puppet/parser/functions/file.rb
# frozen_string_literal: true require_relative '../../../puppet/file_system' Puppet::Parser::Functions.newfunction( :file, :arity => -2, :type => :rvalue, :doc => "Loads a file from a module and returns its contents as a string. The argument to this function should be a `<MODULE NAME>/<FILE>` referenc...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/realize.rb
lib/puppet/parser/functions/realize.rb
# frozen_string_literal: true # This is just syntactic sugar for a collection, although it will generally # be a good bit faster. Puppet::Parser::Functions.newfunction(:realize, :arity => -2, :doc => "Make a virtual object real. This is useful when you want to know the name of the virtual object and don't want t...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/tagged.rb
lib/puppet/parser/functions/tagged.rb
# frozen_string_literal: true # Test whether a given tag is set. This functions as a big OR -- if any of the specified tags are unset, we return false. Puppet::Parser::Functions.newfunction(:tagged, :type => :rvalue, :arity => -2, :doc => "A boolean function that tells you whether the current container is tagged wi...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/hiera.rb
lib/puppet/parser/functions/hiera.rb
# frozen_string_literal: true require 'hiera_puppet' module Puppet::Parser::Functions newfunction( :hiera, :type => :rvalue, :arity => -2, :doc => <<~DOC Performs a standard priority lookup of the hierarchy and returns the most specific value for a given key. The returned value can be an...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/step.rb
lib/puppet/parser/functions/step.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :step, :type => :rvalue, :arity => -1, :doc => <<~DOC Provides stepping with given interval over elements in an iterable and optionally runs a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) for each element. ...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/md5.rb
lib/puppet/parser/functions/md5.rb
# frozen_string_literal: true require 'digest/md5' Puppet::Parser::Functions.newfunction(:md5, :type => :rvalue, :arity => 1, :doc => "Returns a MD5 hash value from a provided string.") do |args| Digest::MD5.hexdigest(args[0]) end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/epp.rb
lib/puppet/parser/functions/epp.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction(:epp, :type => :rvalue, :arity => -2, :doc => "Evaluates an Embedded Puppet (EPP) template file and returns the rendered text result as a String. `epp('<MODULE NAME>/<TEMPLATE FILE>', <PARAMETER HASH>)` The first argument to this function should be ...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/defined.rb
lib/puppet/parser/functions/defined.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :defined, :type => :rvalue, :arity => -2, :doc => <<~DOC Determines whether a given class or resource type is defined and returns a Boolean value. You can also use `defined` to determine whether a specific resource is defined, or ...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/contain.rb
lib/puppet/parser/functions/contain.rb
# frozen_string_literal: true # Called within a class definition, establishes a containment # relationship with another class Puppet::Parser::Functions.newfunction( :contain, :arity => -2, :doc => "Contain one or more classes inside the current class. If any of these classes are undeclared, they will be declare...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/sprintf.rb
lib/puppet/parser/functions/sprintf.rb
# frozen_string_literal: true # Copyright (C) 2009 Thomas Bellman # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, cop...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/strftime.rb
lib/puppet/parser/functions/strftime.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :strftime, :type => :rvalue, :arity => -3, :doc => <<~DOC Formats timestamp or timespan according to the directives in the given format string. The directives begins with a percent (%) character. Any text not listed as a directive wil...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/sha1.rb
lib/puppet/parser/functions/sha1.rb
# frozen_string_literal: true require 'digest/sha1' Puppet::Parser::Functions.newfunction(:sha1, :type => :rvalue, :arity => 1, :doc => "Returns a SHA1 hash value from a provided string.") do |args| Digest::SHA1.hexdigest(args[0]) end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/match.rb
lib/puppet/parser/functions/match.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :match, :arity => 2, :doc => <<~DOC Matches a regular expression against a string and returns an array containing the match and any matched capturing groups. The first argument is a string or array of strings. The second argument i...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/lest.rb
lib/puppet/parser/functions/lest.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :lest, :type => :rvalue, :arity => -2, :doc => <<~DOC Call a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) (which should accept no arguments) if the argument given to the function is `undef`. Returns the result...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/template.rb
lib/puppet/parser/functions/template.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction(:template, :type => :rvalue, :arity => -2, :doc => "Loads an ERB template from a module, evaluates it, and returns the resulting value as a string. The argument to this function should be a `<MODULE NAME>/<TEMPLATE FILE>` reference, which wil...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/require.rb
lib/puppet/parser/functions/require.rb
# frozen_string_literal: true # Requires the specified classes Puppet::Parser::Functions.newfunction( :require, :arity => -2, :doc => "Evaluate one or more classes, adding the required class as a dependency. The relationship metaparameters work well for specifying relationships between individual resources, b...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/assert_type.rb
lib/puppet/parser/functions/assert_type.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :assert_type, :type => :rvalue, :arity => -3, :doc => <<~DOC Returns the given value if it is of the given [data type](https://puppet.com/docs/puppet/latest/lang_data.html), or otherwise either raises an error or executes an optio...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/next.rb
lib/puppet/parser/functions/next.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :next, :arity => -2, :doc => <<~DOC Immediately returns the given optional value from a block (lambda), function, class body or user defined type body. If a value is not given, an `undef` value is returned. This function does not return...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/fail.rb
lib/puppet/parser/functions/fail.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :fail, :arity => -1, :doc => <<~DOC Fail with a parse error. Any parameters will be stringified, concatenated, and passed to the exception-handler. DOC ) do |vals| vals = vals.collect(&:to_s).join(" ") if vals.is_a? Array raise Pu...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/create_resources.rb
lib/puppet/parser/functions/create_resources.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction(:create_resources, :arity => -3, :doc => <<-'ENDHEREDOC') do |args| Converts a hash into a set of resources and adds them to the catalog. **Note**: Use this function selectively. It's generally better to write resources in [Puppet](https...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/split.rb
lib/puppet/parser/functions/split.rb
# frozen_string_literal: true module Puppet::Parser::Functions newfunction( :split, :type => :rvalue, :arity => 2, :doc => "\ Split a string variable into an array using the specified split regexp. *Example:* $string = 'v1.v2:v3.v4' $array_var1 = split($string, ':') $ar...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/scanf.rb
lib/puppet/parser/functions/scanf.rb
# frozen_string_literal: true require 'scanf' Puppet::Parser::Functions.newfunction( :scanf, :type => :rvalue, :arity => 2, :doc => <<~DOC Scans a string and returns an array of one or more converted values based on the given format string. See the documentation of Ruby's String#scanf method for detai...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/map.rb
lib/puppet/parser/functions/map.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :map, :type => :rvalue, :arity => -3, :doc => <<~DOC Applies a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) to every value in a data structure and returns an array containing the results. This function takes ...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/inline_template.rb
lib/puppet/parser/functions/inline_template.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction(:inline_template, :type => :rvalue, :arity => -2, :doc => "Evaluate a template string and return its value. See [the templating docs](https://puppet.com/docs/puppet/latest/lang_template.html) for more information. Note that if multiple template...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/return.rb
lib/puppet/parser/functions/return.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :return, :arity => -2, :doc => <<~DOC Immediately returns the given optional value from a function, class body or user defined type body. If a value is not given, an `undef` value is returned. This function does not return to the immedi...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/each.rb
lib/puppet/parser/functions/each.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :each, :type => :rvalue, :arity => -3, :doc => <<~DOC Runs a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) repeatedly using each value in a data structure, then returns the values unchanged. This function take...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/lookup.rb
lib/puppet/parser/functions/lookup.rb
# frozen_string_literal: true module Puppet::Parser::Functions newfunction(:lookup, :type => :rvalue, :arity => -2, :doc => <<~'ENDHEREDOC') do |_args| Uses the Puppet lookup system to retrieve a value for a given key. By default, this returns the first value found (and fails compilation if no values are ...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/versioncmp.rb
lib/puppet/parser/functions/versioncmp.rb
# frozen_string_literal: true require_relative '../../../puppet/util/package' Puppet::Parser::Functions.newfunction(:versioncmp, :type => :rvalue, :arity => 2, :doc => "Compares two version numbers. Prototype: \$result = versioncmp(a, b) Where a and b are arbitrary version strings. This function returns: * `...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/inline_epp.rb
lib/puppet/parser/functions/inline_epp.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction(:inline_epp, :type => :rvalue, :arity => -2, :doc => "Evaluates an Embedded Puppet (EPP) template string and returns the rendered text result as a String. `inline_epp('<EPP TEMPLATE STRING>', <PARAMETER HASH>)` The first argument to this function sh...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/regsubst.rb
lib/puppet/parser/functions/regsubst.rb
# frozen_string_literal: true # Copyright (C) 2009 Thomas Bellman # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, cop...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/break.rb
lib/puppet/parser/functions/break.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :break, :arity => 0, :doc => <<~DOC Breaks the innermost iteration as if it encountered an end of input. This function does not return to the caller. The signal produced to stop the iteration bubbles up through the call stack u...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/dig.rb
lib/puppet/parser/functions/dig.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :dig, :type => :rvalue, :arity => -1, :doc => <<~DOC Returns a value for a sequence of given keys/indexes into a structure, such as an array or hash. This function is used to "dig into" a complex data structure by using a sequ...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/then.rb
lib/puppet/parser/functions/then.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :then, :type => :rvalue, :arity => -2, :doc => <<~DOC Call a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) with the given argument unless the argument is undef. Return `undef` if argument is `undef`, and otherw...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/reverse_each.rb
lib/puppet/parser/functions/reverse_each.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :reverse_each, :type => :rvalue, :arity => -1, :doc => <<~DOC Reverses the order of the elements of something that is iterable and optionally runs a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) for each elemen...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/with.rb
lib/puppet/parser/functions/with.rb
# frozen_string_literal: true Puppet::Parser::Functions.newfunction( :with, :type => :rvalue, :arity => -1, :doc => <<~DOC Call a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) with the given arguments and return the result. Since a lambda's scope is local to the lambda, you can ...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/functions/sha256.rb
lib/puppet/parser/functions/sha256.rb
# frozen_string_literal: true require 'digest/sha2' Puppet::Parser::Functions.newfunction(:sha256, :type => :rvalue, :arity => 1, :doc => "Returns a SHA256 hash value from a provided string.") do |args| Digest::SHA256.hexdigest(args[0]) end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/ast/resource.rb
lib/puppet/parser/ast/resource.rb
# frozen_string_literal: true # Instruction for Resource instantiation. # Instantiates resources of both native and user defined types. # class Puppet::Parser::AST::Resource < Puppet::Parser::AST::Branch attr_accessor :type, :instances, :exported, :virtual def initialize(argshash) Puppet.warn_once('deprecatio...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/ast/resourceparam.rb
lib/puppet/parser/ast/resourceparam.rb
# frozen_string_literal: true # The AST object for the parameters inside resource expressions # class Puppet::Parser::AST::ResourceParam < Puppet::Parser::AST::Branch attr_accessor :value, :param, :add def initialize(argshash) Puppet.warn_once('deprecations', 'AST::ResourceParam', _('Use of Puppet::Parser::AS...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/ast/node.rb
lib/puppet/parser/ast/node.rb
# frozen_string_literal: true class Puppet::Parser::AST::Node < Puppet::Parser::AST::TopLevelConstruct attr_accessor :names, :context def initialize(names, context = {}) raise ArgumentError, _("names should be an array") unless names.is_a? Array if context[:parent] raise Puppet::DevError, _("Node in...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/ast/block_expression.rb
lib/puppet/parser/ast/block_expression.rb
# frozen_string_literal: true # Evaluates contained expressions, produce result of the last # class Puppet::Parser::AST::BlockExpression < Puppet::Parser::AST::Branch def evaluate(scope) @children.reduce(nil) { |_, child| child.safeevaluate(scope) } end def sequence_with(other) Puppet::Parser::AST::Bloc...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/ast/resource_instance.rb
lib/puppet/parser/ast/resource_instance.rb
# frozen_string_literal: true # A simple container for a parameter for an object. Consists of a # title and a set of parameters. # class Puppet::Parser::AST::ResourceInstance < Puppet::Parser::AST::Branch attr_accessor :title, :parameters def initialize(argshash) Puppet.warn_once('deprecations', 'AST::Resour...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/ast/pops_bridge.rb
lib/puppet/parser/ast/pops_bridge.rb
# frozen_string_literal: true require_relative '../../../puppet/parser/ast/top_level_construct' require_relative '../../../puppet/pops' # The AST::Bridge contains classes that bridges between the new Pops based model # and the 3.x AST. This is required to be able to reuse the Puppet::Resource::Type which is # fundame...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/ast/leaf.rb
lib/puppet/parser/ast/leaf.rb
# frozen_string_literal: true # The base class for all of the leaves of the parse trees. These # basically just have types and values. Both of these parameters # are simple values, not AST objects. # class Puppet::Parser::AST::Leaf < Puppet::Parser::AST attr_accessor :value, :type # Return our value. def eval...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/ast/top_level_construct.rb
lib/puppet/parser/ast/top_level_construct.rb
# frozen_string_literal: true # The base class for AST nodes representing top level things: # hostclasses, definitions, and nodes. class Puppet::Parser::AST::TopLevelConstruct < Puppet::Parser::AST end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/ast/hostclass.rb
lib/puppet/parser/ast/hostclass.rb
# frozen_string_literal: true require_relative '../../../puppet/parser/ast/top_level_construct' class Puppet::Parser::AST::Hostclass < Puppet::Parser::AST::TopLevelConstruct attr_accessor :name, :context def initialize(name, context = {}) @context = context @name = name end def instantiate(modname) ...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/ast/branch.rb
lib/puppet/parser/ast/branch.rb
# frozen_string_literal: true # The parent class of all AST objects that contain other AST objects. # Everything but the really simple objects descend from this. It is # important to note that Branch objects contain other AST objects only -- # if you want to contain values, use a descendant of the AST::Leaf class. # ...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/compiler/catalog_validator.rb
lib/puppet/parser/compiler/catalog_validator.rb
# frozen_string_literal: true # Abstract class for a catalog validator that can be registered with the compiler to run at # a certain stage. class Puppet::Parser::Compiler class CatalogValidator PRE_FINISH = :pre_finish FINAL = :final # Returns true if the validator should run at the given stage. The de...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/parser/compiler/catalog_validator/relationship_validator.rb
lib/puppet/parser/compiler/catalog_validator/relationship_validator.rb
# frozen_string_literal: true class Puppet::Parser::Compiler # Validator that asserts relationship metaparameters refer to valid resources class CatalogValidator::RelationshipValidator < CatalogValidator def validate catalog.resources.each do |resource| next unless resource.is_a?(Puppet::Parser::...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/context/trusted_information.rb
lib/puppet/context/trusted_information.rb
# frozen_string_literal: true require_relative '../../puppet/trusted_external' # @api private class Puppet::Context::TrustedInformation # one of 'remote', 'local', or false, where 'remote' is authenticated via cert, # 'local' is trusted by virtue of running on the same machine (not a remote # request), and fals...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/session.rb
lib/puppet/http/session.rb
# frozen_string_literal: true # The session is the mechanism by which services may be connected to and accessed. # # @api public class Puppet::HTTP::Session # capabilities for a site CAP_LOCALES = 'locales' CAP_JSON = 'json' # puppet version where locales mount was added SUPPORTED_LOCALES_MOUNT_AGENT_VERSIO...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/errors.rb
lib/puppet/http/errors.rb
# frozen_string_literal: true module Puppet::HTTP # A base class for puppet http errors # @api public class HTTPError < Puppet::Error; end # A connection error such as if the server refuses the connection. # @api public class ConnectionError < HTTPError; end # A failure to route to the server such as i...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/pool.rb
lib/puppet/http/pool.rb
# frozen_string_literal: true # A pool for persistent `Net::HTTP` connections. Connections are # stored in the pool indexed by their {Site}. # Connections are borrowed from the pool, yielded to the caller, and # released back into the pool. If a connection is expired, it will be # closed either when a connection to th...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/response_converter.rb
lib/puppet/http/response_converter.rb
# frozen_string_literal: true module Puppet::HTTP::ResponseConverter module_function # Borrowed from puppetserver, see https://github.com/puppetlabs/puppetserver/commit/a1ebeaaa5af590003ccd23c89f808ba4f0c89609 def to_ruby_response(response) str_code = response.code.to_s # Copied from Net::HTTPResponse ...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/proxy.rb
lib/puppet/http/proxy.rb
# frozen_string_literal: true require 'uri' require_relative '../../puppet/ssl/openssl_loader' module Puppet::HTTP::Proxy def self.proxy(uri) if http_proxy_host && !no_proxy?(uri) Net::HTTP.new(uri.host, uri.port, http_proxy_host, http_proxy_port, http_proxy_user, http_proxy_password) else http ...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/response.rb
lib/puppet/http/response.rb
# frozen_string_literal: true # Represents the response returned from the server from an HTTP request. # # @api abstract # @api public class Puppet::HTTP::Response # @return [URI] the response url attr_reader :url # Create a response associated with the URL. # # @param [URI] url # @param [Integer] HTTP st...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/pool_entry.rb
lib/puppet/http/pool_entry.rb
# frozen_string_literal: true # An entry in the peristent HTTP pool that references the connection and # an expiration time for the connection. # # @api private class Puppet::HTTP::PoolEntry attr_reader :connection, :verifier def initialize(connection, verifier, expiration_time) @connection = connection @...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/response_net_http.rb
lib/puppet/http/response_net_http.rb
# frozen_string_literal: true # Adapts Net::HTTPResponse to Puppet::HTTP::Response # # @api public class Puppet::HTTP::ResponseNetHTTP < Puppet::HTTP::Response # Create a response associated with the URL. # # @param [URI] url # @param [Net::HTTPResponse] nethttp The response def initialize(url, nethttp) ...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/resolver.rb
lib/puppet/http/resolver.rb
# frozen_string_literal: true # Resolver base class. Each resolver represents a different strategy for # resolving a service name into a list of candidate servers and ports. # # @abstract Subclass and override {#resolve} to create a new resolver. # @api public class Puppet::HTTP::Resolver # # Create a new resolver...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/dns.rb
lib/puppet/http/dns.rb
# frozen_string_literal: true require 'resolv' module Puppet::HTTP class DNS class CacheEntry attr_reader :records, :ttl, :resolution_time def initialize(records) @records = records @resolution_time = Time.now @ttl = choose_lowest_ttl(records) end def choose_low...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/client.rb
lib/puppet/http/client.rb
# frozen_string_literal: true # The HTTP client provides methods for making `GET`, `POST`, etc requests to # HTTP(S) servers. It also provides methods for resolving Puppetserver REST # service endpoints using SRV records and settings (such as `server_list`, # `server`, `ca_server`, etc). Once a service endpoint has be...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/external_client.rb
lib/puppet/http/external_client.rb
# frozen_string_literal: true # Adapts an external http_client_class to the HTTP client API. The former # is typically registered by puppetserver and only implements a subset of # the Puppet::Network::HTTP::Connection methods. As a result, only the # `get` and `post` methods are supported. Calling `delete`, etc will #...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/factory.rb
lib/puppet/http/factory.rb
# frozen_string_literal: true require_relative '../../puppet/ssl/openssl_loader' require 'net/http' require_relative '../../puppet/http' # Factory for `Net::HTTP` objects. # # Encapsulates the logic for creating a `Net::HTTP` object based on the # specified {Site} and puppet settings. # # @api private class Puppet::H...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/service.rb
lib/puppet/http/service.rb
# frozen_string_literal: true # Represents an abstract Puppet web service. # # @abstract Subclass and implement methods for the service's REST APIs. # @api public class Puppet::HTTP::Service # @return [URI] the url associated with this service attr_reader :url # @return [Array<Symbol>] available services SERV...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/redirector.rb
lib/puppet/http/redirector.rb
# frozen_string_literal: true # Handle HTTP redirects # # @api private class Puppet::HTTP::Redirector # Create a new redirect handler # # @param [Integer] redirect_limit maximum number of redirects allowed # # @api private def initialize(redirect_limit) @redirect_limit = redirect_limit end # Deter...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/retry_after_handler.rb
lib/puppet/http/retry_after_handler.rb
# frozen_string_literal: true require 'date' require 'time' # Parse information relating to responses containing a Retry-After headers # # @api private class Puppet::HTTP::RetryAfterHandler # Create a handler to allow the system to sleep between HTTP requests # # @param [Integer] retry_limit number of retries a...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/site.rb
lib/puppet/http/site.rb
# frozen_string_literal: true # Represents a site to which HTTP connections are made. It is a value # object, and is suitable for use in a hash. If two sites are equal, # then a persistent connection made to the first site, can be re-used # for the second. # # @api private class Puppet::HTTP::Site attr_reader :schem...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/service/report.rb
lib/puppet/http/service/report.rb
# frozen_string_literal: true # The Report service is used to submit run reports to the report server. # # @api public # class Puppet::HTTP::Service::Report < Puppet::HTTP::Service # @return [String] Default API for the report service API = '/puppet/v3' # Use `Puppet::HTTP::Session.route_to(:report)` to create ...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/service/compiler.rb
lib/puppet/http/service/compiler.rb
# frozen_string_literal: true # The Compiler service is used to submit and retrieve data from the # puppetserver. # # @api public class Puppet::HTTP::Service::Compiler < Puppet::HTTP::Service # @return [String] Default API for the Compiler service API = '/puppet/v3' # Use `Puppet::HTTP::Session.route_to(:puppet...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/service/ca.rb
lib/puppet/http/service/ca.rb
# frozen_string_literal: true # The CA service is used to handle certificate related REST requests. # # @api public class Puppet::HTTP::Service::Ca < Puppet::HTTP::Service # @return [Hash] default headers for the ca service HEADERS = { 'Accept' => 'text/plain' }.freeze # @return [String] default API for the ca ...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/service/puppetserver.rb
lib/puppet/http/service/puppetserver.rb
# frozen_string_literal: true # The puppetserver service. # # @api public # class Puppet::HTTP::Service::Puppetserver < Puppet::HTTP::Service # Use `Puppet::HTTP::Session.route_to(:puppetserver)` to create or get an instance of this class. # # @param [Puppet::HTTP::Client] client # @param [Puppet::HTTP::Sessio...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/service/file_server.rb
lib/puppet/http/service/file_server.rb
# frozen_string_literal: true require_relative '../../../puppet/file_serving/metadata' # The FileServer service is used to retrieve file metadata and content. # # @api public # class Puppet::HTTP::Service::FileServer < Puppet::HTTP::Service # @return [String] Default API for the FileServer service API = '/puppet/...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/resolver/srv.rb
lib/puppet/http/resolver/srv.rb
# frozen_string_literal: true # Resolve a service using DNS SRV records. # # @api public class Puppet::HTTP::Resolver::SRV < Puppet::HTTP::Resolver # Create an DNS SRV resolver. # # @param [Puppet::HTTP::Client] client # @param [String] domain srv domain # @param [Resolv::DNS] dns # def initialize(client...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/resolver/settings.rb
lib/puppet/http/resolver/settings.rb
# frozen_string_literal: true # Resolve a service using settings. This is the default resolver if none of the # other resolvers find a functional connection. # # @api public class Puppet::HTTP::Resolver::Settings < Puppet::HTTP::Resolver # Resolve a service using the default server and port settings for this service...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/lib/puppet/http/resolver/server_list.rb
lib/puppet/http/resolver/server_list.rb
# frozen_string_literal: true # Use the server_list setting to resolve a service. This resolver is only used # if server_list is set either on the command line or in the configuration file. # # @api public class Puppet::HTTP::Resolver::ServerList < Puppet::HTTP::Resolver # Create a server list resolver. # # @par...
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/test/database_load_spec.rb
test/database_load_spec.rb
require File.expand_path(File.dirname(__FILE__) + "/spec_helper") require 'ledger_web/db' require 'ledger_web/config' require 'csv' describe LedgerWeb::Database do describe "#dump_ledger_to_csv" do it "should not die" do set_config :ledger_file, fixture('small') file = LedgerWeb::Database.dump_ledger...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/test/report_spec.rb
test/report_spec.rb
require File.expand_path(File.dirname(__FILE__) + "/spec_helper") require 'ledger_web/report' require 'ledger_web/helpers' describe LedgerWeb::Report do describe "#from_query" do let(:helpers) { TestHelper.new } it "should run the query" do LedgerWeb::Report.session = {:from => '2012/01/01', :to => '2...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/test/config_spec.rb
test/config_spec.rb
require File.expand_path(File.dirname(__FILE__) + "/spec_helper") require 'ledger_web/config' describe LedgerWeb::Config do describe "#initialize" do it "should get and set simple values" do conf = LedgerWeb::Config.new do |config| config.set :key_one, "value one" config.set :key_two, "val...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/test/spec_helper.rb
test/spec_helper.rb
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) require 'rspec' require 'ledger_web/config' require 'ledger_web/db' require 'ledger_web/report' require 'ledger_web/helpers' require 'database_cleaner' RSpec.configure do |config| config.before(:suite) do system 'createdb ledger-test' LedgerWeb::C...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web.rb
lib/ledger_web.rb
libdir = File.dirname(__FILE__) $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir) require 'ledger_web/price_lookup' require 'ledger_web/config' require 'ledger_web/db' require 'ledger_web/report' require 'ledger_web/table' require 'ledger_web/decorators' require 'ledger_web/watcher' require 'ledger_web/hel...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web/report.rb
lib/ledger_web/report.rb
module LedgerWeb class Cell attr_reader :title, :value, :style attr_accessor :text, :align def initialize(title, value) @title = title @value = value @style = {} @text = value @align = 'left' end end class Report attr_accessor :error, :fields, :rows @@ses...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web/price_lookup.rb
lib/ledger_web/price_lookup.rb
require 'csv' require 'uri' require 'net/http' module LedgerWeb class YahooPriceLookup def initialize(symbol, min_date, max_date) @symbol = symbol.gsub(/"/,'') @min_date = min_date @max_date = max_date end def lookup params = { 'a' => @min_date.month - 1, 'b' => @...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web/table.rb
lib/ledger_web/table.rb
module LedgerWeb class Table attr_reader :attributes, :hidden def initialize(report) @report = report @decorators = [] @attributes = {} @hidden = [] yield self if block_given? end def decorate decorator @decorators << decorator end def hide regexp ...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web/watcher.rb
lib/ledger_web/watcher.rb
require 'directory_watcher' module LedgerWeb class Watcher def self.run! directory = LedgerWeb::Config.instance.get :watch_directory glob = "*" if directory.nil? directory = File.dirname(LedgerWeb::Config.instance.get :ledger_file) glob = File.basename(LedgerWeb::Config.instanc...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web/version.rb
lib/ledger_web/version.rb
module LedgerWeb VERSION = '1.5.2' end
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web/db.rb
lib/ledger_web/db.rb
require 'sequel' require 'sequel/extensions/migration' require 'csv' require 'tempfile' module LedgerWeb class Database def self.connect @@db = Sequel.connect(LedgerWeb::Config.instance.get(:database_url)) self.run_migrations() end def self.close @@db.disconnect end def self....
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web/helpers.rb
lib/ledger_web/helpers.rb
require 'rack/utils' require 'time' require 'cgi' module LedgerWeb module Helpers include Rack::Utils def partial (template, locals = {}) erb(template, :layout => false, :locals => locals) end def table(report, options = {}) Table.new(report) do |t| t.decorate :all => LedgerWeb...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web/app.rb
lib/ledger_web/app.rb
require 'rubygems' require 'sinatra/base' require 'sinatra/contrib' require 'sinatra/session' require 'docverter' module LedgerWeb class Application < Sinatra::Base register Sinatra::Session set :session_secret, LedgerWeb::Config.instance.get(:session_secret) set :session_expire, LedgerWeb::Config.insta...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web/config.rb
lib/ledger_web/config.rb
module LedgerWeb class Config attr_reader :vars, :hooks @@should_load_user_config = true @@instance = nil def self.should_load_user_config @@should_load_user_config end def self.should_load_user_config=(val) @@should_load_user_config = val end def initialize @var...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web/decorators.rb
lib/ledger_web/decorators.rb
require 'cgi' module LedgerWeb::Decorators class NumberDecorator def initialize(precision=2) @precision = precision end def decorate(cell, row) if cell.value.is_a?(Numeric) cell.align = 'right' raw_number = sprintf("%0.#{@precision}f", cell.value) number_with_commas =...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web/db/migrate/20120105185800_add_prices_table.rb
lib/ledger_web/db/migrate/20120105185800_add_prices_table.rb
Sequel.migration do change do create_table(:prices) do Date :price_date String :commodity, :text => true BigDecimal :price index [:price_date] index [:commodity] index [:price_date, :commodity] end end end
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web/db/migrate/20111226180900_initial_schema.rb
lib/ledger_web/db/migrate/20111226180900_initial_schema.rb
Sequel.migration do up do create_table(:ledger, :ignore_index_errors=>true) do Date :xtn_date String :checknum, :text=>true String :note, :text=>true String :account, :text=>true String :commodity, :text=>true BigDecimal :amount String :tags, :text=>true Date :xtn_m...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web/db/migrate/20111231132900_add_views.rb
lib/ledger_web/db/migrate/20111231132900_add_views.rb
Sequel.migration do change do create_or_replace_view(:accounts_days, <<HERE) with _a as (select account from ledger group by account), _d as (select xtn_date from ledger group by xtn_date) select account, xtn_date from _a cross join _d HERE create_or_replac...
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
peterkeen/ledger-web
https://github.com/peterkeen/ledger-web/blob/ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60/lib/ledger_web/db/migrate/20120104192400_add_cost_column.rb
lib/ledger_web/db/migrate/20120104192400_add_cost_column.rb
Sequel.migration do change do alter_table :ledger do add_column :cost, BigDecimal end end end
ruby
MIT
ceb3cf0f1e4ae982b1d8048b8a6cf0c665744d60
2026-01-04T17:57:14.860475Z
false
coorasse/passkit
https://github.com/coorasse/passkit/blob/83c9c8ddcf6a7c8b1aa6a971f9c0dc02aef8323f/app/controllers/passkit/api/v1/passes_controller.rb
app/controllers/passkit/api/v1/passes_controller.rb
module Passkit module Api module V1 class PassesController < ActionController::API before_action :decrypt_payload, only: :create def create set_generator if @generator && @payload[:collection_name].present? files = @generator.public_send(@payload[:collection...
ruby
MIT
83c9c8ddcf6a7c8b1aa6a971f9c0dc02aef8323f
2026-01-04T17:57:15.346461Z
false
coorasse/passkit
https://github.com/coorasse/passkit/blob/83c9c8ddcf6a7c8b1aa6a971f9c0dc02aef8323f/app/controllers/passkit/api/v1/logs_controller.rb
app/controllers/passkit/api/v1/logs_controller.rb
module Passkit module Api module V1 class LogsController < ActionController::API def create params[:logs].each do |message| Log.create!(content: message) end render json: {}, status: :ok end end end end end
ruby
MIT
83c9c8ddcf6a7c8b1aa6a971f9c0dc02aef8323f
2026-01-04T17:57:15.346461Z
false
coorasse/passkit
https://github.com/coorasse/passkit/blob/83c9c8ddcf6a7c8b1aa6a971f9c0dc02aef8323f/app/controllers/passkit/api/v1/registrations_controller.rb
app/controllers/passkit/api/v1/registrations_controller.rb
module Passkit module Api module V1 # TODO: check with authentication_token # This Class Implements the Apple PassKit API # @see Apple: https://developer.apple.com/library/archive/documentation/PassKit/Reference/PassKit_WebService/WebService.html # @see Android: https://walletpasses.io/dev...
ruby
MIT
83c9c8ddcf6a7c8b1aa6a971f9c0dc02aef8323f
2026-01-04T17:57:15.346461Z
false
coorasse/passkit
https://github.com/coorasse/passkit/blob/83c9c8ddcf6a7c8b1aa6a971f9c0dc02aef8323f/app/controllers/passkit/dashboard/passes_controller.rb
app/controllers/passkit/dashboard/passes_controller.rb
module Passkit module Dashboard class PassesController < ApplicationController def index @passes = Passkit::Pass.order(created_at: :desc).includes(:devices).first(100) end end end end
ruby
MIT
83c9c8ddcf6a7c8b1aa6a971f9c0dc02aef8323f
2026-01-04T17:57:15.346461Z
false
coorasse/passkit
https://github.com/coorasse/passkit/blob/83c9c8ddcf6a7c8b1aa6a971f9c0dc02aef8323f/app/controllers/passkit/dashboard/logs_controller.rb
app/controllers/passkit/dashboard/logs_controller.rb
module Passkit module Dashboard class LogsController < ApplicationController def index @logs = Passkit::Log.order(created_at: :desc).first(100) end end end end
ruby
MIT
83c9c8ddcf6a7c8b1aa6a971f9c0dc02aef8323f
2026-01-04T17:57:15.346461Z
false
coorasse/passkit
https://github.com/coorasse/passkit/blob/83c9c8ddcf6a7c8b1aa6a971f9c0dc02aef8323f/app/controllers/passkit/dashboard/previews_controller.rb
app/controllers/passkit/dashboard/previews_controller.rb
module Passkit module Dashboard class PreviewsController < ApplicationController def index end def show builder = Passkit.configuration.available_passes[params[:class_name]] path = Factory.create_pass(params[:class_name].constantize, builder.call) send_file path, type: ...
ruby
MIT
83c9c8ddcf6a7c8b1aa6a971f9c0dc02aef8323f
2026-01-04T17:57:15.346461Z
false
coorasse/passkit
https://github.com/coorasse/passkit/blob/83c9c8ddcf6a7c8b1aa6a971f9c0dc02aef8323f/app/controllers/passkit/dashboard/application_controller.rb
app/controllers/passkit/dashboard/application_controller.rb
module Passkit module Dashboard class ApplicationController < ActionController::Base layout "passkit/application" before_action :_authenticate_dashboard! private def _authenticate_dashboard! instance_eval(&Passkit.configuration.authenticate_dashboard_with) end end en...
ruby
MIT
83c9c8ddcf6a7c8b1aa6a971f9c0dc02aef8323f
2026-01-04T17:57:15.346461Z
false