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 |
|---|---|---|---|---|---|---|---|---|
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/test/test_base.rb | test/test_base.rb | # frozen_string_literal: true
require 'helper'
module Cri
class BaseTestCase < Cri::TestCase
def test_stub; end
end
end
| ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/test/test_argument_list.rb | test/test_argument_list.rb | # frozen_string_literal: true
require 'helper'
module Cri
class ArgumentListTestCase < Cri::TestCase
def test_empty
args = Cri::ArgumentList.new([], false, [])
assert_equal([], args.to_a)
assert(args.empty?)
assert_equal(0, args.size)
assert_equal(nil, args[0])
assert_equal(... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/test/test_basic_help.rb | test/test_basic_help.rb | # frozen_string_literal: true
require 'helper'
module Cri
class BasicHelpTestCase < Cri::TestCase
def test_run_without_supercommand
cmd = Cri::Command.new_basic_help
assert_raises Cri::NoHelpAvailableError do
cmd.run([])
end
end
def test_run_with_supercommand
cmd = Cri:... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/test/test_command_runner.rb | test/test_command_runner.rb | # frozen_string_literal: true
require 'helper'
module Cri
class CommandRunnerTestCase < Cri::TestCase
def setup
super
@options = { vehicle: 'pig' }
@arguments = %w[baby_monkey]
@command = Cri::Command.new
end
def test_initialize
runner = Cri::CommandRunner.new(@option... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/test/test_parser.rb | test/test_parser.rb | # frozen_string_literal: true
require 'helper'
module Cri
class ParserTestCase < Cri::TestCase
def test_parse_without_options
input = %w[foo bar baz]
opt_defns = []
parser = Cri::Parser.new(input, opt_defns, [], false).run
assert_equal({}, parser.options)
assert_equal(%w[foo bar ... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/test/helper.rb | test/helper.rb | # frozen_string_literal: true
require 'minitest'
require 'minitest/autorun'
require 'cri'
require 'stringio'
module Cri
class TestCase < Minitest::Test
def setup
@orig_io = capture_io
end
def teardown
uncapture_io(*@orig_io)
end
def capture_io_while
orig_io = capture_io
... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/test/test_command.rb | test/test_command.rb | # frozen_string_literal: true
require 'helper'
module Cri
class CommandTestCase < Cri::TestCase
def simple_cmd
Cri::Command.define do
name 'moo'
usage 'moo [options] arg1 arg2 ...'
summary 'does stuff'
description 'This command does a lot of stuff.'
... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/test/test_string_formatter.rb | test/test_string_formatter.rb | # frozen_string_literal: true
require 'helper'
module Cri
class CoreExtTestCase < Cri::TestCase
def formatter
Cri::StringFormatter.new
end
def test_string_to_paragraphs
original = "Lorem ipsum dolor sit amet,\nconsectetur adipisicing.\n\n" \
"Sed do eiusmod\ntempor incididu... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/test/test_help_renderer.rb | test/test_help_renderer.rb | # frozen_string_literal: true
require 'helper'
module Cri
class HelpRendererTestCase < Cri::TestCase
# NOTE: Additional test cases are in test_command.rb
def help_for(cmd)
io = StringIO.new
Cri::HelpRenderer.new(cmd, io: io).render
end
def test_simple
expected = <<~HELP
N... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/test/test_basic_root.rb | test/test_basic_root.rb | # frozen_string_literal: true
require 'helper'
module Cri
class BasicRootTestCase < Cri::TestCase
def test_run_with_help
cmd = Cri::Command.new_basic_root
stdout, _stderr = capture_io_while do
err = assert_raises SystemExit do
cmd.run(%w[-h])
end
assert_equal 0, er... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/test/test_command_dsl.rb | test/test_command_dsl.rb | # frozen_string_literal: true
require 'helper'
module Cri
class CommandDSLTestCase < Cri::TestCase
def test_create_command
# Define
dsl = Cri::CommandDSL.new
dsl.instance_eval do
name 'moo'
usage 'dunno whatever'
summary 'does stuff'
description... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/lib/cri.rb | lib/cri.rb | # frozen_string_literal: true
# The namespace for Cri, a library for building easy-to-use command-line tools
# with support for nested commands.
module Cri
# A generic error class for all Cri-specific errors.
class Error < ::StandardError
end
# Error that will be raised when an implementation for a method or ... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/lib/cri/command.rb | lib/cri/command.rb | # frozen_string_literal: true
module Cri
# Cri::Command represents a command that can be executed on the command line.
# It is also used for the command-line tool itself.
class Command
# Delegate used for partitioning the list of arguments and options. This
# delegate will stop the parser as soon as the ... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/lib/cri/platform.rb | lib/cri/platform.rb | # frozen_string_literal: true
module Cri
# Provides tools to detect platform and environment configuration (e.g. is
# color support available?)
#
# @api private
module Platform
# @return [Boolean] true if the current platform is Windows, false
# otherwise.
def self.windows?
RUBY_PLATFORM =~... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/lib/cri/version.rb | lib/cri/version.rb | # frozen_string_literal: true
module Cri
# The current Cri version.
VERSION = '2.15.12'
end
| ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/lib/cri/help_renderer.rb | lib/cri/help_renderer.rb | # frozen_string_literal: true
module Cri
# The {HelpRenderer} class is responsible for generating a string containing
# the help for a given command, intended to be printed on the command line.
class HelpRenderer
# The line width of the help output
LINE_WIDTH = 78
# The indentation of descriptions
... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/lib/cri/parser.rb | lib/cri/parser.rb | # frozen_string_literal: true
module Cri
# Cri::Parser is used for parsing command-line options and arguments.
class Parser
# Error that will be raised when an unknown option is encountered.
class IllegalOptionError < Cri::Error
end
# Error that will be raised when an option with an invalid or
... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/lib/cri/option_definition.rb | lib/cri/option_definition.rb | # frozen_string_literal: true
module Cri
# The definition of an option.
class OptionDefinition
attr_reader :short
attr_reader :long
attr_reader :desc
attr_reader :argument
attr_reader :multiple
attr_reader :block
attr_reader :hidden
attr_reader :default
attr_reader :transform
... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/lib/cri/param_definition.rb | lib/cri/param_definition.rb | # frozen_string_literal: true
module Cri
# The definition of a parameter.
class ParamDefinition
attr_reader :name
attr_reader :transform
def initialize(name:, transform:)
@name = name
@transform = transform
end
end
end
| ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/lib/cri/argument_list.rb | lib/cri/argument_list.rb | # frozen_string_literal: true
module Cri
# A list of arguments, which can be indexed using either a number or a symbol.
class ArgumentList
# Error that will be raised when an incorrect number of arguments is given.
class ArgumentCountMismatchError < Cri::Error
def initialize(expected_count, actual_co... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/lib/cri/command_dsl.rb | lib/cri/command_dsl.rb | # frozen_string_literal: true
module Cri
# The command DSL is a class that is used for building and modifying
# commands.
class CommandDSL
# Error that will be raised when specifying a parameter after the command is
# already declared as taken no params.
class AlreadySpecifiedAsNoParams < Cri::Error
... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/lib/cri/command_runner.rb | lib/cri/command_runner.rb | # frozen_string_literal: true
module Cri
# A command runner is responsible for the execution of a command. Using it
# is optional, but it is useful for commands whose execution block is large.
class CommandRunner
# @return [Hash] A hash contain the options and their values
attr_reader :options
# @re... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/lib/cri/string_formatter.rb | lib/cri/string_formatter.rb | # frozen_string_literal: true
module Cri
# Used for formatting strings (e.g. converting to paragraphs, wrapping,
# formatting as title)
#
# @api private
class StringFormatter
# Extracts individual paragraphs (separated by two newlines).
#
# @param [String] str The string to format
#
# @re... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/lib/cri/commands/basic_root.rb | lib/cri/commands/basic_root.rb | # frozen_string_literal: true
flag :h, :help, 'show help for this command' do |_value, cmd|
puts cmd.help
raise CriExitException.new(is_error: false)
end
subcommand Cri::Command.new_basic_help
| ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
denisdefreyne/cri | https://github.com/denisdefreyne/cri/blob/022de9676b2912b90d3b21f1727680d81ebc1e5d/lib/cri/commands/basic_help.rb | lib/cri/commands/basic_help.rb | # frozen_string_literal: true
name 'help'
usage 'help [command_name]'
summary 'show help'
description <<~DESC
Show help for the given command, or show general help. When no command is
given, a list of available commands is displayed, as well as a list of global
command-line options. When a comma... | ruby | MIT | 022de9676b2912b90d3b21f1727680d81ebc1e5d | 2026-01-04T17:57:35.186613Z | false |
zverok/geo_coord | https://github.com/zverok/geo_coord/blob/659852f524e7524b6d2aa791b1724cecb391aa02/spec/spec_helper.rb | spec/spec_helper.rb | if Object.const_defined?(:RSpec) # otherwise it is mspec
require 'stringio'
require 'simplecov'
require 'coveralls'
require 'rspec/its'
require 'saharspec'
Coveralls.wear!
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
[SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::... | ruby | MIT | 659852f524e7524b6d2aa791b1724cecb391aa02 | 2026-01-04T17:57:37.567912Z | false |
zverok/geo_coord | https://github.com/zverok/geo_coord/blob/659852f524e7524b6d2aa791b1724cecb391aa02/spec/geo/coord_spec.rb | spec/geo/coord_spec.rb | # frozen_string_literal: true
RSpec.describe Geo::Coord do
def coord(*args)
Geo::Coord.new(*args)
end
describe '#initialize' do
subject { described_class.method(:new) }
its_call(50.004444, 36.231389) {
is_expected.to ret have_attributes(
lat: 50.004444,
latitude: 50.004444,
... | ruby | MIT | 659852f524e7524b6d2aa791b1724cecb391aa02 | 2026-01-04T17:57:37.567912Z | false |
zverok/geo_coord | https://github.com/zverok/geo_coord/blob/659852f524e7524b6d2aa791b1724cecb391aa02/spec/geo/globes_earth_spec.rb | spec/geo/globes_earth_spec.rb | # frozen_string_literal: true
RSpec.describe Geo::Coord::Globes::Earth do
def coord(*args)
Geo::Coord.new(*args)
end
let(:washington_dc) { coord(38.898748, -77.037684) }
let(:chicago) { coord(41.85, -87.65) }
let(:anti_washington) { coord(-38.898748, 102.962316) }
it 'calculates distance (by Vincenty... | ruby | MIT | 659852f524e7524b6d2aa791b1724cecb391aa02 | 2026-01-04T17:57:37.567912Z | false |
zverok/geo_coord | https://github.com/zverok/geo_coord/blob/659852f524e7524b6d2aa791b1724cecb391aa02/lib/geo/coord.rb | lib/geo/coord.rb | # frozen_string_literal: true
require 'bigdecimal'
require 'bigdecimal/util'
# Geo::Coord is Ruby's library for handling [lat, lng] pairs of
# geographical coordinates. It provides most of basic functionality
# you may expect (storing and representing coordinate pair), as well
# as some geodesy math, like distances a... | ruby | MIT | 659852f524e7524b6d2aa791b1724cecb391aa02 | 2026-01-04T17:57:37.567912Z | false |
zverok/geo_coord | https://github.com/zverok/geo_coord/blob/659852f524e7524b6d2aa791b1724cecb391aa02/lib/geo/coord/version.rb | lib/geo/coord/version.rb | # frozen_string_literal: true
module Geo
class Coord
VERSION = '0.2.0'
end
end
| ruby | MIT | 659852f524e7524b6d2aa791b1724cecb391aa02 | 2026-01-04T17:57:37.567912Z | false |
zverok/geo_coord | https://github.com/zverok/geo_coord/blob/659852f524e7524b6d2aa791b1724cecb391aa02/lib/geo/coord/globes.rb | lib/geo/coord/globes.rb | require 'singleton'
module Geo
# @private
module Coord::Globes # :nodoc:all
# Notes on this module
#
# **Credits:**
#
# Most of the initial code/algo, as well as tests were initially borrowed from
# [Graticule](https://github.com/collectiveidea/graticule).
#
# Algo descriptions borr... | ruby | MIT | 659852f524e7524b6d2aa791b1724cecb391aa02 | 2026-01-04T17:57:37.567912Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.2-pdo-oci.rb | Formula/php@8.2-pdo-oci.rb | require_relative "../lib/oracle_php_extension_formula"
class PhpAT82PdoOci < OraclePhpExtensionFormula
extension_dsl "PDO Driver OCI"
deprecate! date: "2026-12-31", because: :unsupported
instantclient_options arg: "--with-pdo-oci", with_version: true
end
| ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.3-pdo-oci.rb | Formula/php@8.3-pdo-oci.rb | require_relative "../lib/oracle_php_extension_formula"
class PhpAT83PdoOci < OraclePhpExtensionFormula
extension_dsl "PDO Driver OCI"
deprecate! date: "2027-12-31", because: :unsupported
instantclient_options arg: "--with-pdo-oci", with_version: true
end
| ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.2-snmp.rb | Formula/php@8.2-snmp.rb | require_relative "../lib/php_extension_formula"
class PhpAT82Snmp < PhpExtensionFormula
extension_dsl "SNMP Extension"
deprecate! date: "2026-12-31", because: :unsupported
depends_on "net-snmp"
depends_on "openssl@3"
configure_arg "--with-snmp=#{Formula["net-snmp"].opt_prefix}"
end
| ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.3-imap.rb | Formula/php@8.3-imap.rb | require_relative "../lib/php_extension_formula"
class PhpAT83Imap < PhpExtensionFormula
extension_dsl "IMAP Extension"
deprecate! date: "2027-12-31", because: :unsupported
depends_on "imap-uw"
depends_on "openssl@3"
depends_on "krb5"
configure_arg %W[
--with-imap=#{Formula["imap-uw"].opt_prefix}
... | ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.3-snmp.rb | Formula/php@8.3-snmp.rb | require_relative "../lib/php_extension_formula"
class PhpAT83Snmp < PhpExtensionFormula
extension_dsl "SNMP Extension"
deprecate! date: "2027-12-31", because: :unsupported
depends_on "net-snmp"
depends_on "openssl@3"
configure_arg "--with-snmp=#{Formula["net-snmp"].opt_prefix}"
end
| ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.1-pdo-oci.rb | Formula/php@8.1-pdo-oci.rb | require_relative "../lib/oracle_php_extension_formula"
class PhpAT81PdoOci < OraclePhpExtensionFormula
extension_dsl "PDO Driver OCI"
deprecate! date: "2025-12-31", because: :unsupported
instantclient_options arg: "--with-pdo-oci", with_version: true
end
| ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.1-imap.rb | Formula/php@8.1-imap.rb | require_relative "../lib/php_extension_formula"
class PhpAT81Imap < PhpExtensionFormula
extension_dsl "IMAP Extension"
deprecate! date: "2025-12-31", because: :unsupported
depends_on "imap-uw"
depends_on "openssl@3"
depends_on "krb5"
configure_arg %W[
--with-imap=#{Formula["imap-uw"].opt_prefix}
... | ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.2-enchant.rb | Formula/php@8.2-enchant.rb | require_relative "../lib/php_extension_formula"
class PhpAT82Enchant < PhpExtensionFormula
extension_dsl "Enchant Extension"
deprecate! date: "2026-12-31", because: :unsupported
depends_on "enchant"
end
| ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.1-oci8.rb | Formula/php@8.1-oci8.rb | require_relative "../lib/oracle_php_extension_formula"
class PhpAT81Oci8 < OraclePhpExtensionFormula
extension_dsl "OCI8 Extension"
deprecate! date: "2025-12-31", because: :unsupported
instantclient_options arg: "--with-oci8"
end
| ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.2-imap.rb | Formula/php@8.2-imap.rb | require_relative "../lib/php_extension_formula"
class PhpAT82Imap < PhpExtensionFormula
extension_dsl "IMAP Extension"
deprecate! date: "2026-12-31", because: :unsupported
depends_on "imap-uw"
depends_on "openssl@3"
depends_on "krb5"
configure_arg %W[
--with-imap=#{Formula["imap-uw"].opt_prefix}
... | ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.3-oci8.rb | Formula/php@8.3-oci8.rb | require_relative "../lib/oracle_php_extension_formula"
class PhpAT83Oci8 < OraclePhpExtensionFormula
extension_dsl "OCI8 Extension"
deprecate! date: "2027-12-31", because: :unsupported
instantclient_options arg: "--with-oci8"
end
| ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php-enchant.rb | Formula/php-enchant.rb | require_relative "../lib/php_extension_formula"
class PhpEnchant < PhpExtensionFormula
extension_dsl "Enchant Extension"
depends_on "enchant"
end
| ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.1-snmp.rb | Formula/php@8.1-snmp.rb | require_relative "../lib/php_extension_formula"
class PhpAT81Snmp < PhpExtensionFormula
extension_dsl "SNMP Extension"
deprecate! date: "2025-12-31", because: :unsupported
depends_on "net-snmp"
depends_on "openssl@3"
configure_arg "--with-snmp=#{Formula["net-snmp"].opt_prefix}"
end
| ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.3-enchant.rb | Formula/php@8.3-enchant.rb | require_relative "../lib/php_extension_formula"
class PhpAT83Enchant < PhpExtensionFormula
extension_dsl "Enchant Extension"
deprecate! date: "2027-12-31", because: :unsupported
depends_on "enchant"
end
| ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.1-enchant.rb | Formula/php@8.1-enchant.rb | require_relative "../lib/php_extension_formula"
class PhpAT81Enchant < PhpExtensionFormula
extension_dsl "Enchant Extension"
deprecate! date: "2025-12-31", because: :unsupported
depends_on "enchant"
end
| ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/Formula/php@8.2-oci8.rb | Formula/php@8.2-oci8.rb | require_relative "../lib/oracle_php_extension_formula"
class PhpAT82Oci8 < OraclePhpExtensionFormula
extension_dsl "OCI8 Extension"
deprecate! date: "2026-12-31", because: :unsupported
instantclient_options arg: "--with-oci8"
end
| ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/lib/oracle_php_extension_formula.rb | lib/oracle_php_extension_formula.rb | # frozen_string_literal: true
require_relative "../lib/php_extension_formula"
class OraclePhpExtensionFormula < PhpExtensionFormula
def install
(prefix/"instantclient").install resource("instantclient-basic")
(prefix/"instantclient").install resource("instantclient-sdk")
instantclient_version = resourc... | ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
kabel/homebrew-php-ext | https://github.com/kabel/homebrew-php-ext/blob/6f1beba58200ca5652a5507391b30e4ba90ed8e3/lib/php_extension_formula.rb | lib/php_extension_formula.rb | # frozen_string_literal: true
class PhpExtensionFormula < Formula
desc "PHP Extension"
homepage "https://www.php.net/"
def initialize(name, path, spec, alias_path: nil, tap: nil, force_bottle: false)
super
active_spec.owner = php_parent.stable.owner
end
def install
cd "ext/#{extension}"
sys... | ruby | BSD-2-Clause | 6f1beba58200ca5652a5507391b30e4ba90ed8e3 | 2026-01-04T17:57:42.980777Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/init.rb | init.rb | require 'stateflow' | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/benchmark/compare_state_machines.rb | benchmark/compare_state_machines.rb | require 'benchmark'
require 'active_record'
require 'stateflow'
require 'aasm'
# change this if sqlite is unavailable
dbconfig = {
:adapter => 'sqlite3',
:database => ':memory:'
}
ActiveRecord::Base.establish_connection(dbconfig)
ActiveRecord::Migration.verbose = false
class TestMigration < ActiveRecord::Migrat... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/spec/stateflow_spec.rb | spec/stateflow_spec.rb | require 'spec_helper'
Stateflow.persistence = :none
class Robot
include Stateflow
stateflow do
initial :green
state :green, :yellow, :red
event :change_color do
transitions :from => :green, :to => :yellow
transitions :from => :yellow, :to => :red
transitions :from => :red, :to => ... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/spec/spec_helper.rb | spec/spec_helper.rb | $LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'stateflow'
| ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/spec/orm/activerecord_spec.rb | spec/orm/activerecord_spec.rb | require 'spec_helper'
require 'active_record'
Stateflow.persistence = :active_record
# change this if sqlite is unavailable
dbconfig = {
:adapter => 'sqlite3',
:database => ':memory:'
}
ActiveRecord::Base.establish_connection(dbconfig)
ActiveRecord::Migration.verbose = false
class TestMigration < ActiveRecord::... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/spec/orm/mongoid_spec.rb | spec/orm/mongoid_spec.rb | require 'spec_helper'
require 'mongoid'
Stateflow.persistence = :mongoid
Mongoid.load!(File.expand_path("../../mongoid.yml", __FILE__), :test)
class MongoRobot
include Mongoid::Document
include Stateflow
field :state
field :name
stateflow do
initial :red
state :red, :green
event :change do
... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/examples/test.rb | examples/test.rb | require 'rubygems'
require 'stateflow'
class Test
include Stateflow
stateflow do
initial :love
state :love do
enter lambda { |t| p "Entering love" }
exit :exit_love
end
state :hate do
enter lambda { |t| p "Entering hate" }
exit lambda { |t| p "Exiting hate"... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/examples/robot.rb | examples/robot.rb | require 'rubygems'
require 'stateflow'
class Robot
include Stateflow
stateflow do
initial :green
state :green, :yellow, :red
event :change_color do
transitions :from => :green, :to => :yellow
transitions :from => :yellow, :to => :red
transitions :from => :red, :to => :green
end... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/lib/stateflow.rb | lib/stateflow.rb | require 'active_support'
require 'active_support/inflector'
module Stateflow
extend ActiveSupport::Concern
included do
Stateflow::Persistence.load!(self)
end
def self.persistence
@@persistence ||= nil
end
def self.persistence=(persistence)
@@persistence = persistence
end
module ClassMet... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/lib/stateflow/persistence.rb | lib/stateflow/persistence.rb | module Stateflow
module Persistence
def self.active
persistences = Array.new
Dir[File.dirname(__FILE__) + '/persistence/*.rb'].each do |file|
persistences << File.basename(file, File.extname(file)).underscore.to_sym
end
persistences
end
def self.load!(bas... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/lib/stateflow/event.rb | lib/stateflow/event.rb | module Stateflow
class Event
attr_accessor :name, :transitions, :machine
def initialize(name, machine=nil, &transitions)
@name = name
@machine = machine
@transitions = Array.new
instance_eval(&transitions)
end
def fire(current_state, klass, options)
transition = @trans... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/lib/stateflow/transition.rb | lib/stateflow/transition.rb | module Stateflow
class IncorrectTransition < Exception; end
class Transition
attr_reader :from, :to, :if, :decide
def initialize(args)
@from = [args[:from]].flatten
@to = args[:to]
@if = args[:if]
@decide = args[:decide]
end
def can_transition?(base)
retur... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/lib/stateflow/state.rb | lib/stateflow/state.rb | module Stateflow
class State
attr_accessor :name, :options
def initialize(name, &options)
@name = name
@options = Hash.new
instance_eval(&options) if block_given?
end
def enter(method = nil, &block)
@options[:enter] = method.nil? ? block : method
end
def exit(method... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/lib/stateflow/railtie.rb | lib/stateflow/railtie.rb | module Stateflow
class Railtie < Rails::Railtie
def default_orm
generators = config.respond_to?(:app_generators) ? :app_generators : :generators
config.send(generators).options[:rails][:orm]
end
initializer "stateflow.set_persistence" do
Stateflow.persistence = default_orm if Statef... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/lib/stateflow/exception.rb | lib/stateflow/exception.rb | module Stateflow
class NoTransitionFound < Exception; end
class NoStateFound < Exception; end
class NoEventFound < Exception; end
end | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/lib/stateflow/machine.rb | lib/stateflow/machine.rb | module Stateflow
class Machine
attr_accessor :states, :initial_state, :events
def initialize(&machine)
@states, @events, @create_scopes = Hash.new, Hash.new, true
instance_eval(&machine)
end
def state_column(name = :state)
@state_column ||= name
end
def create_scopes(bool ... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/lib/stateflow/persistence/active_record.rb | lib/stateflow/persistence/active_record.rb | module Stateflow
module Persistence
module ActiveRecord
extend ActiveSupport::Concern
included do
before_validation(:ensure_initial_state, :on => :create)
end
module ClassMethods
def add_scope(state)
scope state.name, proc { where("#{machine.state_column}".to_sy... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/lib/stateflow/persistence/mongoid.rb | lib/stateflow/persistence/mongoid.rb | module Stateflow
module Persistence
module Mongoid
extend ActiveSupport::Concern
included do
before_validation(:ensure_initial_state, :on => :create)
end
module ClassMethods
def add_scope(state)
scope state.name, -> { where(:state => state.name.to_s) } unless se... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/lib/stateflow/persistence/none.rb | lib/stateflow/persistence/none.rb | module Stateflow
module Persistence
module None
extend ActiveSupport::Concern
module ClassMethods
def add_scope(state)
# do nothing
end
end
attr_accessor :state
def load_from_persistence
@state
end
def save_to_persistence(new_state, o... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
ryanza/stateflow | https://github.com/ryanza/stateflow/blob/8abeef6440154b0313a186f5872cb0b19f803641/lib/stateflow/persistence/mongo_mapper.rb | lib/stateflow/persistence/mongo_mapper.rb | module Stateflow
module Persistence
module MongoMapper
extend ActiveSupport::Concern
included do
before_validation(:ensure_initial_state, :on => :create)
end
module ClassMethods
def add_scope(state)
scope state.name, where(:state => state.name.to_s)
end
... | ruby | MIT | 8abeef6440154b0313a186f5872cb0b19f803641 | 2026-01-04T17:57:40.152738Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/test_matrix.rb | test_matrix.rb | # frozen_string_literal: true
require 'yaml'
require 'fileutils'
require 'English'
@threads = {}
def run_container(image, puppet_version)
pversion = puppet_version.match(/([\d\.]+)/)[0]
ruby_version = image.split(':').last
dir = File.join('.', 'local_test_results', pversion, ruby_version)
real_dir = File.expa... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/hooks_spec.rb | spec/hooks_spec.rb | # frozen_string_literal: true
require_relative 'spec_helper'
describe PuppetDebugger::Hooks do
before do
@hooks = PuppetDebugger::Hooks.new
end
let(:output) do
StringIO.new
end
let(:debugger) do
PuppetDebugger::Cli.new(out_buffer: output)
end
describe 'adding a new hook' do
it 'should... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/support_spec.rb | spec/support_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'tempfile'
describe 'support' do
let(:output) do
StringIO.new
end
let(:debugger) do
PuppetDebugger::Cli.new(out_buffer: output)
end
let(:scope) do
debugger.scope
end
let(:puppet_version) do
debugger.puppet_lib_dir.scan(debugg... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/facts_spec.rb | spec/facts_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe 'facts' do
let(:debugger) do
PuppetDebugger::Cli.new(out_buffer: output)
end
let(:puppet_version) do
'4.5.3'
end
let(:facter_version) do
debugger.default_facter_version
end
before(:each) do
allow(Puppet).to receive(:version)... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/input_responder_plugin_spec.rb | spec/input_responder_plugin_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-debugger/input_responder_plugin'
describe :input_responder_plugin do
let(:output) do
StringIO.new
end
before(:each) do
allow(plugin).to receive(:run).and_return([])
end
let(:debugger) do
PuppetDebugger::Cli.new({ out_buffer: o... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/remote_node_spec.rb | spec/remote_node_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'stringio'
describe 'PuppetDebugger' do
let(:resource) do
"service{'httpd': ensure => running}"
end
before(:each) do
debugger.handle_input('reset')
end
let(:output) do
StringIO.new
end
let(:debugger) do
PuppetDebugger::Cli.new... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/pdb_spec.rb | spec/pdb_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe 'pdb' do
let(:fixtures_file) do
File.join(fixtures_dir, 'sample_manifest.pp')
end
before(:each) do
allow(PuppetDebugger).to receive(:fetch_url_data).with(file_url).and_return(File.read(fixtures_file))
end
let(:file_url) do
'https://g... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/environment_spec.rb | spec/environment_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'stringio'
describe 'environment' do
let(:output) do
StringIO.new
end
let(:debugger) do
PuppetDebugger::Cli.new(out_buffer: output)
end
it 'environment returns object with properties' do
expect(debugger.puppet_environment).to_not eq ni... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/puppet_debugger_spec.rb | spec/puppet_debugger_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'stringio'
describe 'PuppetDebugger' do
let(:resource) do
"service{'httpd': ensure => running}"
end
before(:each) do
debugger.handle_input('reset')
end
let(:output) do
StringIO.new
end
let(:debugger) do
PuppetDebugger::Cli.new... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
require_relative '../lib/puppet-debugger'
require 'yaml'
ENV['CI'] = 'true'
if ENV['COVERAGE']
require 'simplecov'
module SimpleCov::Configuration
def clean_filters
@filters = []
end
end
SimpleCov.configure do
clean_filters
load_profile 'test_frameworks'
... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/echo.rb | spec/fixtures/modules/extlib/lib/puppet/functions/echo.rb | # @summary DEPRECATED. Use the namespaced function [`extlib::echo`](#extlibecho) instead.
# DEPRECATED. Use the namespaced function [`extlib::echo`](#extlibecho) instead.
Puppet::Functions.create_function(:echo) do
dispatch :deprecation_gen do
repeated_param 'Any', :args
end
def deprecation_gen(*args)
c... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/default_content.rb | spec/fixtures/modules/extlib/lib/puppet/functions/default_content.rb | # @summary DEPRECATED. Use the namespaced function [`extlib::default_content`](#extlibdefault_content) instead.
# DEPRECATED. Use the namespaced function [`extlib::default_content`](#extlibdefault_content) instead.
Puppet::Functions.create_function(:default_content) do
dispatch :deprecation_gen do
repeated_para... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/cache_data.rb | spec/fixtures/modules/extlib/lib/puppet/functions/cache_data.rb | # @summary DEPRECATED. Use the namespaced function [`extlib::cache_data`](#extlibcache_data) instead.
# DEPRECATED. Use the namespaced function [`extlib::cache_data`](#extlibcache_data) instead.
Puppet::Functions.create_function(:cache_data) do
dispatch :deprecation_gen do
repeated_param 'Any', :args
end
de... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/resources_deep_merge.rb | spec/fixtures/modules/extlib/lib/puppet/functions/resources_deep_merge.rb | # @summary DEPRECATED. Use the namespaced function [`extlib::resources_deep_merge`](#extlibresources_deep_merge) instead.
# DEPRECATED. Use the namespaced function [`extlib::resources_deep_merge`](#extlibresources_deep_merge) instead.
Puppet::Functions.create_function(:resources_deep_merge) do
dispatch :deprecation... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/random_password.rb | spec/fixtures/modules/extlib/lib/puppet/functions/random_password.rb | # @summary DEPRECATED. Use the namespaced function [`extlib::random_password`](#extlibrandom_password) instead.
# DEPRECATED. Use the namespaced function [`extlib::random_password`](#extlibrandom_password) instead.
Puppet::Functions.create_function(:random_password) do
dispatch :deprecation_gen do
repeated_para... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/dump_args.rb | spec/fixtures/modules/extlib/lib/puppet/functions/dump_args.rb | # @summary DEPRECATED. Use the namespaced function [`extlib::dump_args`](#extlibdump_args) instead.
# DEPRECATED. Use the namespaced function [`extlib::dump_args`](#extlibdump_args) instead.
Puppet::Functions.create_function(:dump_args) do
dispatch :deprecation_gen do
repeated_param 'Any', :args
end
def dep... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/ip_to_cron.rb | spec/fixtures/modules/extlib/lib/puppet/functions/ip_to_cron.rb | # @summary DEPRECATED. Use the namespaced function [`extlib::ip_to_cron`](#extlibip_to_cron) instead.
# DEPRECATED. Use the namespaced function [`extlib::ip_to_cron`](#extlibip_to_cron) instead.
Puppet::Functions.create_function(:ip_to_cron) do
dispatch :deprecation_gen do
repeated_param 'Any', :args
end
de... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/echo.rb | spec/fixtures/modules/extlib/lib/puppet/functions/extlib/echo.rb | # This function outputs the variable content and its type to the
# debug log. It's similiar to the `notice` function but provides
# a better output format useful to trace variable types and values
# in the manifests.
#
# ```
# $v1 = 'test'
# $v2 = ["1", "2", "3"]
# $v3 = {"a"=>"1", "b"=>"2"}
# $v4 = true
# # $v5 is not... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/default_content.rb | spec/fixtures/modules/extlib/lib/puppet/functions/extlib/default_content.rb | # Takes an optional content and an optional template name and returns the contents of a file.
Puppet::Functions.create_function(:'extlib::default_content') do
# @param content
# @param template_name
# The path to an .erb or .epp template file or `undef`.
# @return
# Returns the value of the content parame... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/cache_data.rb | spec/fixtures/modules/extlib/lib/puppet/functions/extlib/cache_data.rb | require 'fileutils'
require 'yaml'
require 'etc'
# @summary Retrieves data from a cache file, or creates it with supplied data if the file doesn't exist
#
# Retrieves data from a cache file, or creates it with supplied data if the
# file doesn't exist
#
# Useful for having data that's randomly generated once on the ma... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/sort_by_version.rb | spec/fixtures/modules/extlib/lib/puppet/functions/extlib/sort_by_version.rb | # A function that sorts an array of version numbers.
Puppet::Functions.create_function(:'extlib::sort_by_version') do
# @param versions An array of version strings you want sorted.
# @return Returns the sorted array.
# @example Calling the function
# extlib::sort_by_version(['10.0.0b12', '10.0.0b3', '10.0.0a2... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/resources_deep_merge.rb | spec/fixtures/modules/extlib/lib/puppet/functions/extlib/resources_deep_merge.rb | # @summary Deeply merge a "defaults" hash into a "resources" hash like the ones expected by `create_resources()`.
#
# Deeply merge a "defaults" hash into a "resources" hash like the ones expected by `create_resources()`.
#
# Internally calls the puppetlabs-stdlib function `deep_merge()`. In case of
# duplicate keys the... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/random_password.rb | spec/fixtures/modules/extlib/lib/puppet/functions/extlib/random_password.rb | # vim: set ts=2 sw=2 et :
# encoding: utf-8
# random_password.rb
#
# Copyright 2012 Krzysztof Wilczynski
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/dump_args.rb | spec/fixtures/modules/extlib/lib/puppet/functions/extlib/dump_args.rb | require 'json'
# @summary Prints the args to STDOUT in Pretty JSON format.
#
# Prints the args to STDOUT in Pretty JSON format.
#
# Useful for debugging purposes only. Ideally you would use this in
# conjunction with a rspec-puppet unit test. Otherwise the output will
# be shown during a puppet run when verbose/debug... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/ip_to_cron.rb | spec/fixtures/modules/extlib/lib/puppet/functions/extlib/ip_to_cron.rb | # Provides a "random" value to cron based on the last bit of the machine IP address.
# used to avoid starting a certain cron job at the same time on all servers.
# Takes the runinterval in seconds as parameter and returns an array of [hour, minute]
#
# example usage
# ```
# ip_to_cron(3600) - returns [ '*', one value b... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/has_module.rb | spec/fixtures/modules/extlib/lib/puppet/functions/extlib/has_module.rb | require 'json'
# A function that lets you know whether a specific module is on your modulepath.
Puppet::Functions.create_function(:'extlib::has_module') do
# @param module_name The full name of the module you want to know exists or not.
# Namespace and modulename can be separated with either `-` or `/`.
# @ret... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/input_responders/exit_spec.rb | spec/input_responders/exit_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-debugger'
describe :exit do
let(:args) { [] }
let(:plugin) do
instance = PuppetDebugger::InputResponders::Commands.plugin_from_command(subject.to_s).instance
instance.debugger = debugger
instance
end
let(:output) do
StringIO... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/input_responders/classification_spec.rb | spec/input_responders/classification_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-debugger'
require 'puppet-debugger/plugin_test_helper'
describe :classification do
include_examples 'plugin_tests'
let(:args) { [] }
it 'can process a file' do
expect(plugin.run(args)).to eq('[]')
end
it 'can process a file from handl... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/input_responders/stacktrace_spec.rb | spec/input_responders/stacktrace_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-debugger'
require 'puppet-debugger/plugin_test_helper'
describe :stacktrace do
include_examples 'plugin_tests'
let(:args) {}
it 'should be able to print stacktrace' do
debugger_output = /stacktrace\snot\savailable/
expect(plugin.run(ar... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/input_responders/types_spec.rb | spec/input_responders/types_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-debugger'
require 'puppet-debugger/plugin_test_helper'
describe :types do
include_examples 'plugin_tests'
let(:args) { [] }
it 'runs' do
expect(plugin.run(args)).to match(/service/)
end
describe 'types' do
let(:input) do
'ty... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
nwops/puppet-debugger | https://github.com/nwops/puppet-debugger/blob/d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb/spec/input_responders/whereami_spec.rb | spec/input_responders/whereami_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-debugger'
require 'puppet-debugger/plugin_test_helper'
describe :whereami do
include_examples 'plugin_tests'
let(:input) do
File.expand_path File.join(fixtures_dir, 'sample_start_debugger.pp')
end
let(:options) do
{
source_file:... | ruby | MIT | d2ed9e3cd0b775956d8b0d6ed78e9a4a4b9a9fbb | 2026-01-04T17:57:09.425774Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.