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
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/registry.rb
lib/zeitwerk/registry.rb
# frozen_string_literal: true module Zeitwerk module Registry # :nodoc: all require_relative "registry/autoloads" require_relative "registry/explicit_namespaces" require_relative "registry/inceptions" require_relative "registry/loaders" class << self # Keeps track of all loaders. Useful to...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/loader.rb
lib/zeitwerk/loader.rb
# frozen_string_literal: true require "monitor" require "set" module Zeitwerk class Loader require_relative "loader/helpers" require_relative "loader/callbacks" require_relative "loader/config" require_relative "loader/eager_load" extend Internal include RealModName include Callbacks ...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/gem_loader.rb
lib/zeitwerk/gem_loader.rb
# frozen_string_literal: true module Zeitwerk # @private class GemLoader < Loader include RealModName # Users should not create instances directly, the public interface is # `Zeitwerk::Loader.for_gem`. private_class_method :new # @private #: (String, namespace: Module, warn_on_extra_files...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/cref.rb
lib/zeitwerk/cref.rb
# frozen_string_literal: true # This private class encapsulates pairs (mod, cname). # # Objects represent the constant `cname` in the class or module object `mod`, # and have API to manage them. Examples: # # cref.path # cref.set(value) # cref.get # # The constant may or may not exist in `mod`. class Zeitwerk::C...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/real_mod_name.rb
lib/zeitwerk/real_mod_name.rb
# frozen_string_literal: true module Zeitwerk::RealModName #: UnboundMethod UNBOUND_METHOD_MODULE_NAME = Module.instance_method(:name) private_constant :UNBOUND_METHOD_MODULE_NAME # Returns the real name of the class or module. # # We need this indirection because the `name` method can be overridden, and ...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/internal.rb
lib/zeitwerk/internal.rb
# frozen_string_literal: true # This is a private module. module Zeitwerk::Internal #: (Symbol) -> void def internal(method_name) private method_name mangled = "__#{method_name}" alias_method mangled, method_name public mangled end end
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/null_inflector.rb
lib/zeitwerk/null_inflector.rb
class Zeitwerk::NullInflector #: (String, String) -> String def camelize(basename, _abspath) basename end end
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/error.rb
lib/zeitwerk/error.rb
# frozen_string_literal: true module Zeitwerk class Error < StandardError end class ReloadingDisabledError < Error #: () -> void def initialize super("can't reload, please call loader.enable_reloading before setup") end end class NameError < ::NameError end class SetupRequired < Erro...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/loader/eager_load.rb
lib/zeitwerk/loader/eager_load.rb
module Zeitwerk::Loader::EagerLoad # Eager loads all files in the root directories, recursively. Files do not # need to be in `$LOAD_PATH`, absolute file names are used. Ignored and # shadowed files are not eager loaded. You can opt-out specifically in # specific files and directories with `do_not_eager_load`, ...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/loader/callbacks.rb
lib/zeitwerk/loader/callbacks.rb
# frozen_string_literal: true module Zeitwerk::Loader::Callbacks # :nodoc: all extend Zeitwerk::Internal # Invoked from our decorated Kernel#require when a managed file is autoloaded. # #: (String) -> void ! Zeitwerk::NameError internal def on_file_autoloaded(file) cref = autoloads.delete(file) Zei...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/loader/helpers.rb
lib/zeitwerk/loader/helpers.rb
# frozen_string_literal: true module Zeitwerk::Loader::Helpers # --- Logging ----------------------------------------------------------------------------------- #: (to_s() -> String) -> void private def log(message) method_name = logger.respond_to?(:debug) ? :debug : :call logger.send(method_name, "Zeit...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/loader/config.rb
lib/zeitwerk/loader/config.rb
# frozen_string_literal: true require "set" require "securerandom" module Zeitwerk::Loader::Config extend Zeitwerk::Internal include Zeitwerk::RealModName #: camelize(String, String) -> String attr_accessor :inflector #: call(String) -> void | debug(String) -> void | nil attr_accessor :logger # Absol...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/cref/map.rb
lib/zeitwerk/cref/map.rb
# frozen_string_literal: true # Description of the structure # ---------------------------- # # This class emulates a hash table whose keys are of type Zeitwerk::Cref. # # It is a synchronized 2-level hash. # # The keys of the top one, stored in `@map`, are class and module objects, but # their hash code is forced to ...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/core_ext/kernel.rb
lib/zeitwerk/core_ext/kernel.rb
# frozen_string_literal: true module Kernel module_function # Zeitwerk's main idea is to define autoloads for project constants, and then # intercept them when triggered in this thin `Kernel#require` wrapper. # # That allows us to complete the circle, invoke callbacks, autovivify modules, # define autoloa...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/core_ext/module.rb
lib/zeitwerk/core_ext/module.rb
# frozen_string_literal: true module Zeitwerk::ConstAdded # :nodoc: #: (Symbol) -> void def const_added(cname) if loader = Zeitwerk::Registry.explicit_namespaces.loader_for(self, cname) namespace = const_get(cname, false) cref = Zeitwerk::Cref.new(self, cname) unless namespace.is_a?(Module) ...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/registry/inceptions.rb
lib/zeitwerk/registry/inceptions.rb
module Zeitwerk::Registry # Loaders know their own inceptions, but there is a use case in which we need # to know if a given cpath is an inception globally. This is what this # registry is for. class Inceptions # :nodoc: #: () -> void def initialize @inceptions = Zeitwerk::Cref::Map.new #: Zeitwer...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/registry/loaders.rb
lib/zeitwerk/registry/loaders.rb
module Zeitwerk::Registry class Loaders # :nodoc: #: () -> void def initialize @loaders = [] #: Array[Zeitwerk::Loader] end #: ({ (Zeitwerk::Loader) -> void }) -> void def each(&) @loaders.each(&) end #: (Zeitwerk::Loader) -> void def register(loader) @loaders << lo...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/registry/autoloads.rb
lib/zeitwerk/registry/autoloads.rb
module Zeitwerk::Registry class Autoloads # :nodoc: #: () -> void def initialize @autoloads = {} #: Hash[String, Zeitwerk::Loader] end #: (String, Zeitwerk::Loader) -> Zeitwerk::Loader def register(abspath, loader) @autoloads[abspath] = loader end #: (String) -> Zeitwerk::Loa...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
fxn/zeitwerk
https://github.com/fxn/zeitwerk/blob/f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9/lib/zeitwerk/registry/explicit_namespaces.rb
lib/zeitwerk/registry/explicit_namespaces.rb
# frozen_string_literal: true module Zeitwerk::Registry # A registry for explicit namespaces. # # When a loader determines that a certain file should define an explicit # namespace, it registers it here, associating its cref with itself. # # If the namespace is autoloaded, our const_added callback retrieve...
ruby
MIT
f66f8d2baad1ebc03e8d999254276f7f3e7d3dd9
2026-01-04T15:58:18.390796Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/utils_test.rb
test/utils_test.rb
require_relative "helpers" class UtilsTest < Minitest::Test def test_blank? assert_equal true, Prmd::Utils.blank?(nil) assert_equal true, Prmd::Utils.blank?([]) assert_equal true, Prmd::Utils.blank?({}) assert_equal true, Prmd::Utils.blank?("") assert_equal true, Prmd::Utils.blank?(" ") asser...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/helpers.rb
test/helpers.rb
require "minitest" require "minitest/autorun" require "prmd" require "prmd/cli/base" module Prmd module CLI module Base # silence noop_execute def noop_execute(options = {}) options end end end end module CliBaseTestHelpers def argv_for_test_run [] end def options_for_...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/link_test.rb
test/link_test.rb
require_relative "helpers" module Prmd class LinkTest < Minitest::Test include PrmdLinkTestHelpers [ { title: "no_required", required: {}, optional: { "user:email" => "string", "user:name" => "string" }, }, { title: "parent_required", optional: {}, ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/schema_test.rb
test/schema_test.rb
require_relative "helpers" class SchemaTest < Minitest::Test def test_dereference_with_ref key, value = user_input_schema.dereference( "$ref" => "#/definitions/user/definitions/id", ) assert_equal(key, "#/definitions/user/definitions/id") user_id = user_input_schema["definitions"]["user"]["de...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/multi_loader/common.rb
test/multi_loader/common.rb
require_relative "../helpers" module PrmdLoaderTests # @abstrac def testing_filename end # @abstract def loader_module end def assert_test_data(data) assert_kind_of Hash, data assert_equal "yes", data["test"] assert_kind_of Hash, data["object"] assert_equal "Object", data["object"]["is_...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/multi_loader/toml_test.rb
test/multi_loader/toml_test.rb
require_relative "common" begin require "prmd/multi_loader/toml" rescue LoadError end if defined?(TOML) class PrmdMultiLoaderTomlTest < Minitest::Test include PrmdLoaderTests def loader_module Prmd::MultiLoader::Toml end def testing_filename schemas_path("data/test.toml") end en...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/multi_loader/yaml_test.rb
test/multi_loader/yaml_test.rb
require_relative "common" require "prmd/multi_loader/yaml" class PrmdMultiLoaderYamlTest < Minitest::Test include PrmdLoaderTests def loader_module Prmd::MultiLoader::Yaml end def testing_filename schemas_path("data/test.yaml") end end
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/multi_loader/json_test.rb
test/multi_loader/json_test.rb
require_relative "common" require "prmd/multi_loader/json" class PrmdMultiLoaderJsonTest < Minitest::Test include PrmdLoaderTests def loader_module Prmd::MultiLoader::Json end def testing_filename schemas_path("data/test.json") end end
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/multi_loader/yajl_test.rb
test/multi_loader/yajl_test.rb
require_relative "common" begin require "prmd/multi_loader/yajl" rescue LoadError end if defined?(Yajl) class PrmdMultiLoaderYajlTest < Minitest::Test include PrmdLoaderTests def loader_module Prmd::MultiLoader::Yajl end def testing_filename schemas_path("data/test.json") end en...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/commands/init_test.rb
test/commands/init_test.rb
require_relative "../helpers" class PrmdInitTest < Minitest::Test def test_init Prmd.init("Cake") end end
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/commands/render_test.rb
test/commands/render_test.rb
require_relative "../helpers" require "json_pointer" class InteragentRenderTest < Minitest::Test def test_render_for_valid_schema markdown = render assert_match(/An app in our PaaS ecosystem./, markdown) end def test_render_for_schema_with_property_defined_with_anyOf pointer("#/definitions/app").m...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/commands/combine_test.rb
test/commands/combine_test.rb
require_relative "../helpers" require "json_pointer" class InteragentHyperSchemaCombineTest < Minitest::Test # # resource link readable href # def test_resource_link_href_escaping pointer("#/definitions/app/links/0").merge!({ "href" => "/apps/{(#/definitions/app)}", }) assert_equal "/apps/{...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/commands/verify_test.rb
test/commands/verify_test.rb
require_relative "../helpers" require "json_pointer" class InteragentHyperSchemaVerifyTest < Minitest::Test def test_verifies assert_equal [], verify end # # api (root) # def test_api_required data.delete("title") errors = verify assert_equal 1, errors.count assert_match(/^#: /, erro...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/rake_tasks/combine_test.rb
test/rake_tasks/combine_test.rb
require_relative "../helpers" require "prmd/rake_tasks/combine" require "rake" # due to the nature of these Rake Tests, this should not be executed in a # read-only filesystem or directory. class PrmdRakeTaskCombineTest < Minitest::Test def test_define_wo_options paths = [input_schemas_path("rake_combine")] ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/rake_tasks/doc_test.rb
test/rake_tasks/doc_test.rb
require_relative "../helpers" require "prmd/rake_tasks/doc" require "rake" # due to the nature of these Rake Tests, this should not be executed in a # read-only filesystem or directory. class PrmdRakeTaskDocTest < Minitest::Test def test_define_wo_options input_file = input_schemas_path("rake_doc.json") # ou...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/rake_tasks/verify_test.rb
test/rake_tasks/verify_test.rb
require_relative "../helpers" require "prmd/rake_tasks/verify" require "rake" # due to the nature of these Rake Tests, this should not be executed in a # read-only filesystem or directory. class PrmdRakeTaskVerifyTest < Minitest::Test def test_define_wo_options input_file = input_schemas_path("rake_verify.json")...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/core/reference_localizer_test.rb
test/core/reference_localizer_test.rb
require_relative "../helpers" module Prmd class ReferenceLocalizerTest < Minitest::Test def base_object { "type" => ["object"], "properties" => { "name" => { "type" => ["nil", "string"], "example" => "john", }, "age" => { "ty...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/cli/generate_test.rb
test/cli/generate_test.rb
require_relative "../helpers" require "prmd/cli/generate" class PrmdCliGenerateTest < Minitest::Test include CliBaseTestHelpers def command_module Prmd::CLI::Generate end def argv_for_test_run ["-y", "bread", "-o", "schema/bread.yml",] end def validate_parse_options(options) asse...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/cli/render_test.rb
test/cli/render_test.rb
require_relative "../helpers" require "prmd/cli/render" class PrmdCliRenderTest < Minitest::Test include CliBaseTestHelpers def command_module Prmd::CLI::Render end def argv_for_test_run ["-p", "overview.txt,somethin.txt", "-t", "templates", "-o", "schema/bread.md", "schema/bread.js...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/cli/combine_test.rb
test/cli/combine_test.rb
require_relative "../helpers" require "prmd/cli/combine" class PrmdCliCombineTest < Minitest::Test include CliBaseTestHelpers def command_module Prmd::CLI::Combine end def argv_for_test_run ["-m", "schema/meta.json", "schema/schemata", "-o", "schema/api.json",] end def validate_parse...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/cli/doc_test.rb
test/cli/doc_test.rb
require_relative "../helpers" require "prmd/cli/doc" class PrmdCliDocTest < Minitest::Test include CliBaseTestHelpers def command_module Prmd::CLI::Doc end def argv_for_test_run ["-s", input_schemas_path("doc-settings.json"), "-p", "overview.txt", "schema/api.json", "-o", "schema/ve...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/test/cli/verify_test.rb
test/cli/verify_test.rb
require_relative "../helpers" require "prmd/cli/verify" class PrmdCliVerifyTest < Minitest::Test include CliBaseTestHelpers def command_module Prmd::CLI::Verify end def argv_for_test_run ["-o", "schema/buttered-bread.json", "schema/bread.json",] end def validate_parse_options(options) ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd.rb
lib/prmd.rb
require_relative "prmd/version" require_relative "prmd/load_schema_file" require_relative "prmd/commands" require_relative "prmd/schema" require_relative "prmd/link" require_relative "prmd/utils" require_relative "prmd/template" require_relative "prmd/url_generator" require_relative "prmd/hash_helpers"
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/hash_helpers.rb
lib/prmd/hash_helpers.rb
# :nodoc: module Prmd # Hash helper methods # # @api private module HashHelpers # Attempts to convert all keys in the hash to a Symbol. # This operation is recursive with subhashes # # @param [Hash] hash # @return [Hash] def self.deep_symbolize_keys(hash) deep_transform_keys(hash) ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/version.rb
lib/prmd/version.rb
# :nodoc: module Prmd # Well, duh, its a Version module, what did you expect? module Version MAJOR, MINOR, TEENY, PATCH = 0, 14, 0, nil # version string # @return [String] STRING = [MAJOR, MINOR, TEENY, PATCH].compact.join(".").freeze end # @return [String] VERSION = Version::STRING end
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/utils.rb
lib/prmd/utils.rb
module Prmd # For any tid bits, or core extension methods, without the "core" extension module Utils # For checking if the string contains only spaces BLANK_REGEX = /\A\s+\z/ def self.blank?(obj) if obj.nil? true elsif obj.is_a?(String) obj.empty? || !!(obj =~ BLANK_REGEX) ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/link.rb
lib/prmd/link.rb
require "ostruct" module Prmd class Link def initialize(link_schema) @link_schema = link_schema end def required_and_optional_parameters @params = { required: {}, optional: {} } recurse_properties(Schema.new(@link_schema["schema"]), "") [@params[:required], @params[:optional]] ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/template.rb
lib/prmd/template.rb
require "erubis" require "json" # :nodoc: module Prmd # Template management # # @api private class Template @cache = {} # @return [String] location of the prmd templates directory def self.template_dirname File.join(File.dirname(__FILE__), "templates") end # @param [String] args ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/cli.rb
lib/prmd/cli.rb
require_relative "core_ext/optparse" require_relative "cli/combine" require_relative "cli/doc" require_relative "cli/generate" require_relative "cli/render" require_relative "cli/stub" require_relative "cli/verify" # :nodoc: module Prmd # Main CLI module module CLI # @param [Hash<Symbol, Object>] props # @...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/commands.rb
lib/prmd/commands.rb
require_relative "commands/combine" require_relative "commands/init" require_relative "commands/render" require_relative "commands/verify"
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/multi_loader.rb
lib/prmd/multi_loader.rb
require_relative "multi_loader/json" require_relative "multi_loader/yaml"
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/url_generator.rb
lib/prmd/url_generator.rb
require_relative "url_generators/generators/default" require_relative "url_generators/generators/json" # :nodoc: module Prmd # Schema URL Generation # @api private class UrlGenerator # @param [Hash<Symbol, Object>] params def initialize(params) @schema = params[:schema] @link = params[:link] ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/schema.rb
lib/prmd/schema.rb
require "json" require "yaml" # :nodoc: module Prmd # @api private DefaultExamples = { "boolean" => true, "integer" => 42, "number" => 42.0, "string" => "example", "date" => "2015-01-01", "date-time" => "2015-01-01T12:00:00Z", "email" => "username@example.com", "hostname" => "examp...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/load_schema_file.rb
lib/prmd/load_schema_file.rb
require "yaml" require "json" require_relative "multi_loader" module Prmd # :nodoc: # Attempts to load either a json or yaml file, the type is determined by # filename extension. # # @param [String] filename # @return [Object] data def self.load_schema_file(filename) Prmd::MultiLoader.load_file(filenam...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/multi_loader/yml.rb
lib/prmd/multi_loader/yml.rb
# alias for yaml require_relative "yaml"
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/multi_loader/yajl.rb
lib/prmd/multi_loader/yajl.rb
require_relative "loader" require "yajl" module Prmd # :nodoc: module MultiLoader # :nodoc: # JSON MultiLoader using Yajl module Yajl extend Prmd::MultiLoader::Loader # @see (Prmd::MultiLoader::Loader#load_data) def self.load_data(data) ::Yajl::Parser.parse(data) end #...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/multi_loader/toml.rb
lib/prmd/multi_loader/toml.rb
require_relative "loader" require "toml" module Prmd # :nodoc: module MultiLoader # :nodoc: # TOML MultiLoader module Toml extend Prmd::MultiLoader::Loader # @see (Prmd::MultiLoader::Loader#load_data) def self.load_data(data) ::TOML.load(data) end # register this loade...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/multi_loader/loader.rb
lib/prmd/multi_loader/loader.rb
module Prmd # :nodoc: module MultiLoader # :nodoc: # Exception raised when a extension loader cannot be found. class LoaderNotFound < StandardError end # @return [Hash<String, Prmd::MultiLoader::Loader>] @file_extensions = {} class << self attr_accessor :file_extensions end # ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/multi_loader/yaml.rb
lib/prmd/multi_loader/yaml.rb
require_relative "loader" require "yaml" module Prmd # :nodoc: module MultiLoader # :nodoc: # YAML MultiLoader module Yaml extend Prmd::MultiLoader::Loader # @see (Prmd::MultiLoader::Loader#load_data) def self.load_data(data) ::YAML.load(data) end # register this loade...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/multi_loader/json.rb
lib/prmd/multi_loader/json.rb
require_relative "loader" require "json" module Prmd # :nodoc: module MultiLoader # :nodoc: # JSON MultiLoader module Json extend Prmd::MultiLoader::Loader # @see (Prmd::MultiLoader::Loader#load_data) def self.load_data(data) ::JSON.load(data) end # register this loade...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/commands/verify.rb
lib/prmd/commands/verify.rb
require "json" require "json_schema" # :nodoc: module Prmd # Schema Verification module Verification # These schemas are listed manually and in order because they reference each # other. SCHEMAS = [ "schema.json", "hyper-schema.json", "interagent-hyper-schema.json", ] # @retu...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/commands/combine.rb
lib/prmd/commands/combine.rb
require_relative "../load_schema_file" require_relative "../core/schema_hash" require_relative "../core/combiner" # :nodoc: module Prmd # Schema combine module Combine # @api private # @param [#size] given # @param [#size] expected # @return [void] def self.handle_faulty_load(given, expected) ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/commands/render.rb
lib/prmd/commands/render.rb
require_relative "../core/renderer" # :nodoc: module Prmd # Render helper module module Render # Retrieve the schema template # # @param [Hash<Symbol, Object>] options # @return (see Prmd::Template.load_template) def self.get_template(options) template = options.fetch(:template) do ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/commands/init.rb
lib/prmd/commands/init.rb
require "json" require_relative "../template" require_relative "../core/generator" # :nodoc: module Prmd # Schema generation module Generate # Creates a default Prmd::Generator using default templates # # @return [Prmd::Generator] def self.make_generator(options) base = Prmd::Template.load_js...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/core_ext/optparse.rb
lib/prmd/core_ext/optparse.rb
require "optparse" # Extension of the standard library OptionParser class OptionParser alias_method :to_str, :to_s end
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/rake_tasks/verify.rb
lib/prmd/rake_tasks/verify.rb
require "prmd/commands/verify" require "prmd/rake_tasks/base" require "prmd/load_schema_file" # :nodoc: module Prmd # :nodoc: module RakeTasks # Schema Verify rake task # # @example # Prmd::RakeTasks::Verify.new do |t| # t.files << 'schema/api.json' # end class Verify < Base ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/rake_tasks/doc.rb
lib/prmd/rake_tasks/doc.rb
require "prmd/commands/render" require "prmd/rake_tasks/base" require "prmd/load_schema_file" require "prmd/url_generator" require "prmd/template" require "prmd/schema" require "prmd/link" require_relative "../hash_helpers" # :nodoc: module Prmd # :nodoc: module RakeTasks # Documentation rake task # # ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/rake_tasks/combine.rb
lib/prmd/rake_tasks/combine.rb
require "prmd/commands/combine" require "prmd/rake_tasks/base" # :nodoc: module Prmd # :nodoc: module RakeTasks # Schema combine rake task # # @example # Prmd::RakeTasks::Combine.new do |t| # t.options[:meta] = 'schema/meta.json' # t.paths << 'schema/schemata/api' # t.outp...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/rake_tasks/base.rb
lib/prmd/rake_tasks/base.rb
require "rake" require "rake/tasklib" # :nodoc: module Prmd # :nodoc: module RakeTasks # Common class for Prmd rake tasks # # @api private class Base < Rake::TaskLib # The name of the task # @return [String] the task name attr_accessor :name # Options to pass to command ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/url_generators/generators/default.rb
lib/prmd/url_generators/generators/default.rb
require "cgi" # :nodoc: module Prmd # :nodoc: class UrlGenerator # :nodoc: module Generators # Default URL Generator # # @api private class Default # @param [Hash<Symbol, Object>] params def self.generate(params) data = {} data.merge!(params[:sche...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/url_generators/generators/json.rb
lib/prmd/url_generators/generators/json.rb
require "cgi" # :nodoc: module Prmd # :nodoc: class UrlGenerator # :nodoc: module Generators # JSON URL Generator # # @api private class JSON # @param [Hash<Symbol, Object>] params def self.generate(params) data = {} data.merge!(params[:schema].sc...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/core/schema_hash.rb
lib/prmd/core/schema_hash.rb
require "forwardable" # :nodoc: module Prmd # Specialized Hash for handling loaded Schema data class SchemaHash extend Forwardable # @return [Hash] attr_reader :data # @return [String] attr_reader :filename def_delegator :@data, :[] def_delegator :@data, :[]= def_delegator :@data,...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/core/reference_localizer.rb
lib/prmd/core/reference_localizer.rb
# :nodoc: module Prmd # @api private # Schema references localizer class ReferenceLocalizer attr_reader :object # @param [Object] object def initialize(object) @object = object end # @param [Object] object # @return [ReferenceLocalizer] def self.build(object) case object ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/core/combiner.rb
lib/prmd/core/combiner.rb
require_relative "../schema" require_relative "schema_hash" require_relative "reference_localizer" # :nodoc: module Prmd # Schema combiner class Combiner # # @param [Hash<Symbol, Object>] properties def initialize(properties = {}) @properties = properties @schema = properties.fetch(:schema)...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/core/renderer.rb
lib/prmd/core/renderer.rb
require_relative "../template" # :nodoc: module Prmd # Schema Generator class Renderer # # @param [Hash<Symbol, Object>] properties def initialize(properties = {}) @properties = properties @template = @properties.fetch(:template) end # # @return [Hash<Symbol, Object>] def d...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/core/generator.rb
lib/prmd/core/generator.rb
require "json" require_relative "../schema" # :nodoc: module Prmd # Schema generator class Generator # # @param [Hash<Symbol, Object>] properties def initialize(properties = {}) @properties = properties @base = properties.fetch(:base, {}) @template = properties.fetch(:template) en...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/cli/generate.rb
lib/prmd/cli/generate.rb
require_relative "base" require_relative "../commands/init" require_relative "../utils" module Prmd module CLI # 'init' command module. # Though this is called, Generate, it is used by the init method for # creating new Schema files module Generate extend CLI::Base # Returns a OptionPars...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/cli/verify.rb
lib/prmd/cli/verify.rb
require_relative "base" require_relative "../commands/verify" module Prmd module CLI # 'verify' command module. module Verify extend CLI::Base # Returns a OptionParser for parsing 'verify' command options. # # @param (see Prmd::CLI::Base#make_parser) # @return (see Prmd::CLI::B...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/cli/doc.rb
lib/prmd/cli/doc.rb
require_relative "base" require_relative "../commands/render" require_relative "../hash_helpers" module Prmd module CLI # 'doc' command module. module Doc extend CLI::Base # Returns a OptionParser for parsing 'doc' command options. # # @param (see Prmd::CLI::Base#make_parser) #...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/cli/combine.rb
lib/prmd/cli/combine.rb
require_relative "base" require_relative "../commands/combine" module Prmd module CLI # 'combine' command module. module Combine extend CLI::Base # Returns a OptionParser for parsing 'combine' command options. # # @param (see Prmd::CLI::Base#make_parser) # @return (see Prmd::CL...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/cli/render.rb
lib/prmd/cli/render.rb
require_relative "base" require_relative "../commands/render" module Prmd module CLI # 'render' command module. module Render extend CLI::Base # Returns a OptionParser for parsing 'render' command options. # # @param (see Prmd::CLI::Base#make_parser) # @return (see Prmd::CLI::B...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/cli/stub.rb
lib/prmd/cli/stub.rb
require_relative "base" module Prmd module CLI # 'stub' command module' module Stub extend CLI::Base # Returns a OptionParser for parsing 'stub' command options. # # @param (see Prmd::CLI::Base#make_parser) # @return (see Prmd::CLI::Base#make_parser) def self.make_parser(...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
interagent/prmd
https://github.com/interagent/prmd/blob/5f463e021a4573f1cf09a1932dc990d9d03bcddc/lib/prmd/cli/base.rb
lib/prmd/cli/base.rb
require "json" require_relative "../core_ext/optparse" require_relative "../load_schema_file" module Prmd module CLI # Base module for CLI commands. # @api module Base # Create a parser specific for this command. # The parsers produced by this method should yield their options. # ...
ruby
MIT
5f463e021a4573f1cf09a1932dc990d9d03bcddc
2026-01-04T15:58:20.125204Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/schema.rb
spec/schema.rb
# encoding: UTF-8 # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative sou...
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/spec_helper.rb
spec/spec_helper.rb
require 'simplecov' SimpleCov.start require 'bundler/setup' require "logger" require 'counter_culture' $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'active_record' module PapertrailSupport def self.supported_here? true end end module ...
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/counter_culture_spec.rb
spec/counter_culture_spec.rb
require_relative 'spec_helper' require 'models/company' require 'models/comment' require 'models/industry' require 'models/product' require 'models/review' require 'models/simple_review' require 'models/twitter_review' require 'models/user' require 'models/admin_user' require 'models/category' require 'models/has_stri...
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
true
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/counter_culture/configuration_spec.rb
spec/counter_culture/configuration_spec.rb
require 'spec_helper' RSpec.describe CounterCulture::Configuration do after(:each) do CounterCulture.reset_configuration end describe '.configure' do it 'works according to the Rails version' do if Gem::Requirement.new('>= 7.1.0').satisfied_by?(ActiveRecord.version) CounterCulture.configur...
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/models/poly_image.rb
spec/models/poly_image.rb
class PolyImage < ActiveRecord::Base belongs_to :imageable, polymorphic: true belongs_to :imageable_from_uid, polymorphic: true, foreign_key: :imageable_uid, foreign_type: :imageable_type, primary_key: :uid counter_culture :imageable counter_culture :imageable_from_uid, column_name: 'poly_images_from_uids_count...
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/models/twitter_review.rb
spec/models/twitter_review.rb
class TwitterReview < Review counter_culture :product, column_name: 'twitter_reviews_count' counter_culture [:user, :manages_company] counter_culture [:admin_user, :manages_company], :column_name => 'admin_reviews_count' end
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/models/composite_user.rb
spec/models/composite_user.rb
class CompositeUser < ActiveRecord::Base has_many :composite_group_users, dependent: :destroy has_many :composite_groups, through: :composite_group_users end
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/models/candidate.rb
spec/models/candidate.rb
class Candidate < ActiveRecord::Base has_one :candidate_profile, inverse_of: :candidate end
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/models/poly_product.rb
spec/models/poly_product.rb
class PolyProduct < ActiveRecord::Base self.primary_key = :pp_pk_id has_many :poly_images, as: :imageable has_many :poly_images_from_uids, as: :imageable_from_uid, class_name: 'PolyImage', foreign_key: :imageable_uid, primary_key: :uid before_create :set_uid def set_uid self.uid = Secu...
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/models/conditional_dependent.rb
spec/models/conditional_dependent.rb
class ConditionalDependent < ActiveRecord::Base belongs_to :conditional_main counter_culture :conditional_main, column_name: proc {|m| m.condition? ? 'conditional_dependents_count' : nil }, column_names: { ['conditional_dependents.condition = ?', true] => 'conditional_dependents_count' } end
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/models/categ.rb
spec/models/categ.rb
class Categ < ActiveRecord::Base CAT_1 = 0 CAT_2 = 1 self.primary_key = :cat_id has_many :subcategs, :foreign_key => :fk_subcat_id def cat_id # required for Rails 3.2 compatibility read_attribute(:cat_id) end end
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/models/poly_employee.rb
spec/models/poly_employee.rb
class PolyEmployee < ActiveRecord::Base has_many :poly_images, as: :imageable has_many :poly_images_from_uids, as: :imageable_from_uid, class_name: 'PolyImage', foreign_key: :imageable_uid, foreign_type: :imageable_type, primary_key: :uid before_create :set_uid def set_uid self.uid...
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/models/group.rb
spec/models/group.rb
class Group < ActiveRecord::Base has_many :sub_groups end
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/models/simple_review.rb
spec/models/simple_review.rb
class SimpleReview < Review counter_culture :product end
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/models/sub_group.rb
spec/models/sub_group.rb
class SubGroup < ActiveRecord::Base self.primary_key = "uuid" has_many :group_items, foreign_key: 'sub_group_uuid' belongs_to :group before_create do self.uuid = SecureRandom.uuid end end
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/models/review.rb
spec/models/review.rb
class Review < ActiveRecord::Base belongs_to :user, optional: true belongs_to :admin_user, optional: true belongs_to :product, optional: true counter_culture :product, :touch => true, :with_papertrail => PapertrailSupport.supported_here? counter_culture :product, :column_name => 'rexiews_count', touch: :rexi...
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/models/post_like.rb
spec/models/post_like.rb
class PostLike < ActiveRecord::Base belongs_to :post, :foreign_key => 'post_id' counter_culture :post, :column_name => :likes_count, touch: true end
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false
magnusvk/counter_culture
https://github.com/magnusvk/counter_culture/blob/494e0ec01d1cd61dfed59e9c40e95902538fe981/spec/models/article_group.rb
spec/models/article_group.rb
class ArticleGroup < ActiveRecord::Base has_many :articles end
ruby
MIT
494e0ec01d1cd61dfed59e9c40e95902538fe981
2026-01-04T15:58:21.279457Z
false