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
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/commands/class_interface.rb
core/lib/rom/commands/class_interface.rb
# frozen_string_literal: true require 'rom/support/inflector' module ROM # Base command class with factory class-level interface and setup-related logic # # @private class Command module ClassInterface # This hook sets up default class state # # @api private def inherited(klass) ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/commands/graph/input_evaluator.rb
core/lib/rom/commands/graph/input_evaluator.rb
# frozen_string_literal: true module ROM module Commands class Graph # Evaluator for lazy commands which extracts values for commands from nested hashes # # @api private class InputEvaluator include Dry::Equalizer(:tuple_path, :excluded_keys) # @!attribute [r] tuple_path ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/commands/graph/class_interface.rb
core/lib/rom/commands/graph/class_interface.rb
# frozen_string_literal: true require 'rom/commands/graph/input_evaluator' module ROM module Commands class Graph # Class methods for command Graph # # @api private module ClassInterface # Build a command graph recursively # # This is used by `Container#command` w...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/commands/lazy/update.rb
core/lib/rom/commands/lazy/update.rb
# frozen_string_literal: true module ROM module Commands class Lazy # Lazy command wrapper for update commands # # @api public class Update < Lazy # Execute a lazy update command # # @see Commands::Update#call # # @return [Hash, Array<Hash>] ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/commands/lazy/delete.rb
core/lib/rom/commands/lazy/delete.rb
# frozen_string_literal: true module ROM module Commands class Lazy # Lazy command wrapper for delete commands # # @api public class Delete < Lazy # Execute a lazy delete command # # @see Commands::Delete#call # # @return [Hash, Array<Hash>] ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/commands/lazy/create.rb
core/lib/rom/commands/lazy/create.rb
# frozen_string_literal: true module ROM module Commands class Lazy # Lazy command wrapper for create commands # # @api public class Create < Lazy # Execute a command # # @see Command::Create#call # # @return [Hash,Array<Hash>] # # @...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/processor/transproc.rb
core/lib/rom/processor/transproc.rb
# frozen_string_literal: true require 'transproc/all' require 'rom/processor' module ROM class Processor # Data mapping transformer builder using Transproc # # This builds a transproc function that is used to map a whole relation # # @see https://github.com/solnic/transproc too # # @pri...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/memory/storage.rb
core/lib/rom/memory/storage.rb
# frozen_string_literal: true require 'concurrent/hash' require 'concurrent/array' require 'rom/memory/dataset' module ROM module Memory # In-memory thread-safe data storage # # @private class Storage # Dataset registry # # @return [ThreadSafe::Hash] # # @api private ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/memory/gateway.rb
core/lib/rom/memory/gateway.rb
# frozen_string_literal: true require 'rom/gateway' require 'rom/memory/storage' require 'rom/memory/commands' module ROM module Memory # In-memory gateway interface # # @example # gateway = ROM::Memory::Gateway.new # gateway.dataset(:users) # gateway[:users].insert(name: 'Jane') #...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/memory/relation.rb
core/lib/rom/memory/relation.rb
# frozen_string_literal: true require 'rom/memory/types' require 'rom/memory/schema' module ROM module Memory # Relation subclass for memory adapter # # @example # class Users < ROM::Relation[:memory] # end # # @api public class Relation < ROM::Relation include Enumerable ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/memory/dataset.rb
core/lib/rom/memory/dataset.rb
# frozen_string_literal: true require 'rom/array_dataset' module ROM module Memory # In-memory dataset # # This class can be used as a base class for other adapters. # # @api public class Dataset include ArrayDataset # Join with other datasets # # @param [Array<Datas...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/memory/types.rb
core/lib/rom/memory/types.rb
# frozen_string_literal: true require 'rom/types' module ROM module Memory module Types include ROM::Types end end end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/memory/commands.rb
core/lib/rom/memory/commands.rb
# frozen_string_literal: true require 'rom/commands' module ROM module Memory # Memory adapter commands namespace # # @api public module Commands # In-memory create command # # @api public class Create < ROM::Commands::Create adapter :memory use :schema ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/memory/associations.rb
core/lib/rom/memory/associations.rb
# frozen_string_literal: true require 'rom/memory/associations/many_to_many' require 'rom/memory/associations/many_to_one' require 'rom/memory/associations/one_to_many' require 'rom/memory/associations/one_to_one'
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/memory/mapper_compiler.rb
core/lib/rom/memory/mapper_compiler.rb
# frozen_string_literal: true require 'rom/mapper_compiler' module ROM module Memory class MapperCompiler < ROM::MapperCompiler end end end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/memory/schema.rb
core/lib/rom/memory/schema.rb
# frozen_string_literal: true require 'rom/schema' require 'rom/memory/associations' module ROM module Memory # Specialized schema for memory adapter # # @api public class Schema < ROM::Schema # @see Schema#call # @api public def call(relation) relation.new(relation.dataset...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/memory/associations/one_to_one.rb
core/lib/rom/memory/associations/one_to_one.rb
# frozen_string_literal: true require 'rom/memory/associations/one_to_many' module ROM module Memory module Associations class OneToOne < OneToMany end end end end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/memory/associations/many_to_one.rb
core/lib/rom/memory/associations/many_to_one.rb
# frozen_string_literal: true require 'rom/associations/many_to_one' module ROM module Memory module Associations class ManyToOne < ROM::Associations::ManyToOne end end end end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/memory/associations/many_to_many.rb
core/lib/rom/memory/associations/many_to_many.rb
# frozen_string_literal: true require 'rom/associations/many_to_many' module ROM module Memory module Associations class ManyToMany < ROM::Associations::ManyToMany end end end end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/memory/associations/one_to_many.rb
core/lib/rom/memory/associations/one_to_many.rb
# frozen_string_literal: true require 'rom/associations/one_to_many' module ROM module Memory module Associations class OneToMany < ROM::Associations::OneToMany end end end end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/plugins/command/timestamps.rb
core/lib/rom/plugins/command/timestamps.rb
# frozen_string_literal: true require 'set' module ROM module Plugins module Command # A plugin for automatically adding timestamp values # when executing a command # # Set up attributes to timestamp when the command is called # # @example # class CreateTask < ROM::Co...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/plugins/command/schema.rb
core/lib/rom/plugins/command/schema.rb
# frozen_string_literal: true module ROM module Plugins module Command # Command plugin which sets input processing function via relation schema # # @api private module Schema def self.included(klass) super klass.extend(ClassInterface) end # @a...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/plugins/schema/timestamps.rb
core/lib/rom/plugins/schema/timestamps.rb
# frozen_string_literal: true module ROM module Plugins module Schema # A plugin for automatically adding timestamp fields # to the schema definition # # @example # schema do # use :timestamps # end # # # using non-default names # schema do ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/plugins/relation/registry_reader.rb
core/lib/rom/plugins/relation/registry_reader.rb
# frozen_string_literal: true require 'rom/constants' module ROM module Plugins module Relation # Allows relations to access all other relations through registry # # For now this plugin is always enabled # # @api public class RegistryReader < ::Module EMPTY_REGISTRY =...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/plugins/relation/instrumentation.rb
core/lib/rom/plugins/relation/instrumentation.rb
# frozen_string_literal: true module ROM module Plugins module Relation # Experimental plugin for configuring relations with an external # instrumentation system like dry-monitor or ActiveSupport::Notifications # # @api public module Instrumentation extend Dry::Core::ClassAt...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/setup/finalize.rb
core/lib/rom/setup/finalize.rb
# frozen_string_literal: true require 'rom/relation' require 'rom/command' require 'rom/registry' require 'rom/command_registry' require 'rom/mapper_registry' require 'rom/container' require 'rom/setup/finalize/finalize_commands' require 'rom/setup/finalize/finalize_relations' require 'rom/setup/finalize/finalize_ma...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/setup/auto_registration.rb
core/lib/rom/setup/auto_registration.rb
# frozen_string_literal: true require 'pathname' require 'rom/support/inflector' require 'rom/types' require 'rom/initializer' require 'rom/setup/auto_registration_strategies/no_namespace' require 'rom/setup/auto_registration_strategies/with_namespace' require 'rom/setup/auto_registration_strategies/custom_namespace...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/setup/finalize/finalize_relations.rb
core/lib/rom/setup/finalize/finalize_relations.rb
# frozen_string_literal: true require 'rom/constants' require 'rom/relation_registry' require 'rom/mapper_registry' module ROM class Finalize class FinalizeRelations attr_reader :notifications class RegistryReaders < ::Module def initialize(relations) super() relations....
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/setup/finalize/finalize_mappers.rb
core/lib/rom/setup/finalize/finalize_mappers.rb
# frozen_string_literal: true require 'rom/registry' module ROM class Finalize class FinalizeMappers attr_reader :mapper_classes attr_reader :mapper_objects attr_reader :registry_hash # @api private def initialize(mapper_classes, mapper_objects) @mapper_classes = mapper_cl...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/setup/finalize/finalize_commands.rb
core/lib/rom/setup/finalize/finalize_commands.rb
# frozen_string_literal: true require 'rom/registry' require 'rom/command_compiler' require 'rom/command_registry' module ROM class Finalize class FinalizeCommands attr_reader :notifications # Build command registry hash for provided relations # # @param [RelationRegistry] relations reg...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/setup/auto_registration_strategies/with_namespace.rb
core/lib/rom/setup/auto_registration_strategies/with_namespace.rb
# frozen_string_literal: true require 'pathname' require 'rom/support/inflector' require 'rom/setup/auto_registration_strategies/base' module ROM module AutoRegistrationStrategies # WithNamespace strategy assumes components are defined within a namespace # that matches top-level directory name. # #...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/setup/auto_registration_strategies/custom_namespace.rb
core/lib/rom/setup/auto_registration_strategies/custom_namespace.rb
# frozen_string_literal: true require 'pathname' require 'rom/support/inflector' require 'rom/types' require 'rom/setup/auto_registration_strategies/base' module ROM module AutoRegistrationStrategies # Custom namespace strategy loads components and assumes they are defined # within the provided namespace ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/setup/auto_registration_strategies/no_namespace.rb
core/lib/rom/setup/auto_registration_strategies/no_namespace.rb
# frozen_string_literal: true require 'pathname' require 'rom/support/inflector' require 'rom/types' require 'rom/setup/auto_registration_strategies/base' module ROM module AutoRegistrationStrategies # NoNamespace strategy assumes components are not defined within a namespace # # @api private class...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/setup/auto_registration_strategies/base.rb
core/lib/rom/setup/auto_registration_strategies/base.rb
# frozen_string_literal: true require 'rom/types' require 'rom/initializer' module ROM module AutoRegistrationStrategies # Base class for registration strategies # # @api private class Base extend Initializer PathnameType = Types.Instance(Pathname) EXTENSION_REGEX = /\.rb\z/ ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/core/version.rb
core/lib/rom/core/version.rb
# frozen_string_literal: true module ROM module Core VERSION = '5.4.3' end end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/header/attribute.rb
core/lib/rom/header/attribute.rb
# frozen_string_literal: true module ROM class Header # An attribute provides information about a specific attribute in a tuple # # This may include information about how an attribute should be renamed, # or how its value should coerced. # # More complex attributes describe how an attribute s...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/mapper/attribute_dsl.rb
core/lib/rom/mapper/attribute_dsl.rb
# frozen_string_literal: true require 'rom/header' require 'rom/mapper/model_dsl' module ROM class Mapper # Mapper attribute DSL exposed by mapper subclasses # # This class is private even though its methods are exposed by mappers. # Typically it's not meant to be used directly. # # TODO: br...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/mapper/dsl.rb
core/lib/rom/mapper/dsl.rb
# frozen_string_literal: true require 'rom/mapper/attribute_dsl' module ROM class Mapper # Mapper class-level DSL including Attribute DSL and Model DSL module DSL # Extend mapper class with macros and DSL methods # # @api private def self.included(klass) klass.extend(Dry::Cor...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/mapper/builder.rb
core/lib/rom/mapper/builder.rb
# frozen_string_literal: true module ROM class Mapper # Setup DSL-specific mapper extensions # # @private class Builder # Generate a mapper subclass # # This is used by Setup#mappers DSL # # @api private def self.build_class(name, mapper_registry, options = EMPTY_H...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/mapper/model_dsl.rb
core/lib/rom/mapper/model_dsl.rb
# frozen_string_literal: true require 'rom/model_builder' module ROM class Mapper # Model DSL allows setting a model class # # @private module ModelDSL attr_reader :attributes attr_reader :builder attr_reader :klass DEFAULT_TYPE = :poro # Set or generate a model ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/schema/inferrer.rb
core/lib/rom/schema/inferrer.rb
# frozen_string_literal: true module ROM class Schema # @api private class Inferrer extend Dry::Core::ClassAttributes extend Initializer # @!method self.attributes_inferrer # @overload attributes_inferrer # @return [Proc] # # @overload attributes_inferrer(va...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/schema/dsl.rb
core/lib/rom/schema/dsl.rb
# frozen_string_literal: true require 'rom/types' require 'rom/attribute' require 'rom/schema/associations_dsl' module ROM class Schema # Schema DSL exposed as `schema { .. }` in relation classes # # @api public class DSL < ::BasicObject KERNEL_METHODS = %i[extend method block_given?].freeze ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/schema/associations_dsl.rb
core/lib/rom/schema/associations_dsl.rb
# frozen_string_literal: true require 'rom/support/inflector' require 'rom/associations/definitions' module ROM class Schema # Additional schema DSL for definition SQL associations # # This DSL is exposed in `associations do .. end` blocks in schema defintions. # # @api public class Associa...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/associations/one_to_one.rb
core/lib/rom/associations/one_to_one.rb
# frozen_string_literal: true require 'rom/associations/one_to_many' module ROM module Associations # Abstract one-to-one association type # # @api public class OneToOne < OneToMany end end end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/associations/many_to_one.rb
core/lib/rom/associations/many_to_one.rb
# frozen_string_literal: true require 'rom/associations/abstract' module ROM module Associations # Abstract many-to-one association type # # @api public class ManyToOne < Abstract # Adapters must implement this method # # @abstract # # @api public def call(*) ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/associations/definitions.rb
core/lib/rom/associations/definitions.rb
# frozen_string_literal: true require 'rom/associations/definitions/many_to_many' require 'rom/associations/definitions/many_to_one' require 'rom/associations/definitions/one_to_many' require 'rom/associations/definitions/one_to_one' require 'rom/associations/definitions/one_to_one_through'
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/associations/many_to_many.rb
core/lib/rom/associations/many_to_many.rb
# frozen_string_literal: true require 'rom/types' require 'rom/associations/abstract' module ROM module Associations # Abstract many-to-many association type # # @api public class ManyToMany < Abstract # @!attribute [r] join_relation # @return [Relation] Intermediate join relation ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/associations/one_to_many.rb
core/lib/rom/associations/one_to_many.rb
# frozen_string_literal: true require 'rom/associations/abstract' module ROM module Associations # Abstract one-to-many association # # @api public class OneToMany < Abstract # Adapters must implement this method # # @abstract # # @api public def call(*) r...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/associations/abstract.rb
core/lib/rom/associations/abstract.rb
# frozen_string_literal: true require 'rom/initializer' require 'rom/support/memoizable' module ROM module Associations # Abstract association class # # @api public class Abstract extend Initializer include Memoizable include Dry::Equalizer(:definition, :source, :target) # ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/associations/one_to_one_through.rb
core/lib/rom/associations/one_to_one_through.rb
# frozen_string_literal: true require 'rom/associations/many_to_many' module ROM module Associations # Abstract one-to-one-through association type # # @api public class OneToOneThrough < ManyToMany end end end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/associations/through_identifier.rb
core/lib/rom/associations/through_identifier.rb
# frozen_string_literal: true require 'rom/support/inflector' module ROM module Associations # @api private class ThroughIdentifier # @api private attr_reader :source # @api private attr_reader :target # @api private attr_reader :assoc_name # @api private d...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/associations/definitions/one_to_one.rb
core/lib/rom/associations/definitions/one_to_one.rb
# frozen_string_literal: true require 'rom/associations/definitions/abstract' module ROM module Associations module Definitions # @api private class OneToOne < Abstract result :one end end end end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/associations/definitions/many_to_one.rb
core/lib/rom/associations/definitions/many_to_one.rb
# frozen_string_literal: true require 'rom/associations/definitions/abstract' module ROM module Associations module Definitions # @api private class ManyToOne < Abstract result :one end end end end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/associations/definitions/many_to_many.rb
core/lib/rom/associations/definitions/many_to_many.rb
# frozen_string_literal: true require 'rom/types' require 'rom/associations/definitions/abstract' module ROM module Associations module Definitions # @api private class ManyToMany < Abstract result :many # @!attribute [r] through # @return [ThroughIdentifier] The name of t...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/associations/definitions/one_to_many.rb
core/lib/rom/associations/definitions/one_to_many.rb
# frozen_string_literal: true require 'rom/associations/definitions/abstract' module ROM module Associations module Definitions # @api private class OneToMany < Abstract result :many end end end end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/associations/definitions/abstract.rb
core/lib/rom/associations/definitions/abstract.rb
# frozen_string_literal: true require 'rom/constants' require 'rom/types' require 'rom/initializer' require 'rom/relation/name' require 'rom/associations/through_identifier' module ROM module Associations module Definitions # Abstract association definition object # # @api public class A...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/associations/definitions/one_to_one_through.rb
core/lib/rom/associations/definitions/one_to_one_through.rb
# frozen_string_literal: true require 'rom/associations/definitions/abstract' module ROM module Associations module Definitions # @api private class OneToOneThrough < ManyToMany result :one end end end end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/relation/combined.rb
core/lib/rom/relation/combined.rb
# frozen_string_literal: true require 'rom/relation/graph' require 'rom/relation/commands' module ROM class Relation # Represents a relation graphs which combines root relation # with other relation nodes # # @api public class Combined < Graph include Commands # Create a new relatio...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/relation/composite.rb
core/lib/rom/relation/composite.rb
# frozen_string_literal: true require 'rom/relation/loaded' require 'rom/relation/materializable' require 'rom/pipeline' module ROM class Relation # Left-to-right relation composition used for data-pipelining # # @api public class Composite < Pipeline::Composite include Materializable #...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/relation/graph.rb
core/lib/rom/relation/graph.rb
# frozen_string_literal: true require 'rom/initializer' require 'rom/relation/loaded' require 'rom/relation/composite' require 'rom/relation/materializable' require 'rom/pipeline' require 'rom/support/memoizable' module ROM class Relation # Abstract relation graph class # # @api public class Graph ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/relation/view_dsl.rb
core/lib/rom/relation/view_dsl.rb
# frozen_string_literal: true module ROM class Relation # ViewDSL is exposed in `Relation.view` method # # This is used to establish pre-defined relation views with explicit schemas. # Such views can be used to compose relations together, even from multiple # adapters. In advanced adapters like r...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/relation/curried.rb
core/lib/rom/relation/curried.rb
# frozen_string_literal: true require 'rom/types' require 'rom/initializer' require 'rom/pipeline' require 'rom/relation/name' require 'rom/relation/materializable' require 'rom/relation/graph' require 'rom/relation/wrap' require 'rom/relation/composite' module ROM class Relation # Curried relation is a special...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/relation/name.rb
core/lib/rom/relation/name.rb
# frozen_string_literal: true require 'concurrent/map' module ROM class Relation # Relation name container # # This is a simple struct with two fields. # It handles both relation registration name (i.e. Symbol) and dataset name. # The reason we need it is a simplification of passing around these...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/relation/materializable.rb
core/lib/rom/relation/materializable.rb
# frozen_string_literal: true module ROM class Relation # Interface for objects that can be materialized into a loaded relation # # @api public module Materializable # Coerce the relation to an array # # @return [Array] # # @api public def to_a = call.to_a al...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/relation/wrap.rb
core/lib/rom/relation/wrap.rb
# frozen_string_literal: true require 'rom/relation/graph' require 'rom/relation/combined' module ROM class Relation # Relation wrapping other relations # # @api public class Wrap < Graph # Wrap more relations # # @see Relation#wrap # # @return [Wrap] # # @a...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/relation/commands.rb
core/lib/rom/relation/commands.rb
# frozen_string_literal: true module ROM class Relation # Extensions for relation classes which provide access to commands # # @api public module Commands # Return a command for the relation # # This method can either return an existing custom command identified # by `type` pa...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/relation/class_interface.rb
core/lib/rom/relation/class_interface.rb
# frozen_string_literal: true require 'set' require 'rom/support/inflector' require 'rom/constants' require 'rom/relation/name' require 'rom/relation/view_dsl' require 'rom/schema' require 'rom/support/notifications' module ROM class Relation # Global class-level API for relation classes # # @api publ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/relation/loaded.rb
core/lib/rom/relation/loaded.rb
# frozen_string_literal: true module ROM class Relation # Materializes a relation and exposes interface to access the data. # # This relation type is returned when a lazy relation is called # # @api public class Loaded include ::Enumerable include ::Dry::Equalizer(:source, :collec...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/test/test_helper.rb
test/test_helper.rb
# frozen_string_literal: true require "bundler/setup" require "minitest/autorun" require "mocha/minitest" # Configure Rails ENV["RAILS_ENV"] = "test" require "active_support" require "active_model" require "rails/engine" require "rails/railtie" $:.unshift File.expand_path("../../lib", __FILE__) require "responders"...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/test/support/models.rb
test/support/models.rb
# frozen_string_literal: true class Customer < Struct.new(:name, :id) extend ActiveModel::Naming include ActiveModel::Conversion def to_json(*) to_h.to_json end def to_xml(options = {}) if options[:builder] options[:builder].name name else "<name>#{name}</name>" end end def...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/test/responders/controller_method_test.rb
test/responders/controller_method_test.rb
# frozen_string_literal: true require "test_helper" ActionController::Base.extend Responders::ControllerMethod module FooResponder def to_html @resource << "foo" super end end module BarResponder def to_html @resource << "bar" super end end module PeopleResponder def to_html @resource...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/test/responders/flash_responder_test.rb
test/responders/flash_responder_test.rb
# frozen_string_literal: true require "test_helper" class FlashResponder < ActionController::Responder include Responders::FlashResponder end class AddressesController < ApplicationController before_action :set_resource self.responder = FlashResponder respond_to :js, only: :create FLASH_PARAM_VALUES = { ...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/test/responders/collection_responder_test.rb
test/responders/collection_responder_test.rb
# frozen_string_literal: true require "test_helper" class CollectionResponder < ActionController::Responder include Responders::CollectionResponder end class CollectionController < ApplicationController self.responder = CollectionResponder def single respond_with Address.new end def namespaced re...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/test/responders/http_cache_responder_test.rb
test/responders/http_cache_responder_test.rb
# frozen_string_literal: true require "test_helper" class HttpCacheResponder < ActionController::Responder include Responders::HttpCacheResponder end class HttpCacheController < ApplicationController self.responder = HttpCacheResponder HTTP_CACHE_PARAM_VALUES = { "false" => false } def single http_cach...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/test/action_controller/respond_with_api_test.rb
test/action_controller/respond_with_api_test.rb
# frozen_string_literal: true require "test_helper" require "support/models" class ApiRespondWithController < ActionController::API respond_to :json def index respond_with [ Customer.new("Foo", 1), Customer.new("Bar", 2), ] end def create respond_with Customer.new("Foo", 1), location...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/test/action_controller/respond_with_test.rb
test/action_controller/respond_with_test.rb
# frozen_string_literal: true require "test_helper" require "support/models" class RespondWithController < ApplicationController class CustomerWithJson < Customer def to_json(*); super; end end respond_to :html, :json, :touch respond_to :xml, except: :using_resource_with_block respond_to :js, only: [ ...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/test/action_controller/verify_requested_format_test.rb
test/action_controller/verify_requested_format_test.rb
# frozen_string_literal: true require "test_helper" class ThingsController < ApplicationController clear_respond_to respond_to :js respond_to :html, only: [:show, :new] before_action :verify_requested_format! attr_reader :called def action @called = true render inline: action_name end ali...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/lib/responders.rb
lib/responders.rb
# frozen_string_literal: true require "action_controller" require "rails/railtie" module ActionController autoload :Responder, "action_controller/responder" autoload :RespondWith, "action_controller/respond_with" end module Responders autoload :FlashResponder, "responders/flash_responder" autoload :Http...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/lib/responders/version.rb
lib/responders/version.rb
# frozen_string_literal: true module Responders VERSION = "3.2.0" end
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/lib/responders/collection_responder.rb
lib/responders/collection_responder.rb
# frozen_string_literal: true module Responders # This responder modifies your current responder to redirect # to the collection page on POST/PUT/DELETE. module CollectionResponder protected # Returns the collection location for redirecting after POST/PUT/DELETE. # This method, converts the followin...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/lib/responders/flash_responder.rb
lib/responders/flash_responder.rb
# frozen_string_literal: true module Responders # Responder to automatically set flash messages based on I18n API. It checks for # message based on the current action, but also allows defaults to be set, using # the following order: # # flash.controller_name.action_name.status # flash.actions.action_na...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/lib/responders/controller_method.rb
lib/responders/controller_method.rb
# frozen_string_literal: true module Responders module ControllerMethod # Adds the given responders to the current controller's responder, allowing you to cherry-pick # which responders you want per controller. # # class InvitationsController < ApplicationController # responders :flash, :ht...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/lib/responders/http_cache_responder.rb
lib/responders/http_cache_responder.rb
# frozen_string_literal: true module Responders # Set HTTP Last-Modified headers based on the given resource. It's used only # on API behavior (to_format) and is useful for a client to check in the server # if a resource changed after a specific date or not. # # This is not usually not used in html requests ...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/lib/generators/responders/install_generator.rb
lib/generators/responders/install_generator.rb
# frozen_string_literal: true module Responders module Generators class InstallGenerator < Rails::Generators::Base source_root File.expand_path("..", __FILE__) desc "Creates an initializer with default responder configuration and copy locale file" def create_responder_file create_file...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/lib/generators/rails/responders_controller_generator.rb
lib/generators/rails/responders_controller_generator.rb
# frozen_string_literal: true require "rails/generators/rails/scaffold_controller/scaffold_controller_generator" module Rails module Generators class RespondersControllerGenerator < ScaffoldControllerGenerator source_root File.expand_path("../templates", __FILE__) protected def flash? ...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/lib/action_controller/respond_with.rb
lib/action_controller/respond_with.rb
# frozen_string_literal: true require "active_support/core_ext/array/extract_options" require "action_controller/metal/mime_responds" module ActionController # :nodoc: module RespondWith extend ActiveSupport::Concern included do class_attribute :responder, :mimes_for_respond_to self.responder =...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
heartcombo/responders
https://github.com/heartcombo/responders/blob/63c37fcb36eb9299361d4c846f60ca11ec1d90da/lib/action_controller/responder.rb
lib/action_controller/responder.rb
# frozen_string_literal: true require "active_support/json" module ActionController # :nodoc: # Responsible for exposing a resource to different mime requests, # usually depending on the HTTP verb. The responder is triggered when # <code>respond_with</code> is called. The simplest case to study is a GET request...
ruby
MIT
63c37fcb36eb9299361d4c846f60ca11ec1d90da
2026-01-04T15:58:50.598296Z
false
ankane/dexter
https://github.com/ankane/dexter/blob/bc8d0905269f4336d5d23a39696f9fc4f452ce48/test/batching_test.rb
test/batching_test.rb
require_relative "test_helper" class BatchingTest < Minitest::Test def test_many_queries skip unless ENV["TEST_BATCHING"] nc = 100 create_table(nc) queries = [] nc.times do |i| (i + 1).upto(nc - 1) do |j| queries << "SELECT * FROM t WHERE c%02d = 0 AND c%02d = 1" % [i, j] en...
ruby
MIT
bc8d0905269f4336d5d23a39696f9fc4f452ce48
2026-01-04T15:58:45.791976Z
false
ankane/dexter
https://github.com/ankane/dexter/blob/bc8d0905269f4336d5d23a39696f9fc4f452ce48/test/input_test.rb
test/input_test.rb
require_relative "test_helper" class InputTest < Minitest::Test def test_stderr assert_index_file "queries.log" end def test_csv assert_index_file "queries.csv" end def test_csv_invalid assert_error "Illegal quoting", support_path("queries.json"), "--input-format", "csv" end def test_json ...
ruby
MIT
bc8d0905269f4336d5d23a39696f9fc4f452ce48
2026-01-04T15:58:45.791976Z
false
ankane/dexter
https://github.com/ankane/dexter/blob/bc8d0905269f4336d5d23a39696f9fc4f452ce48/test/create_test.rb
test/create_test.rb
require_relative "test_helper" class CreateTest < Minitest::Test def teardown execute "DROP INDEX IF EXISTS posts_id_idx" super end def test_create expected = %{Creating index: CREATE INDEX CONCURRENTLY ON "public"."posts" ("id")} assert_output expected, "-s", "SELECT * FROM posts WHERE id = 1",...
ruby
MIT
bc8d0905269f4336d5d23a39696f9fc4f452ce48
2026-01-04T15:58:45.791976Z
false
ankane/dexter
https://github.com/ankane/dexter/blob/bc8d0905269f4336d5d23a39696f9fc4f452ce48/test/test_helper.rb
test/test_helper.rb
require "bundler/setup" Bundler.require(:default) require "minitest/autorun" require "stringio" $dexter_test = true $url = "postgres:///dexter_test" $conn = PG::Connection.new($url) $conn.exec("SET client_min_messages = warning") $conn.exec(File.read(File.expand_path("support/schema.sql", __dir__))) class Minitest::T...
ruby
MIT
bc8d0905269f4336d5d23a39696f9fc4f452ce48
2026-01-04T15:58:45.791976Z
false
ankane/dexter
https://github.com/ankane/dexter/blob/bc8d0905269f4336d5d23a39696f9fc4f452ce48/test/statement_test.rb
test/statement_test.rb
require_relative "test_helper" class StatementTest < Minitest::Test def test_basic_index assert_index "SELECT * FROM posts WHERE id = 1", "public.posts (id)" end def test_basic_no_index assert_no_index "SELECT * FROM posts" end def test_multicolumn assert_index "SELECT * FROM posts WHERE user_i...
ruby
MIT
bc8d0905269f4336d5d23a39696f9fc4f452ce48
2026-01-04T15:58:45.791976Z
false
ankane/dexter
https://github.com/ankane/dexter/blob/bc8d0905269f4336d5d23a39696f9fc4f452ce48/test/indexing_test.rb
test/indexing_test.rb
require_relative "test_helper" class IndexingTest < Minitest::Test def test_enable_hypopg execute "DROP EXTENSION hypopg" expected = "Run `CREATE EXTENSION hypopg` or pass --enable-hypopg" assert_error expected, "-s", "SELECT 1" expected = "[sql] CREATE EXTENSION hypopg" assert_output expected,...
ruby
MIT
bc8d0905269f4336d5d23a39696f9fc4f452ce48
2026-01-04T15:58:45.791976Z
false
ankane/dexter
https://github.com/ankane/dexter/blob/bc8d0905269f4336d5d23a39696f9fc4f452ce48/test/connection_test.rb
test/connection_test.rb
require_relative "test_helper" class ConnectionTest < Minitest::Test def test_flag assert_connection "-d", "dexter_test" end def test_string assert_connection "dbname=dexter_test" end def test_url_postgres assert_connection "postgres:///dexter_test" end def test_url_postgresql assert_c...
ruby
MIT
bc8d0905269f4336d5d23a39696f9fc4f452ce48
2026-01-04T15:58:45.791976Z
false
ankane/dexter
https://github.com/ankane/dexter/blob/bc8d0905269f4336d5d23a39696f9fc4f452ce48/lib/pgdexter.rb
lib/pgdexter.rb
require_relative "dexter"
ruby
MIT
bc8d0905269f4336d5d23a39696f9fc4f452ce48
2026-01-04T15:58:45.791976Z
false
ankane/dexter
https://github.com/ankane/dexter/blob/bc8d0905269f4336d5d23a39696f9fc4f452ce48/lib/dexter.rb
lib/dexter.rb
# dependencies require "pg" require "pg_query" require "slop" # stdlib require "csv" require "json" require "set" require "time" # modules require_relative "dexter/logging" require_relative "dexter/client" require_relative "dexter/collector" require_relative "dexter/column_resolver" require_relative "dexter/connectio...
ruby
MIT
bc8d0905269f4336d5d23a39696f9fc4f452ce48
2026-01-04T15:58:45.791976Z
false
ankane/dexter
https://github.com/ankane/dexter/blob/bc8d0905269f4336d5d23a39696f9fc4f452ce48/lib/dexter/version.rb
lib/dexter/version.rb
module Dexter VERSION = "0.6.3" end
ruby
MIT
bc8d0905269f4336d5d23a39696f9fc4f452ce48
2026-01-04T15:58:45.791976Z
false
ankane/dexter
https://github.com/ankane/dexter/blob/bc8d0905269f4336d5d23a39696f9fc4f452ce48/lib/dexter/collector.rb
lib/dexter/collector.rb
module Dexter class Collector def initialize(min_time:, min_calls:) @top_queries = {} @new_queries = Set.new @mutex = Mutex.new @min_time = min_time * 60000 # convert minutes to ms @min_calls = min_calls end def add(query, total_time, calls = 1, keep_all = false) finge...
ruby
MIT
bc8d0905269f4336d5d23a39696f9fc4f452ce48
2026-01-04T15:58:45.791976Z
false
ankane/dexter
https://github.com/ankane/dexter/blob/bc8d0905269f4336d5d23a39696f9fc4f452ce48/lib/dexter/index_creator.rb
lib/dexter/index_creator.rb
module Dexter class IndexCreator include Logging def initialize(connection, indexer, new_indexes, tablespace, concurrently) @connection = connection @indexer = indexer @new_indexes = new_indexes @tablespace = tablespace @concurrently = concurrently end # 1. create lock ...
ruby
MIT
bc8d0905269f4336d5d23a39696f9fc4f452ce48
2026-01-04T15:58:45.791976Z
false
ankane/dexter
https://github.com/ankane/dexter/blob/bc8d0905269f4336d5d23a39696f9fc4f452ce48/lib/dexter/table_resolver.rb
lib/dexter/table_resolver.rb
module Dexter class TableResolver include Logging def initialize(connection, queries, log_level:) @connection = connection @queries = queries @log_level = log_level end def perform tables = Set.new(database_tables + materialized_views) no_schema_tables = self.no_schema_...
ruby
MIT
bc8d0905269f4336d5d23a39696f9fc4f452ce48
2026-01-04T15:58:45.791976Z
false