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/spec/unit/rom/relation/command_spec.rb
core/spec/unit/rom/relation/command_spec.rb
# frozen_string_literal: true require 'rom/relation' RSpec.describe ROM::Relation, '#command' do subject(:relation) do ROM::Relation.new([], name: ROM::Relation::Name[:users], commands: commands, auto_map: false) end let(:commands) do {} end context 'when command is already registered' do befo...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/composite_spec.rb
core/spec/unit/rom/relation/composite_spec.rb
# frozen_string_literal: true require 'spec_helper' RSpec.describe ROM::Relation::Composite do include_context 'gateway only' include_context 'users and tasks' let(:users_relation) do Class.new(ROM::Memory::Relation) do schema do attribute :name, ROM::Types::String attribute :email, R...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/attribute_reader_spec.rb
core/spec/unit/rom/relation/attribute_reader_spec.rb
# frozen_string_literal: true require 'rom/memory' RSpec.describe ROM::Relation, '#[]' do it 'defines a canonical schema for a relation' do class Test::Users < ROM::Relation[:memory] schema do attribute :id, Types::Integer attribute :name, Types::String end end relation = Te...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/call_spec.rb
core/spec/unit/rom/relation/call_spec.rb
# frozen_string_literal: true require 'rom/relation' RSpec.describe ROM::Relation, '#call' do subject(:relation) do relation_class.new(data, **options) end let(:options) do {} end context 'without read types in schema' do let(:relation_class) do Class.new(ROM::Relation[:memory]) do ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/wrap_spec.rb
core/spec/unit/rom/relation/wrap_spec.rb
# frozen_string_literal: true require 'rom/relation' RSpec.describe ROM::Relation, '#wrap' do let(:users) do ROM::Relation.new([], name: ROM::Relation::Name[:users]) end let(:tasks) do ROM::Relation.new([], name: ROM::Relation::Name[:tasks]) end let(:users_assocs_set) do { tasks: tasks_assoc }...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/name_spec.rb
core/spec/unit/rom/relation/name_spec.rb
# frozen_string_literal: true require 'rom/relation/name' RSpec.describe ROM::Relation::Name do describe '.[]' do before { ROM::Relation::Name.cache.clear } it 'returns a new name from args' do expect(ROM::Relation::Name[:users]).to eql( ROM::Relation::Name.new(:users) ) expect(R...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/struct_namespace_spec.rb
core/spec/unit/rom/relation/struct_namespace_spec.rb
# frozen_string_literal: true require 'rom/relation' RSpec.describe ROM::Relation, '#struct_namespace' do let(:dataset) do [{ id: 1, name: 'Jane' }] end before do module Test::Entities class User < ROM::Struct def my_user? true end end class Admin < User ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/combine_with_spec.rb
core/spec/unit/rom/relation/combine_with_spec.rb
# frozen_string_literal: true # rubocop:disable Style/MultilineBlockChain RSpec.describe ROM::Relation, '#combine_with' do include_context 'gateway only' include_context 'users and tasks' let(:tags_dataset) { gateway.dataset(:tags) } let(:users_relation) do Class.new(ROM::Memory::Relation) do auto_...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/loaded_spec.rb
core/spec/unit/rom/relation/loaded_spec.rb
# frozen_string_literal: true require 'spec_helper' RSpec.describe ROM::Relation::Loaded do include_context 'no container' include_context 'users and tasks' subject(:users) { ROM::Relation::Loaded.new(users_relation) } describe '#each' do it 'yields tuples from relation' do result = [] user...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/lazy_spec.rb
core/spec/unit/rom/relation/lazy_spec.rb
# frozen_string_literal: true require 'spec_helper' RSpec.describe ROM::Relation do include_context 'gateway only' include_context 'users and tasks' let(:users_relation) do Class.new(ROM::Memory::Relation) do def by_name(name) restrict(name: name) end def by_name_sorted(name, ord...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/wrap/combine_spec.rb
core/spec/unit/rom/relation/wrap/combine_spec.rb
# frozen_string_literal: true require 'rom/relation/wrap' RSpec.describe ROM::Relation::Wrap, '#combine' do subject(:relation) do ROM::Relation::Wrap.new(users, [tasks]) end let(:users) do ROM::Relation.new([]) end let(:tasks) do ROM::Relation.new([]) end let(:posts) do ROM::Relation....
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/class_interface/view_spec.rb
core/spec/unit/rom/relation/class_interface/view_spec.rb
# frozen_string_literal: true require 'rom/core' require 'rom/memory' RSpec.describe ROM::Relation, '.view' do subject(:relation) { relation_class.new(ROM::Memory::Dataset.new([])) } let(:registry) do { tasks: tasks } end let(:tasks) do Class.new(ROM::Relation[:memory]) do schema do at...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/class_interface/relation_name_spec.rb
core/spec/unit/rom/relation/class_interface/relation_name_spec.rb
# frozen_string_literal: true require 'rom/relation' RSpec.describe ROM::Relation, '.relation_name' do context 'when schema is defined' do subject(:relation_class) do Class.new(ROM::Relation) do schema(:users) do attribute :name, ROM::Types::String end end end it '...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/combined/method_missing_spec.rb
core/spec/unit/rom/relation/combined/method_missing_spec.rb
# frozen_string_literal: true RSpec.describe ROM::Relation::Combined, '#method_missing' do subject(:relation) do ROM::Relation::Combined.new(users, [tasks]) end let(:users) do Class.new(ROM::Relation) do def add_node(node) ROM::Relation::Combined.new(self, [node]) end end.new([])...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/combined/materializable_spec.rb
core/spec/unit/rom/relation/combined/materializable_spec.rb
# frozen_string_literal: true RSpec.describe ROM::Relation::Combined do include_context 'gateway only' include_context 'users and tasks' def t(*args) ROM::Processor::Transproc::Functions[*args] end let(:users) do Class.new(ROM::Memory::Relation) do auto_map false def by_name(name) ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/combined/map_with_spec.rb
core/spec/unit/rom/relation/combined/map_with_spec.rb
# frozen_string_literal: true require 'rom/relation/combined' RSpec.describe ROM::Relation::Combined, '#map_with' do subject(:relation) do ROM::Relation::Combined.new( users, [tasks.to_node(:tasks, type: :many, keys: { id: :user_id }).for_users] ) end let(:users) do ROM::Relation.new([{ id: 1...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/combined/combine_spec.rb
core/spec/unit/rom/relation/combined/combine_spec.rb
# frozen_string_literal: true require 'rom/relation/combined' RSpec.describe ROM::Relation::Combined, '#combine' do subject(:relation) do ROM::Relation::Combined.new(users, [tasks]) end let(:users) do ROM::Relation.new([], name: ROM::Relation::Name[:users]) end let(:tasks) do ROM::Relation.new...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/combined/map_to_spec.rb
core/spec/unit/rom/relation/combined/map_to_spec.rb
# frozen_string_literal: true require 'rom/relation/combined' RSpec.describe ROM::Relation::Combined, '#map_to' do subject(:relation) do ROM::Relation::Combined.new(users, [tasks.for_users]) end let(:users) do Class.new(ROM::Relation) do auto_map false end.new([{ id: 1, name: 'Jane' }, { id: ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/combined/with_nodes_spec.rb
core/spec/unit/rom/relation/combined/with_nodes_spec.rb
# frozen_string_literal: true RSpec.describe ROM::Relation::Combined do subject(:relation) do ROM::Relation::Combined.new(users, [tasks]) end let(:users) do ROM::Relation.new([]) end let(:tasks) do ROM::Relation.new([]) end let(:posts) do ROM::Relation.new([]) end describe '#with_...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/combined/command_spec.rb
core/spec/unit/rom/relation/combined/command_spec.rb
# frozen_string_literal: true require 'rom/relation/combined' RSpec.describe ROM::Relation::Combined, '#command' do subject(:relation) do ROM::Relation::Combined.new(users, [tasks]) end let(:users) do ROM::Relation.new([]) end let(:tasks) do ROM::Relation.new([]) end it 'raises when type ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/combined/call_spec.rb
core/spec/unit/rom/relation/combined/call_spec.rb
# frozen_string_literal: true RSpec.describe ROM::Relation::Combined do subject(:relation) do ROM::Relation::Combined.new(users, [tasks]) end let(:users) do Class.new(ROM::Relation) do auto_map false end.new([]) end let(:tasks) do Class.new(ROM::Relation) do auto_map false ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/combined/wrap_spec.rb
core/spec/unit/rom/relation/combined/wrap_spec.rb
# frozen_string_literal: true require 'rom/relation/combined' RSpec.describe ROM::Relation::Combined, '#wrap' do subject(:relation) do ROM::Relation::Combined.new(users, [tasks]) end let(:users) do ROM::Relation.new([]) end let(:tasks) do ROM::Relation.new([]) end let(:posts) do ROM::...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/combined/graph_method_missing_spec.rb
core/spec/unit/rom/relation/combined/graph_method_missing_spec.rb
# frozen_string_literal: true RSpec.describe ROM::Relation::Combined do subject(:relation) do ROM::Relation::Combined.new(users, []) end let(:users) do Class.new(ROM::Relation) do def by_name(_name) self end end.new([]) end describe '#method_missing' do it 'responds to t...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/combined/graph_predicate_spec.rb
core/spec/unit/rom/relation/combined/graph_predicate_spec.rb
# frozen_string_literal: true RSpec.describe ROM::Relation::Combined do subject(:relation) do ROM::Relation::Combined.new(users, []) end let(:users) do Class.new(ROM::Relation) do def by_name(_name) self end end.new([]) end describe '#graph?' do it 'returns true' do ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/unit/rom/relation/combined/to_a_spec.rb
core/spec/unit/rom/relation/combined/to_a_spec.rb
# frozen_string_literal: true RSpec.describe ROM::Relation::Combined, '#to_a' do subject(:relation) do ROM::Relation::Combined.new(users, [tasks.for_users]) end let(:users) do Class.new(ROM::Relation) do auto_map false end.new([{ id: 1, name: 'Jane' }, { id: 2, name: 'John' }]) end let(:t...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/shared/command_graph.rb
core/spec/shared/command_graph.rb
# frozen_string_literal: true RSpec.shared_context 'command graph' do include_context 'container' before do configuration.relation :users do def by_name(name) restrict(name: name) end end configuration.relation :tasks do def by_user_and_title(user, title) by_user(use...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/shared/one_behavior.rb
core/spec/shared/one_behavior.rb
# frozen_string_literal: true shared_examples_for 'a relation that returns one tuple' do describe '#one' do it 'returns first tuple' do users_relation.delete(name: 'Joe', email: 'joe@doe.org') expect(relation.one).to eql(name: 'Jane', email: 'jane@doe.org') end it 'raises error when there is...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/shared/materializable.rb
core/spec/shared/materializable.rb
# frozen_string_literal: true shared_examples_for 'materializable relation' do describe '#each' do it 'yields objects' do count = relation.to_a.size result = [] relation.each do |object| result << object end expect(result.count).to eql(count) end it 'returns enume...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/shared/no_container.rb
core/spec/shared/no_container.rb
# frozen_string_literal: true require 'rom/memory' RSpec.shared_context 'no container' do let(:gateway) { ROM::Memory::Gateway.new } let(:users_dataset) { gateway.dataset(:users) } let(:tasks_dataset) { gateway.dataset(:tasks) } let(:users_relation) do Class.new(ROM::Memory::Relation).new(users_dataset)...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/shared/users_and_tasks.rb
core/spec/shared/users_and_tasks.rb
# frozen_string_literal: true RSpec.shared_context 'users and tasks' do before do users_dataset.insert(name: 'Joe', email: 'joe@doe.org') users_dataset.insert(name: 'Jane', email: 'jane@doe.org') tasks_dataset.insert(name: 'Joe', title: 'be nice', priority: 1) tasks_dataset.insert(name: 'Joe', title...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/shared/command_behavior.rb
core/spec/shared/command_behavior.rb
# frozen_string_literal: true shared_examples_for 'a command' do describe '#name' do it 'returns relation name' do expect(command.name).to eql(command.relation.name) end end describe '#gateway' do it 'returns relation gateway' do expect(command.gateway).to eql(command.relation.gateway) ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/shared/gateway_only.rb
core/spec/shared/gateway_only.rb
# frozen_string_literal: true RSpec.shared_context 'gateway only' do let(:gateway) { ROM::Memory::Gateway.new } let(:users_dataset) { gateway.dataset(:users) } let(:tasks_dataset) { gateway.dataset(:tasks) } end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/shared/enumerable_dataset.rb
core/spec/shared/enumerable_dataset.rb
# frozen_string_literal: true RSpec.shared_examples_for 'an enumerable dataset' do subject(:dataset) { klass.new(data) } let(:data) do [{ 'name' => 'Jane' }, { 'name' => 'Joe' }] end describe '#each' do it 'yields tuples through row_proc' do result = [] dataset.each do |tuple| re...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/spec/shared/container.rb
core/spec/shared/container.rb
# frozen_string_literal: true RSpec.shared_context 'container' do let(:container) { ROM.container(configuration) } let(:configuration) { ROM::Configuration.new(:memory) } let(:gateway) { configuration.gateways[:default] } let(:users_relation) { container.relations[:users] } let(:tasks_relation) { container.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-core.rb
core/lib/rom-core.rb
# frozen_string_literal: true require 'rom/core'
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/transformer.rb
core/lib/rom/transformer.rb
# frozen_string_literal: true require 'transproc/transformer' require 'rom/processor/transproc' module ROM # Transformer is a data mapper which uses Transproc's transformer DSL to define # transformations. # # @api public class Transformer < Transproc::Transformer[::ROM::Processor::Transproc::Functions] ...
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.rb
core/lib/rom/plugins.rb
# frozen_string_literal: true require 'rom/plugin' module ROM # Registry of all known plugin types (command, relation, mapper, etc) # # @api private module Plugins extend ::Dry::Core::Container::Mixin class << self # @api private def register(entity_type, plugin_type: Plugin, adapter: tru...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/command.rb
core/lib/rom/command.rb
# frozen_string_literal: true require 'rom/types' require 'rom/initializer' require 'rom/pipeline' require 'rom/commands/class_interface' require 'rom/commands/composite' require 'rom/commands/graph' require 'rom/commands/lazy' module ROM # Abstract command class # # Provides a constructor accepting relation 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/core.rb
core/lib/rom/core.rb
# frozen_string_literal: true require 'dry/core' require 'dry/types' require 'dry/struct' require 'dry/inflector' require 'rom/constants' # core parts require 'rom/plugin' require 'rom/schema_plugin' require 'rom/relation' require 'rom/mapper' require 'rom/processor/transproc' require 'rom/commands' # rom Global re...
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_registry.rb
core/lib/rom/relation_registry.rb
# frozen_string_literal: true require 'rom/registry' module ROM # @api private class RelationRegistry < Registry # @api private def initialize(elements = {}, **) super yield(self, elements) if block_given? 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/pipeline.rb
core/lib/rom/pipeline.rb
# frozen_string_literal: true module ROM # Data pipeline common interface # # @api private module Pipeline # Common `>>` operator extension # # @api private module Operator # Compose two relation with a left-to-right composition # # @example # users.by_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/model_builder.rb
core/lib/rom/model_builder.rb
# frozen_string_literal: true require 'rom/support/inflector' module ROM # Model builders can be used to build model classes for mappers # # This is used when you define a mapper and setup a model using :name option. # # @example # # this will define User model for you # class UserMapper < ROM::Mapp...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/gateway.rb
core/lib/rom/gateway.rb
# frozen_string_literal: true require 'rom/transaction' require 'rom/support/notifications' module ROM # Abstract gateway class # # Every adapter needs to inherit from this class and implement # required interface # # @abstract # # @api public class Gateway extend Dry::Core::ClassAttributes ...
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.rb
core/lib/rom/setup.rb
# frozen_string_literal: true require 'rom/setup/auto_registration' module ROM # Setup objects collect component classes during setup/finalization process # # @api public class Setup # @return [Array] registered relation subclasses # # @api private attr_reader :relation_classes # @return ...
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.rb
core/lib/rom/memory.rb
# frozen_string_literal: true require 'rom/memory/gateway' require 'rom/memory/relation' require 'rom/memory/mapper_compiler' ROM.register_adapter(:memory, ROM::Memory)
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/struct.rb
core/lib/rom/struct.rb
# frozen_string_literal: true module ROM # Simple data-struct class # # ROM structs are plain data structures loaded by repositories. # They implement Hash protocol which means that they can be used # in places where Hash-like objects are supported. # # Repositories define subclasses of ROM::Struct autom...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/environment.rb
core/lib/rom/environment.rb
# frozen_string_literal: true require 'rom/support/configurable' require 'rom/gateway' module ROM # Core gateway configuration interface # # @api private class Environment include Configurable attr_reader :gateways attr_reader :gateways_map # @api private def initialize(*args) @ga...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/initializer.rb
core/lib/rom/initializer.rb
# frozen_string_literal: true require 'dry-initializer' module ROM # @api private module Initializer # @api private module DefineWithHook # @api private def param(*, **) = super.tap { __define_with__ } # @api private def option(*, **) super.tap do __define_with__...
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_plugin.rb
core/lib/rom/schema_plugin.rb
# frozen_string_literal: true require 'rom/plugin' module ROM # @api private class SchemaPlugin < Plugin # Extends a DSL instance with a module provided by the plugin # # @param [ROM::Schema::DSL] dsl # # @api private def extend_dsl(dsl) dsl.extend(mod.const_get(:DSL)) if mod.const_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/processor.rb
core/lib/rom/processor.rb
# frozen_string_literal: true require 'rom/mapper' module ROM # Abstract processor class # # Every ROM processor should inherit from this class # # @api public class Processor # Hook used to auto-register a processor class # # @api private def self.inherited(processor) super 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/attribute.rb
core/lib/rom/attribute.rb
# frozen_string_literal: true require 'rom/initializer' require 'rom/support/memoizable' require 'rom/types' module ROM # Schema attributes provide meta information about types and an API # for additional operations. This class can be extended by adapters to provide # database-specific features. In example rom-...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/transaction.rb
core/lib/rom/transaction.rb
# frozen_string_literal: true module ROM # @api private class Transaction # @api private Rollback = ::Class.new(::StandardError) # @api private def run(_opts = EMPTY_HASH) yield(self) rescue Rollback # noop end # Unconditionally roll back the current transaction # ...
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.rb
core/lib/rom/relation.rb
# frozen_string_literal: true require 'rom/struct' require 'rom/constants' require 'rom/initializer' require 'rom/support/memoizable' require 'rom/relation/class_interface' require 'rom/auto_curry' require 'rom/pipeline' require 'rom/mapper_registry' require 'rom/command_registry' require 'rom/relation/loaded' requ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/registry.rb
core/lib/rom/registry.rb
# frozen_string_literal: true require 'rom/initializer' require 'rom/cache' require 'rom/constants' module ROM # @api private class Registry extend Initializer extend ::Dry::Core::Cache include ::Enumerable include ::Dry::Equalizer(:elements) # @!attribute [r] elements # @return [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/command_proxy.rb
core/lib/rom/command_proxy.rb
# frozen_string_literal: true require 'rom/support/inflector' module ROM # TODO: look into making command graphs work without the root key in the input # so that we can get rid of this wrapper # # @api private class CommandProxy attr_reader :command attr_reader :root # @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/plugin.rb
core/lib/rom/plugin.rb
# frozen_string_literal: true require 'rom/initializer' require 'rom/constants' require 'rom/support/configurable' module ROM # Plugin is a simple object used to store plugin configurations # # @private class Plugin extend Initializer include Configurable # @!attribute [r] name # @return [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/data_proxy.rb
core/lib/rom/data_proxy.rb
# frozen_string_literal: true module ROM # Helper module for dataset classes # # It provides a constructor accepting data, header and an optional row_proc. # This module is used internally by EnumerableDataset and ArrayDataset. # # @private module DataProxy NON_FORWARDABLE = %i[ each to_a to_ar...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/constants.rb
core/lib/rom/constants.rb
# frozen_string_literal: true # Constants and errors common in the whole library module ROM include ::Dry::Core::Constants AdapterLoadError = ::Class.new(::StandardError) # Exception raised when a component is configured with an adapter that's not loaded class AdapterNotPresentError < ::StandardError # @...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/auto_curry.rb
core/lib/rom/auto_curry.rb
# frozen_string_literal: true module ROM # Relation extension which provides auto-currying of relation view methods # # @api private module AutoCurry # @api private class Wrapper < ::Module def initialize(name, arity, &block) define_method(name) do |*args, **kwargs, &mblock| kwa...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/plugin_registry.rb
core/lib/rom/plugin_registry.rb
# frozen_string_literal: true require 'concurrent/map' require 'rom/registry' require 'rom/plugins' module ROM # Stores all registered plugins # # @api private class PluginRegistry # @api private attr_reader :types # @api private def initialize @types = ::Concurrent::Map.new 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/command_compiler.rb
core/lib/rom/command_compiler.rb
# frozen_string_literal: true require 'rom/support/inflector' require 'rom/initializer' require 'rom/commands' require 'rom/command_proxy' module ROM # Builds commands for relations. # # This class is used by repositories to automatically create commands for # their relations. This is used both by `Repositor...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/global.rb
core/lib/rom/global.rb
# frozen_string_literal: true require 'rom/plugin_registry' require 'rom/global/plugin_dsl' module ROM # Globally accessible public interface exposed via ROM module # # @api public module Global # Set base global registries in ROM constant # # @api private def self.extended(rom) super ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/configuration.rb
core/lib/rom/configuration.rb
# frozen_string_literal: true require 'forwardable' require 'rom/environment' require 'rom/setup' require 'rom/configuration_dsl' require 'rom/support/notifications' module ROM class Configuration extend Forwardable extend Notifications register_event('configuration.relations.class.ready') registe...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/configuration_dsl.rb
core/lib/rom/configuration_dsl.rb
# frozen_string_literal: true require 'rom/configuration_dsl/relation' require 'rom/configuration_dsl/command_dsl' require 'rom/configuration_dsl/mapper_dsl' module ROM # This extends Configuration class with the DSL methods # # @api public module ConfigurationDSL # Relation definition DSL # # @ex...
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_registry.rb
core/lib/rom/mapper_registry.rb
# frozen_string_literal: true require 'rom/struct' require 'rom/registry' require 'rom/mapper_compiler' module ROM # @private class MapperRegistry < Registry # @api private def self.element_not_found_error = MapperMissingError # @!attribute [r] compiler # @return [MapperCompiler] A mapper compi...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/struct_compiler.rb
core/lib/rom/struct_compiler.rb
# frozen_string_literal: true require 'rom/support/inflector' require 'rom/initializer' require 'rom/types' require 'rom/cache' require 'rom/struct' require 'rom/open_struct' require 'rom/attribute' module ROM # @api private class StructCompiler < Dry::Types::Compiler extend Initializer param :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/types.rb
core/lib/rom/types.rb
# frozen_string_literal: true require 'dry-types' require 'json' module ROM # Default namespace with built-in attribute types # # @api public # module Types include Dry::Types(default: :nominal) # @api private def self.included(other) other.extend(Methods) super end # Type ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/association_set.rb
core/lib/rom/association_set.rb
# frozen_string_literal: true require 'rom/registry' module ROM # Association set contains a registry with associations defined # in schema DSL # # @api public class AssociationSet < ROM::Registry # @api private def initialize(...) super elements.values.each do |assoc| elements[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/commands.rb
core/lib/rom/commands.rb
# frozen_string_literal: true require 'rom/commands/create' require 'rom/commands/update' require 'rom/commands/delete'
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/command_registry.rb
core/lib/rom/command_registry.rb
# frozen_string_literal: true require 'concurrent/map' require 'rom/constants' require 'rom/registry' module ROM # Specialized registry class for commands # # @api public class CommandRegistry < Registry # Internal command registry # # @return [Registry] # # @api private param :elemen...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/create_container.rb
core/lib/rom/create_container.rb
# frozen_string_literal: true require 'rom/configuration' require 'rom/environment' require 'rom/setup' require 'rom/setup/finalize' module ROM # @api private class CreateContainer # @api private attr_reader :container # @api private def initialize(environment, setup) @container = finalize(...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/array_dataset.rb
core/lib/rom/array_dataset.rb
# frozen_string_literal: true require 'rom/initializer' require 'rom/enumerable_dataset' module ROM # A helper module that adds data-proxy behavior to an array-like object # # @see EnumerableDataset # # @api public module ArrayDataset extend DataProxy::ClassMethods include EnumerableDataset #...
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.rb
core/lib/rom/mapper.rb
# frozen_string_literal: true require 'rom/constants' require 'rom/mapper/dsl' module ROM # Mapper is a simple object that uses transformers to load relations # # @private class Mapper include DSL include ::Dry::Equalizer(:transformers, :header) defines :relation, :register_as, :symbolize_keys, :...
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_compiler.rb
core/lib/rom/mapper_compiler.rb
# frozen_string_literal: true require 'rom/constants' require 'rom/initializer' require 'rom/mapper' require 'rom/struct' require 'rom/struct_compiler' require 'rom/cache' module ROM # @api private class MapperCompiler extend Dry::Core::ClassAttributes extend Initializer defines :mapper_options ...
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.rb
core/lib/rom/header.rb
# frozen_string_literal: true require 'rom/header/attribute' module ROM # Header provides information about data mapping of a specific relation # # Processors use headers to build objects that process raw relations that go # through mappers. # # @private class Header include ::Enumerable include...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/enumerable_dataset.rb
core/lib/rom/enumerable_dataset.rb
# frozen_string_literal: true require 'rom/initializer' require 'rom/data_proxy' module ROM # A helper module that adds data-proxy behavior to an enumerable object # # This module is intended to be used by gateways # # Class that includes this module can define `row_proc` class method which # must return ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/container.rb
core/lib/rom/container.rb
# frozen_string_literal: true require 'rom/cache' module ROM # ROM container is an isolated environment with no global state where all # components are registered. Container objects provide access to your # relations, commands and mappers. ROM containers are usually configured and # handled via framework inte...
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.rb
core/lib/rom/schema.rb
# frozen_string_literal: true require 'rom/constants' require 'rom/attribute' require 'rom/schema/dsl' require 'rom/schema/inferrer' require 'rom/association_set' require 'rom/support/notifications' require 'rom/support/memoizable' module ROM # Relation schema # # Schemas hold detailed information about 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/cache.rb
core/lib/rom/cache.rb
# frozen_string_literal: true require 'concurrent/map' module ROM # Thread-safe cache used by various rom components # # @api private class Cache attr_reader :objects # @api private class Namespaced # @api private attr_reader :cache # @api private attr_reader :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/open_struct.rb
core/lib/rom/open_struct.rb
# frozen_string_literal: true module ROM # ROM's open structs are used for relations with empty schemas. # Such relations may exist in cases like using raw SQL strings # where schema was not explicitly defined using `view` DSL. # # @api public class OpenStruct IVAR = -> v { :"@#{v}" } # @api priva...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/support/inflector.rb
core/lib/rom/support/inflector.rb
# frozen_string_literal: true module ROM Inflector = Dry::Inflector.new do |i| i.plural(/people\z/i, 'people') 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/support/memoizable.rb
core/lib/rom/support/memoizable.rb
# frozen_string_literal: true module ROM # @api private module Memoizable MEMOIZED_HASH = {}.freeze module ClassInterface # @api private def memoize(*names) prepend(Memoizer.new(self, names)) end def new(*, **, &) obj = super obj.instance_variable_set(:@__m...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/support/notifications.rb
core/lib/rom/support/notifications.rb
# frozen_string_literal: true require 'rom/constants' module ROM # Notification subsystem # # This is an abstract event bus that implements a simple pub/sub protocol. # The Notifications module is used in the setup process to decouple # different modules from each other. # # @example # class Setup ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/support/configurable.rb
core/lib/rom/support/configurable.rb
# frozen_string_literal: true module ROM # This extension is only used for environment objects to configure arbitrary options, each # adapter can use them according to what they need. # # @api private module Configurable class Config WRITER_REGEXP = /=$/ # @!attribute [r] settings # ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/lint/test.rb
core/lib/rom/lint/test.rb
# frozen_string_literal: true require 'rom/lint/gateway' require 'rom/lint/enumerable_dataset' module ROM module Lint # A module that helps to define test methods module Test # Defines a test method converting lint failures to assertions # # @param [String] name # # @api privat...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/lint/gateway.rb
core/lib/rom/lint/gateway.rb
# frozen_string_literal: true require 'rom/lint/linter' module ROM module Lint # Ensures that a [ROM::Gateway] extension provides datasets through the # expected methods # # @api public class Gateway < ROM::Lint::Linter # The gateway identifier e.g. +:memory+ # # @api public ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/lint/spec.rb
core/lib/rom/lint/spec.rb
# frozen_string_literal: true require 'rom/lint/gateway' require 'rom/lint/enumerable_dataset' RSpec.shared_examples 'a rom gateway' do ROM::Lint::Gateway.each_lint do |name, linter| it name do result = linter.new(identifier, gateway, uri).lint(name) expect(result).to be_truthy end end end RS...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/lint/linter.rb
core/lib/rom/lint/linter.rb
# frozen_string_literal: true module ROM module Lint # Base class for building linters that check source code # # Linters are used by authors of ROM adapters to verify that their # integration complies with the ROM api. # # Most of the time, authors won't need to construct linters directly ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/lint/enumerable_dataset.rb
core/lib/rom/lint/enumerable_dataset.rb
# frozen_string_literal: true require 'rom/lint/linter' module ROM module Lint # Ensures that a [ROM::EnumerableDataset] extension correctly yields # arrays and tuples # # @api public class EnumerableDataset < ROM::Lint::Linter # The linted subject # # @api public attr_re...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/global/plugin_dsl.rb
core/lib/rom/global/plugin_dsl.rb
# frozen_string_literal: true module ROM module Global # plugin registration DSL # # @private class PluginDSL # Default options passed to plugin registration # # @return [Hash] # # @api private attr_reader :defaults # Plugin registry # # @return ...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/configuration_dsl/command.rb
core/lib/rom/configuration_dsl/command.rb
# frozen_string_literal: true require 'rom/support/inflector' module ROM module ConfigurationDSL # Setup DSL-specific command extensions # # @private class Command # Generate a command subclass # # This is used by Setup#commands DSL and its `define` block # # @api priva...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/configuration_dsl/mapper_dsl.rb
core/lib/rom/configuration_dsl/mapper_dsl.rb
# frozen_string_literal: true require 'rom/mapper/builder' module ROM module ConfigurationDSL # Mapper definition DSL used by Setup DSL # # @private class MapperDSL attr_reader :configuration attr_reader :mapper_classes attr_reader :defined_mappers # @api private def...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/configuration_dsl/relation.rb
core/lib/rom/configuration_dsl/relation.rb
# frozen_string_literal: true require 'rom/support/inflector' module ROM module ConfigurationDSL # Setup DSL-specific relation extensions # # @private class Relation # Generate a relation subclass # # This is used by Setup#relation DSL # # @api private def self.bu...
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false
rom-rb/rom
https://github.com/rom-rb/rom/blob/ac5d6618f36b0c48525fa48b7f6c774e0d1d2860/core/lib/rom/configuration_dsl/command_dsl.rb
core/lib/rom/configuration_dsl/command_dsl.rb
# frozen_string_literal: true require 'rom/configuration_dsl/command' module ROM module ConfigurationDSL # Command `define` DSL used by Setup#commands # # @private class CommandDSL attr_reader :relation attr_reader :adapter attr_reader :command_classes # @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/commands/update.rb
core/lib/rom/commands/update.rb
# frozen_string_literal: true require 'rom/command' module ROM module Commands # Update command # # This command updates all tuples in its relation with new attributes # # @abstract class Update < Command restrictable true 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/commands/composite.rb
core/lib/rom/commands/composite.rb
# frozen_string_literal: true require 'rom/pipeline' module ROM module Commands # Composite command that consists of left and right commands # # @api public class Composite < Pipeline::Composite # Calls the composite command # # Right command is called with a result from the left o...
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.rb
core/lib/rom/commands/graph.rb
# frozen_string_literal: true require 'rom/initializer' require 'rom/pipeline' require 'rom/commands/graph/class_interface' module ROM module Commands # Command graph # # @api private class Graph extend Initializer include Dry::Equalizer(:root, :nodes) extend ClassInterface ...
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/delete.rb
core/lib/rom/commands/delete.rb
# frozen_string_literal: true require 'rom/command' module ROM module Commands # Delete command # # This command removes tuples from its target relation # # @abstract class Delete < Command restrictable true 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/commands/lazy.rb
core/lib/rom/commands/lazy.rb
# frozen_string_literal: true require 'rom/commands/composite' require 'rom/commands/graph' module ROM module Commands # Lazy command wraps another command and evaluates its input when called # # @api private class Lazy include Dry::Equalizer(:command, :evaluator) # @attr_reader [Comman...
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/create.rb
core/lib/rom/commands/create.rb
# frozen_string_literal: true require 'rom/command' module ROM module Commands # Create command # # This command inserts a new tuple into a relation # # @abstract class Create < Command end end end
ruby
MIT
ac5d6618f36b0c48525fa48b7f6c774e0d1d2860
2026-01-04T15:58:11.374901Z
false