rom 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +2 -0
- data/.travis.yml +22 -0
- data/Changelog.md +16 -0
- data/Gemfile +13 -6
- data/Gemfile.devtools +71 -0
- data/Guardfile +19 -0
- data/LICENSE +1 -1
- data/README.md +52 -30
- data/Rakefile +3 -0
- data/config/devtools.yml +4 -0
- data/config/flay.yml +3 -0
- data/config/flog.yml +2 -0
- data/config/mutant.yml +5 -0
- data/config/reek.yml +103 -0
- data/config/rubocop.yml +62 -0
- data/config/yardstick.yml +2 -0
- data/lib/rom.rb +13 -5
- data/lib/rom/constants.rb +16 -0
- data/lib/rom/environment.rb +105 -0
- data/lib/rom/environment/builder.rb +71 -0
- data/lib/rom/mapper.rb +176 -0
- data/lib/rom/mapper/attribute.rb +108 -0
- data/lib/rom/mapper/builder.rb +58 -0
- data/lib/rom/mapper/builder/definition.rb +162 -0
- data/lib/rom/mapper/header.rb +103 -0
- data/lib/rom/mapper/loader_builder.rb +26 -0
- data/lib/rom/relation.rb +375 -0
- data/lib/rom/repository.rb +71 -0
- data/lib/rom/schema.rb +21 -0
- data/lib/rom/schema/builder.rb +59 -0
- data/lib/rom/schema/definition.rb +84 -0
- data/lib/rom/schema/definition/relation.rb +80 -0
- data/lib/rom/schema/definition/relation/base.rb +27 -0
- data/lib/rom/session.rb +111 -0
- data/lib/rom/session/environment.rb +67 -0
- data/lib/rom/session/identity_map.rb +43 -0
- data/lib/rom/session/mapper.rb +62 -0
- data/lib/rom/session/relation.rb +140 -0
- data/lib/rom/session/state.rb +59 -0
- data/lib/rom/session/state/created.rb +22 -0
- data/lib/rom/session/state/deleted.rb +25 -0
- data/lib/rom/session/state/persisted.rb +34 -0
- data/lib/rom/session/state/transient.rb +20 -0
- data/lib/rom/session/state/updated.rb +29 -0
- data/lib/rom/session/tracker.rb +62 -0
- data/lib/rom/support/axiom/adapter.rb +111 -0
- data/lib/rom/support/axiom/adapter/data_objects.rb +38 -0
- data/lib/rom/support/axiom/adapter/memory.rb +25 -0
- data/lib/rom/support/axiom/adapter/postgres.rb +19 -0
- data/lib/rom/support/axiom/adapter/sqlite3.rb +20 -0
- data/lib/version.rb +1 -1
- data/rom.gemspec +7 -3
- data/spec/integration/environment_setup_spec.rb +24 -0
- data/spec/integration/grouped_mappers_spec.rb +87 -0
- data/spec/integration/join_and_group_spec.rb +76 -0
- data/spec/integration/join_and_wrap_spec.rb +68 -0
- data/spec/integration/mapping_embedded_relations_spec.rb +73 -0
- data/spec/integration/mapping_relations_spec.rb +120 -0
- data/spec/integration/schema_definition_spec.rb +152 -0
- data/spec/integration/session_spec.rb +87 -0
- data/spec/integration/wrapped_mappers_spec.rb +73 -0
- data/spec/shared/unit/environment_context.rb +6 -0
- data/spec/shared/unit/loader.rb +11 -0
- data/spec/shared/unit/loader_identity.rb +13 -0
- data/spec/shared/unit/mapper_context.rb +11 -0
- data/spec/shared/unit/relation_context.rb +82 -0
- data/spec/shared/unit/session_environment_context.rb +11 -0
- data/spec/shared/unit/session_relation_context.rb +18 -0
- data/spec/spec_helper.rb +49 -0
- data/spec/support/helper.rb +34 -0
- data/spec/support/ice_nine_config.rb +10 -0
- data/spec/support/test_mapper.rb +110 -0
- data/spec/unit/rom/environment/builder/mapping_spec.rb +24 -0
- data/spec/unit/rom/environment/builder/schema_spec.rb +33 -0
- data/spec/unit/rom/environment/class_methods/setup_spec.rb +18 -0
- data/spec/unit/rom/environment/repository_spec.rb +21 -0
- data/spec/unit/rom/mapper/attribute/embedded_collection/to_ast_spec.rb +18 -0
- data/spec/unit/rom/mapper/attribute/embedded_value/to_ast_spec.rb +16 -0
- data/spec/unit/rom/mapper/attribute/rename_spec.rb +9 -0
- data/spec/unit/rom/mapper/attribute/to_ast_spec.rb +9 -0
- data/spec/unit/rom/mapper/builder/class_methods/call_spec.rb +61 -0
- data/spec/unit/rom/mapper/class_methods/build_spec.rb +55 -0
- data/spec/unit/rom/mapper/dump_spec.rb +11 -0
- data/spec/unit/rom/mapper/group_spec.rb +35 -0
- data/spec/unit/rom/mapper/header/each_spec.rb +26 -0
- data/spec/unit/rom/mapper/header/element_reader_spec.rb +21 -0
- data/spec/unit/rom/mapper/header/group_spec.rb +18 -0
- data/spec/unit/rom/mapper/header/join_spec.rb +14 -0
- data/spec/unit/rom/mapper/header/keys_spec.rb +29 -0
- data/spec/unit/rom/mapper/header/project_spec.rb +13 -0
- data/spec/unit/rom/mapper/header/rename_spec.rb +11 -0
- data/spec/unit/rom/mapper/header/to_ast_spec.rb +11 -0
- data/spec/unit/rom/mapper/header/wrap_spec.rb +18 -0
- data/spec/unit/rom/mapper/identity_from_tuple_spec.rb +11 -0
- data/spec/unit/rom/mapper/identity_spec.rb +11 -0
- data/spec/unit/rom/mapper/join_spec.rb +15 -0
- data/spec/unit/rom/mapper/load_spec.rb +11 -0
- data/spec/unit/rom/mapper/new_object_spec.rb +14 -0
- data/spec/unit/rom/mapper/project_spec.rb +11 -0
- data/spec/unit/rom/mapper/rename_spec.rb +16 -0
- data/spec/unit/rom/mapper/wrap_spec.rb +35 -0
- data/spec/unit/rom/relation/delete_spec.rb +15 -0
- data/spec/unit/rom/relation/drop_spec.rb +11 -0
- data/spec/unit/rom/relation/each_spec.rb +23 -0
- data/spec/unit/rom/relation/first_spec.rb +19 -0
- data/spec/unit/rom/relation/group_spec.rb +29 -0
- data/spec/unit/rom/relation/inject_mapper_spec.rb +17 -0
- data/spec/unit/rom/relation/insert_spec.rb +13 -0
- data/spec/unit/rom/relation/last_spec.rb +19 -0
- data/spec/unit/rom/relation/one_spec.rb +49 -0
- data/spec/unit/rom/relation/rename_spec.rb +21 -0
- data/spec/unit/rom/relation/replace_spec.rb +13 -0
- data/spec/unit/rom/relation/restrict_spec.rb +25 -0
- data/spec/unit/rom/relation/sort_by_spec.rb +25 -0
- data/spec/unit/rom/relation/take_spec.rb +11 -0
- data/spec/unit/rom/relation/to_a_spec.rb +20 -0
- data/spec/unit/rom/relation/update_spec.rb +25 -0
- data/spec/unit/rom/relation/wrap_spec.rb +29 -0
- data/spec/unit/rom/repository/class_methods/build_spec.rb +27 -0
- data/spec/unit/rom/repository/element_reader_spec.rb +21 -0
- data/spec/unit/rom/repository/element_writer_spec.rb +18 -0
- data/spec/unit/rom/schema/builder/class_methods/build_spec.rb +103 -0
- data/spec/unit/rom/schema/element_reader_spec.rb +15 -0
- data/spec/unit/rom/session/class_methods/start_spec.rb +23 -0
- data/spec/unit/rom/session/clean_predicate_spec.rb +21 -0
- data/spec/unit/rom/session/environment/element_reader_spec.rb +13 -0
- data/spec/unit/rom/session/flush_spec.rb +58 -0
- data/spec/unit/rom/session/mapper/load_spec.rb +47 -0
- data/spec/unit/rom/session/relation/delete_spec.rb +28 -0
- data/spec/unit/rom/session/relation/dirty_predicate_spec.rb +35 -0
- data/spec/unit/rom/session/relation/identity_spec.rb +11 -0
- data/spec/unit/rom/session/relation/new_spec.rb +50 -0
- data/spec/unit/rom/session/relation/save_spec.rb +50 -0
- data/spec/unit/rom/session/relation/state_spec.rb +23 -0
- data/spec/unit/rom/session/relation/track_spec.rb +23 -0
- data/spec/unit/rom/session/relation/tracking_predicate_spec.rb +23 -0
- data/spec/unit/rom/session/relation/update_attributes_spec.rb +45 -0
- data/spec/unit/rom/session/state_spec.rb +79 -0
- metadata +212 -11
@@ -0,0 +1,28 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Session::Relation, '#delete' do
|
6
|
+
subject { users.delete(user) }
|
7
|
+
|
8
|
+
include_context 'Session::Relation'
|
9
|
+
|
10
|
+
let(:state) { subject.state(user) }
|
11
|
+
|
12
|
+
context 'with a persisted object' do
|
13
|
+
it_behaves_like 'a command method'
|
14
|
+
|
15
|
+
specify { expect(state).to be_deleted }
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'with a transient object' do
|
19
|
+
let(:user) { users.new }
|
20
|
+
|
21
|
+
specify do
|
22
|
+
expect { subject }.to raise_error(
|
23
|
+
Session::State::TransitionError,
|
24
|
+
'cannot delete object with ROM::Session::State::Transient state'
|
25
|
+
)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Session::Relation, '#dirty?' do
|
6
|
+
subject { users.dirty?(user) }
|
7
|
+
|
8
|
+
include_context 'Session::Relation'
|
9
|
+
|
10
|
+
context 'with a transient object' do
|
11
|
+
let(:user) { users.new }
|
12
|
+
|
13
|
+
it { should be(true) }
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'when persisted object was changed' do
|
17
|
+
before do
|
18
|
+
user.name = 'John Doe'
|
19
|
+
end
|
20
|
+
|
21
|
+
it { should be(true) }
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'when persisted object was not changed' do
|
25
|
+
it { should be(false) }
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'when object is not tracked' do
|
29
|
+
let(:user) { model.new(id: 3, name: 'Unknown') }
|
30
|
+
|
31
|
+
specify do
|
32
|
+
expect { subject }.to raise_error(Session::ObjectNotTrackedError)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Session::Relation, '#new' do
|
6
|
+
share_examples_for 'a new tracked object' do
|
7
|
+
it { should be_instance_of(model) }
|
8
|
+
|
9
|
+
it 'sets state to transient' do
|
10
|
+
expect(object.state(subject)).to be_transient
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'auto-tracks the new object' do
|
14
|
+
expect(object.tracking?(subject)).to be_true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
include_context 'Session::Relation'
|
19
|
+
|
20
|
+
let(:attributes) { Hash[id: 1, name: 'Jane'] }
|
21
|
+
|
22
|
+
context 'with attributes' do
|
23
|
+
subject { users.new(attributes) }
|
24
|
+
|
25
|
+
it { should eq(model.new(attributes)) }
|
26
|
+
|
27
|
+
it_behaves_like 'a new tracked object'
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'with attributes and block' do
|
31
|
+
subject { users.new(attributes, &block) }
|
32
|
+
|
33
|
+
let(:model) {
|
34
|
+
mock_model(:id, :name) {
|
35
|
+
attr_reader :attributes
|
36
|
+
|
37
|
+
def initialize(attributes, &block)
|
38
|
+
@attributes = attributes
|
39
|
+
yield(attributes)
|
40
|
+
end
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
let(:block) { proc { |attributes| attributes[:test] = true } }
|
45
|
+
|
46
|
+
its(:attributes) { should eq(attributes.merge(test: true)) }
|
47
|
+
|
48
|
+
it_behaves_like 'a new tracked object'
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Session::Relation, '#save' do
|
6
|
+
subject { object.save(user) }
|
7
|
+
|
8
|
+
include_context 'Session::Relation'
|
9
|
+
|
10
|
+
let(:state) { subject.state(user) }
|
11
|
+
|
12
|
+
context 'when an object is transient' do
|
13
|
+
let(:user) { users.new(id: 3, name: 'John') }
|
14
|
+
|
15
|
+
it_behaves_like 'a command method'
|
16
|
+
|
17
|
+
specify { state.should be_created }
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'when an object is persisted' do
|
21
|
+
context 'when not dirty' do
|
22
|
+
it_behaves_like 'a command method'
|
23
|
+
|
24
|
+
specify { state.should be_persisted }
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'when dirty' do
|
28
|
+
before do
|
29
|
+
user.name = 'John Doe'
|
30
|
+
end
|
31
|
+
|
32
|
+
it_behaves_like 'a command method'
|
33
|
+
|
34
|
+
specify { state.should be_updated }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'when an object is deleted' do
|
39
|
+
before do
|
40
|
+
object.delete(user)
|
41
|
+
end
|
42
|
+
|
43
|
+
specify do
|
44
|
+
expect { subject }.to raise_error(
|
45
|
+
Session::State::TransitionError,
|
46
|
+
'cannot save object with ROM::Session::State::Deleted state'
|
47
|
+
)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Session::Relation, '#state' do
|
6
|
+
subject { users.state(user) }
|
7
|
+
|
8
|
+
include_context 'Session::Relation'
|
9
|
+
|
10
|
+
context 'when object is tracked' do
|
11
|
+
it { should be_kind_of(Session::State) }
|
12
|
+
|
13
|
+
its(:object) { should be(user) }
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'when object is not tracked' do
|
17
|
+
let(:user) { model.new }
|
18
|
+
|
19
|
+
specify do
|
20
|
+
expect { subject }.to raise_error(Session::ObjectNotTrackedError)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Session::Relation, '#track' do
|
6
|
+
subject { users.track(user) }
|
7
|
+
|
8
|
+
include_context 'Session::Relation'
|
9
|
+
|
10
|
+
let(:user) { model.new(id: 3, name: 'John') }
|
11
|
+
|
12
|
+
before do
|
13
|
+
users.track(user)
|
14
|
+
end
|
15
|
+
|
16
|
+
it_behaves_like 'a command method'
|
17
|
+
|
18
|
+
it { should be(subject) }
|
19
|
+
|
20
|
+
it 'starts tracking the object' do
|
21
|
+
expect(users.tracking?(user)).to be_true
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Session::Relation, '#tracking?' do
|
6
|
+
subject { users.tracking?(user) }
|
7
|
+
|
8
|
+
include_context 'Session::Relation'
|
9
|
+
|
10
|
+
let(:user) { model.new(id: 3, name: 'John') }
|
11
|
+
|
12
|
+
context 'when the object is being tracked' do
|
13
|
+
before do
|
14
|
+
users.track(user)
|
15
|
+
end
|
16
|
+
|
17
|
+
it { should be(true) }
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'when the object is not being tracked' do
|
21
|
+
it { should be(false) }
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Session::Relation, '#update_attributes' do
|
6
|
+
subject { object.update_attributes(user, new_attributes) }
|
7
|
+
|
8
|
+
include_context 'Session::Relation'
|
9
|
+
|
10
|
+
let(:state) { subject.state(user) }
|
11
|
+
let(:new_attributes) { { name: 'Other' } }
|
12
|
+
|
13
|
+
before do
|
14
|
+
user.freeze
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'when an object is persisted' do
|
18
|
+
context 'when dirty' do
|
19
|
+
it_behaves_like 'a command method'
|
20
|
+
|
21
|
+
specify { state.should be_updated }
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
context 'when an object is transient' do
|
26
|
+
let(:user) { model.new }
|
27
|
+
|
28
|
+
specify do
|
29
|
+
expect { subject }.to raise_error(Session::ObjectNotTrackedError)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context 'when an object is deleted' do
|
34
|
+
before do
|
35
|
+
object.delete(user)
|
36
|
+
end
|
37
|
+
|
38
|
+
specify do
|
39
|
+
expect { subject }.to raise_error(
|
40
|
+
Session::State::TransitionError,
|
41
|
+
'cannot update object with ROM::Session::State::Deleted state'
|
42
|
+
)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Session::State do
|
6
|
+
fake(:object)
|
7
|
+
fake(:mapper)
|
8
|
+
fake(:relation)
|
9
|
+
|
10
|
+
describe '#transient?' do
|
11
|
+
context 'with transient state' do
|
12
|
+
subject { Session::State::Transient.new(object, mapper) }
|
13
|
+
|
14
|
+
it { should be_transient }
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'with a non-transient state' do
|
18
|
+
subject { Session::State::Persisted.new(object, mapper) }
|
19
|
+
|
20
|
+
it { should_not be_transient }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#persisted?' do
|
25
|
+
context 'with a persisted state' do
|
26
|
+
subject { Session::State::Persisted.new(object, mapper) }
|
27
|
+
|
28
|
+
it { should be_persisted }
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'with a non-persisted state' do
|
32
|
+
subject { Session::State::Transient.new(object, mapper) }
|
33
|
+
|
34
|
+
it { should_not be_persisted }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe '#created?' do
|
39
|
+
context 'with a created state' do
|
40
|
+
subject { Session::State::Created.new(object, mapper, relation) }
|
41
|
+
|
42
|
+
it { should be_created }
|
43
|
+
end
|
44
|
+
|
45
|
+
context 'with a non-created state' do
|
46
|
+
subject { Session::State::Transient.new(object, mapper) }
|
47
|
+
|
48
|
+
it { should_not be_created }
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe '#updated?' do
|
53
|
+
context 'with an updated state' do
|
54
|
+
subject { Session::State::Updated.new(object, [], relation) }
|
55
|
+
|
56
|
+
it { should be_updated }
|
57
|
+
end
|
58
|
+
|
59
|
+
context 'with a non-updated state' do
|
60
|
+
subject { Session::State::Transient.new(object, mapper) }
|
61
|
+
|
62
|
+
it { should_not be_updated }
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
describe '#deleted?' do
|
67
|
+
context 'with a deleted state' do
|
68
|
+
subject { Session::State::Deleted.new(object, mapper, relation) }
|
69
|
+
|
70
|
+
it { should be_deleted }
|
71
|
+
end
|
72
|
+
|
73
|
+
context 'with a non-updated state' do
|
74
|
+
subject { Session::State::Transient.new(object, mapper) }
|
75
|
+
|
76
|
+
it { should_not be_deleted }
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,16 +12,86 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2014-04-06 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
|
-
name:
|
18
|
+
name: addressable
|
19
19
|
requirement: !ruby/object:Gem::Requirement
|
20
20
|
none: false
|
21
21
|
requirements:
|
22
22
|
- - ~>
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version:
|
24
|
+
version: '2.3'
|
25
|
+
- - ! '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 2.3.3
|
28
|
+
type: :runtime
|
29
|
+
prerelease: false
|
30
|
+
version_requirements: !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ~>
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '2.3'
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: 2.3.3
|
39
|
+
- !ruby/object:Gem::Dependency
|
40
|
+
name: concord
|
41
|
+
requirement: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.1'
|
47
|
+
type: :runtime
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: adamantium
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0.2'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ~>
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0.2'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: axiom
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ~>
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0.2'
|
79
|
+
type: :runtime
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ~>
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0.2'
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
name: axiom-optimizer
|
89
|
+
requirement: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ~>
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0.2'
|
25
95
|
type: :runtime
|
26
96
|
prerelease: false
|
27
97
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,15 +99,15 @@ dependencies:
|
|
29
99
|
requirements:
|
30
100
|
- - ~>
|
31
101
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.
|
102
|
+
version: '0.2'
|
33
103
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
104
|
+
name: charlatan
|
35
105
|
requirement: !ruby/object:Gem::Requirement
|
36
106
|
none: false
|
37
107
|
requirements:
|
38
108
|
- - ~>
|
39
109
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.1
|
110
|
+
version: '0.1'
|
41
111
|
type: :runtime
|
42
112
|
prerelease: false
|
43
113
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -45,15 +115,15 @@ dependencies:
|
|
45
115
|
requirements:
|
46
116
|
- - ~>
|
47
117
|
- !ruby/object:Gem::Version
|
48
|
-
version: 0.1
|
118
|
+
version: '0.1'
|
49
119
|
- !ruby/object:Gem::Dependency
|
50
|
-
name:
|
120
|
+
name: morpher
|
51
121
|
requirement: !ruby/object:Gem::Requirement
|
52
122
|
none: false
|
53
123
|
requirements:
|
54
124
|
- - ~>
|
55
125
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.
|
126
|
+
version: '0.2'
|
57
127
|
type: :runtime
|
58
128
|
prerelease: false
|
59
129
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -61,7 +131,7 @@ dependencies:
|
|
61
131
|
requirements:
|
62
132
|
- - ~>
|
63
133
|
- !ruby/object:Gem::Version
|
64
|
-
version: 0.
|
134
|
+
version: '0.2'
|
65
135
|
description: Ruby Object Mapper
|
66
136
|
email:
|
67
137
|
- dan.kubb@gmail.com
|
@@ -73,14 +143,145 @@ extensions: []
|
|
73
143
|
extra_rdoc_files: []
|
74
144
|
files:
|
75
145
|
- .gitignore
|
146
|
+
- .rspec
|
76
147
|
- .ruby-version
|
148
|
+
- .travis.yml
|
77
149
|
- Changelog.md
|
78
150
|
- Gemfile
|
151
|
+
- Gemfile.devtools
|
152
|
+
- Guardfile
|
79
153
|
- LICENSE
|
80
154
|
- README.md
|
155
|
+
- Rakefile
|
156
|
+
- config/devtools.yml
|
157
|
+
- config/flay.yml
|
158
|
+
- config/flog.yml
|
159
|
+
- config/mutant.yml
|
160
|
+
- config/reek.yml
|
161
|
+
- config/rubocop.yml
|
162
|
+
- config/yardstick.yml
|
81
163
|
- lib/rom.rb
|
164
|
+
- lib/rom/constants.rb
|
165
|
+
- lib/rom/environment.rb
|
166
|
+
- lib/rom/environment/builder.rb
|
167
|
+
- lib/rom/mapper.rb
|
168
|
+
- lib/rom/mapper/attribute.rb
|
169
|
+
- lib/rom/mapper/builder.rb
|
170
|
+
- lib/rom/mapper/builder/definition.rb
|
171
|
+
- lib/rom/mapper/header.rb
|
172
|
+
- lib/rom/mapper/loader_builder.rb
|
173
|
+
- lib/rom/relation.rb
|
174
|
+
- lib/rom/repository.rb
|
175
|
+
- lib/rom/schema.rb
|
176
|
+
- lib/rom/schema/builder.rb
|
177
|
+
- lib/rom/schema/definition.rb
|
178
|
+
- lib/rom/schema/definition/relation.rb
|
179
|
+
- lib/rom/schema/definition/relation/base.rb
|
180
|
+
- lib/rom/session.rb
|
181
|
+
- lib/rom/session/environment.rb
|
182
|
+
- lib/rom/session/identity_map.rb
|
183
|
+
- lib/rom/session/mapper.rb
|
184
|
+
- lib/rom/session/relation.rb
|
185
|
+
- lib/rom/session/state.rb
|
186
|
+
- lib/rom/session/state/created.rb
|
187
|
+
- lib/rom/session/state/deleted.rb
|
188
|
+
- lib/rom/session/state/persisted.rb
|
189
|
+
- lib/rom/session/state/transient.rb
|
190
|
+
- lib/rom/session/state/updated.rb
|
191
|
+
- lib/rom/session/tracker.rb
|
192
|
+
- lib/rom/support/axiom/adapter.rb
|
193
|
+
- lib/rom/support/axiom/adapter/data_objects.rb
|
194
|
+
- lib/rom/support/axiom/adapter/memory.rb
|
195
|
+
- lib/rom/support/axiom/adapter/postgres.rb
|
196
|
+
- lib/rom/support/axiom/adapter/sqlite3.rb
|
82
197
|
- lib/version.rb
|
83
198
|
- rom.gemspec
|
199
|
+
- spec/integration/environment_setup_spec.rb
|
200
|
+
- spec/integration/grouped_mappers_spec.rb
|
201
|
+
- spec/integration/join_and_group_spec.rb
|
202
|
+
- spec/integration/join_and_wrap_spec.rb
|
203
|
+
- spec/integration/mapping_embedded_relations_spec.rb
|
204
|
+
- spec/integration/mapping_relations_spec.rb
|
205
|
+
- spec/integration/schema_definition_spec.rb
|
206
|
+
- spec/integration/session_spec.rb
|
207
|
+
- spec/integration/wrapped_mappers_spec.rb
|
208
|
+
- spec/shared/unit/environment_context.rb
|
209
|
+
- spec/shared/unit/loader.rb
|
210
|
+
- spec/shared/unit/loader_identity.rb
|
211
|
+
- spec/shared/unit/mapper_context.rb
|
212
|
+
- spec/shared/unit/relation_context.rb
|
213
|
+
- spec/shared/unit/session_environment_context.rb
|
214
|
+
- spec/shared/unit/session_relation_context.rb
|
215
|
+
- spec/spec_helper.rb
|
216
|
+
- spec/support/helper.rb
|
217
|
+
- spec/support/ice_nine_config.rb
|
218
|
+
- spec/support/test_mapper.rb
|
219
|
+
- spec/unit/rom/environment/builder/mapping_spec.rb
|
220
|
+
- spec/unit/rom/environment/builder/schema_spec.rb
|
221
|
+
- spec/unit/rom/environment/class_methods/setup_spec.rb
|
222
|
+
- spec/unit/rom/environment/repository_spec.rb
|
223
|
+
- spec/unit/rom/mapper/attribute/embedded_collection/to_ast_spec.rb
|
224
|
+
- spec/unit/rom/mapper/attribute/embedded_value/to_ast_spec.rb
|
225
|
+
- spec/unit/rom/mapper/attribute/rename_spec.rb
|
226
|
+
- spec/unit/rom/mapper/attribute/to_ast_spec.rb
|
227
|
+
- spec/unit/rom/mapper/builder/class_methods/call_spec.rb
|
228
|
+
- spec/unit/rom/mapper/class_methods/build_spec.rb
|
229
|
+
- spec/unit/rom/mapper/dump_spec.rb
|
230
|
+
- spec/unit/rom/mapper/group_spec.rb
|
231
|
+
- spec/unit/rom/mapper/header/each_spec.rb
|
232
|
+
- spec/unit/rom/mapper/header/element_reader_spec.rb
|
233
|
+
- spec/unit/rom/mapper/header/group_spec.rb
|
234
|
+
- spec/unit/rom/mapper/header/join_spec.rb
|
235
|
+
- spec/unit/rom/mapper/header/keys_spec.rb
|
236
|
+
- spec/unit/rom/mapper/header/project_spec.rb
|
237
|
+
- spec/unit/rom/mapper/header/rename_spec.rb
|
238
|
+
- spec/unit/rom/mapper/header/to_ast_spec.rb
|
239
|
+
- spec/unit/rom/mapper/header/wrap_spec.rb
|
240
|
+
- spec/unit/rom/mapper/identity_from_tuple_spec.rb
|
241
|
+
- spec/unit/rom/mapper/identity_spec.rb
|
242
|
+
- spec/unit/rom/mapper/join_spec.rb
|
243
|
+
- spec/unit/rom/mapper/load_spec.rb
|
244
|
+
- spec/unit/rom/mapper/new_object_spec.rb
|
245
|
+
- spec/unit/rom/mapper/project_spec.rb
|
246
|
+
- spec/unit/rom/mapper/rename_spec.rb
|
247
|
+
- spec/unit/rom/mapper/wrap_spec.rb
|
248
|
+
- spec/unit/rom/relation/delete_spec.rb
|
249
|
+
- spec/unit/rom/relation/drop_spec.rb
|
250
|
+
- spec/unit/rom/relation/each_spec.rb
|
251
|
+
- spec/unit/rom/relation/first_spec.rb
|
252
|
+
- spec/unit/rom/relation/group_spec.rb
|
253
|
+
- spec/unit/rom/relation/inject_mapper_spec.rb
|
254
|
+
- spec/unit/rom/relation/insert_spec.rb
|
255
|
+
- spec/unit/rom/relation/last_spec.rb
|
256
|
+
- spec/unit/rom/relation/one_spec.rb
|
257
|
+
- spec/unit/rom/relation/rename_spec.rb
|
258
|
+
- spec/unit/rom/relation/replace_spec.rb
|
259
|
+
- spec/unit/rom/relation/restrict_spec.rb
|
260
|
+
- spec/unit/rom/relation/sort_by_spec.rb
|
261
|
+
- spec/unit/rom/relation/take_spec.rb
|
262
|
+
- spec/unit/rom/relation/to_a_spec.rb
|
263
|
+
- spec/unit/rom/relation/update_spec.rb
|
264
|
+
- spec/unit/rom/relation/wrap_spec.rb
|
265
|
+
- spec/unit/rom/repository/class_methods/build_spec.rb
|
266
|
+
- spec/unit/rom/repository/element_reader_spec.rb
|
267
|
+
- spec/unit/rom/repository/element_writer_spec.rb
|
268
|
+
- spec/unit/rom/schema/builder/class_methods/build_spec.rb
|
269
|
+
- spec/unit/rom/schema/element_reader_spec.rb
|
270
|
+
- spec/unit/rom/session/class_methods/start_spec.rb
|
271
|
+
- spec/unit/rom/session/clean_predicate_spec.rb
|
272
|
+
- spec/unit/rom/session/environment/element_reader_spec.rb
|
273
|
+
- spec/unit/rom/session/flush_spec.rb
|
274
|
+
- spec/unit/rom/session/mapper/load_spec.rb
|
275
|
+
- spec/unit/rom/session/relation/delete_spec.rb
|
276
|
+
- spec/unit/rom/session/relation/dirty_predicate_spec.rb
|
277
|
+
- spec/unit/rom/session/relation/identity_spec.rb
|
278
|
+
- spec/unit/rom/session/relation/new_spec.rb
|
279
|
+
- spec/unit/rom/session/relation/save_spec.rb
|
280
|
+
- spec/unit/rom/session/relation/state_spec.rb
|
281
|
+
- spec/unit/rom/session/relation/track_spec.rb
|
282
|
+
- spec/unit/rom/session/relation/tracking_predicate_spec.rb
|
283
|
+
- spec/unit/rom/session/relation/update_attributes_spec.rb
|
284
|
+
- spec/unit/rom/session/state_spec.rb
|
84
285
|
homepage: http://rom-rb.org
|
85
286
|
licenses:
|
86
287
|
- MIT
|