memory_model 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -4
- data/Appraisals +9 -0
- data/Guardfile +7 -1
- data/README.md +5 -1
- data/Rakefile +12 -0
- data/gemfiles/rails_3.gemfile +8 -0
- data/gemfiles/rails_3.gemfile.lock +109 -0
- data/gemfiles/rails_4.gemfile +8 -0
- data/gemfiles/rails_4.gemfile.lock +117 -0
- data/lib/memory_model/base/actions/class_methods.rb +27 -0
- data/lib/memory_model/base/actions.rb +75 -0
- data/lib/memory_model/base/attributes.rb +87 -0
- data/lib/memory_model/base/auto_increment.rb +47 -0
- data/lib/memory_model/base/collectible.rb +26 -0
- data/lib/memory_model/base/conversion.rb +11 -0
- data/lib/memory_model/base/fields/field.rb +57 -0
- data/lib/memory_model/base/fields/field_set.rb +87 -0
- data/lib/memory_model/base/fields.rb +49 -0
- data/lib/memory_model/base/operations/comparisons.rb +25 -0
- data/lib/memory_model/base/operations.rb +10 -0
- data/lib/memory_model/base/persistence.rb +13 -11
- data/lib/memory_model/base.rb +58 -43
- data/lib/memory_model/collection/finders.rb +75 -0
- data/lib/memory_model/collection/index/multi.rb +61 -0
- data/lib/memory_model/collection/index/unique.rb +79 -0
- data/lib/memory_model/collection/index.rb +86 -0
- data/lib/memory_model/collection/initializers.rb +48 -0
- data/lib/memory_model/collection/loader_delegate.rb +63 -0
- data/lib/memory_model/collection/marshaled_record.rb +23 -0
- data/lib/memory_model/collection/operations.rb +82 -0
- data/lib/memory_model/collection.rb +18 -73
- data/lib/memory_model/version.rb +1 -1
- data/lib/memory_model.rb +7 -7
- data/memory_model.gemspec +8 -3
- data/spec/benchmark/benchmark.rb +126 -0
- data/spec/memory_model/base/{actionable_spec.rb → actions_spec.rb} +34 -103
- data/spec/memory_model/base/{attributable_spec.rb → attributes_spec.rb} +4 -6
- data/spec/memory_model/base/{collectable_spec.rb → collectible_spec.rb} +1 -1
- data/spec/memory_model/base/fieldable/field_set_spec.rb +23 -37
- data/spec/memory_model/base/fieldable/field_spec.rb +16 -16
- data/spec/memory_model/base/{fieldable_spec.rb → fields_spec.rb} +1 -1
- data/spec/memory_model/base/{comparable_spec.rb → operations/comparisons_spec.rb} +4 -4
- data/spec/memory_model/base/persistence_spec.rb +2 -2
- data/spec/memory_model/base_spec.rb +10 -9
- data/spec/memory_model/collection_spec.rb +24 -146
- data/spec/spec_helper.rb +11 -0
- data/spec/support/delegate_matcher.rb +40 -0
- metadata +120 -65
- data/.idea/.rakeTasks +0 -7
- data/.idea/dictionaries/jwaldrip.xml +0 -3
- data/.idea/encodings.xml +0 -5
- data/.idea/memory_model.iml +0 -47
- data/.idea/misc.xml +0 -8
- data/.idea/modules.xml +0 -9
- data/.idea/scopes/scope_settings.xml +0 -5
- data/.idea/vcs.xml +0 -7
- data/.idea/workspace.xml +0 -701
- data/lib/memory_model/base/actionable.rb +0 -95
- data/lib/memory_model/base/attributable.rb +0 -76
- data/lib/memory_model/base/collectable.rb +0 -22
- data/lib/memory_model/base/comparable.rb +0 -16
- data/lib/memory_model/base/fieldable/field.rb +0 -35
- data/lib/memory_model/base/fieldable/field_set.rb +0 -74
- data/lib/memory_model/base/fieldable.rb +0 -45
- data/lib/memory_model/base/versionable.rb +0 -17
- data/lib/memory_model/core_ext/object.rb +0 -5
- data/spec/memory_model/base/versionable_spec.rb +0 -31
- data/spec/memory_model/core_ext/object_spec.rb +0 -12
@@ -3,20 +3,19 @@ require 'spec_helper'
|
|
3
3
|
describe MemoryModel::Collection do
|
4
4
|
|
5
5
|
let(:klass) { MemoryModel::Collection }
|
6
|
-
let(:model)
|
7
|
-
|
8
|
-
|
6
|
+
let(:model) do
|
7
|
+
model = Class.new(MemoryModel::Base) do
|
8
|
+
set_primary_key :id
|
9
|
+
end
|
9
10
|
stub_const('MyModel', model)
|
10
11
|
end
|
11
12
|
|
13
|
+
subject(:collection) { model.collection }
|
14
|
+
|
12
15
|
describe '.new' do
|
13
16
|
it 'should be empty' do
|
14
17
|
collection.size.should == 0
|
15
18
|
end
|
16
|
-
|
17
|
-
it 'should be present' do
|
18
|
-
klass.all.should include collection
|
19
|
-
end
|
20
19
|
end
|
21
20
|
|
22
21
|
describe '.all' do
|
@@ -25,115 +24,48 @@ describe MemoryModel::Collection do
|
|
25
24
|
end
|
26
25
|
end
|
27
26
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
collection.all.should be_a Array
|
27
|
+
describe '.index_names' do
|
28
|
+
it 'should return the name of all the indexes' do
|
29
|
+
allow(collection).to receive(:indexes).and_return({ foo: [], bar: [], baz: []})
|
30
|
+
collection.index_names.should include :foo, :bar, :baz
|
33
31
|
end
|
32
|
+
end
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
collection.all
|
38
|
-
end
|
34
|
+
describe '.index_by' do
|
35
|
+
it 'should add a index key' do
|
39
36
|
|
40
|
-
it 'should not contain deleted items' do
|
41
|
-
3.times { model.new.commit }
|
42
|
-
model.new.commit.delete
|
43
|
-
collection.all.each do |record|
|
44
|
-
record.should_not be_deleted
|
45
|
-
end
|
46
37
|
end
|
47
38
|
end
|
48
39
|
|
49
|
-
|
50
|
-
it 'should be an array' do
|
51
|
-
collection.deleted.should be_a Array
|
52
|
-
end
|
53
|
-
|
54
|
-
it 'should call unique' do
|
55
|
-
collection.should_receive(:unique).and_return([])
|
56
|
-
collection.deleted
|
57
|
-
end
|
40
|
+
# Instance Methods
|
58
41
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
collection.deleted.each do |record|
|
63
|
-
record.should be_deleted
|
64
|
-
end
|
42
|
+
describe '#all' do
|
43
|
+
it 'should be an array' do
|
44
|
+
collection.all.should be_a MemoryModel::Collection::LoaderDelegate
|
65
45
|
end
|
66
46
|
end
|
67
47
|
|
68
48
|
describe '#find' do
|
69
49
|
it 'should return a single object' do
|
70
|
-
id = model.
|
50
|
+
id = model.create.id
|
71
51
|
collection.find(id).should be_present
|
72
52
|
end
|
73
53
|
|
74
54
|
it 'should have unfrozen attributes' do
|
75
|
-
instance = model.
|
76
|
-
instance.commit
|
55
|
+
instance = model.create
|
77
56
|
collection.find(instance.id).instance_variable_get(:@attributes).should_not be_frozen
|
78
57
|
end
|
79
58
|
|
80
59
|
it 'should not return a deleted object' do
|
81
|
-
instance = model.
|
82
|
-
instance.commit.delete
|
60
|
+
instance = model.create.delete
|
83
61
|
expect { collection.find(instance.id) }.to raise_error MemoryModel::RecordNotFoundError
|
84
62
|
end
|
85
63
|
|
86
|
-
context 'with the deleted option' do
|
87
|
-
it 'should return a deleted object with the deleted option' do
|
88
|
-
instance = model.new
|
89
|
-
instance.commit.delete
|
90
|
-
collection.find(instance.id, deleted: true).should be_present
|
91
|
-
collection.find(instance.id, deleted: true).should be_deleted
|
92
|
-
collection.find(instance.id, deleted: true).should be_frozen
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
context 'with a version' do
|
97
|
-
it 'should return a version' do
|
98
|
-
model.send(:field, :foo)
|
99
|
-
instance = model.new(foo: 'bar')
|
100
|
-
instance.commit
|
101
|
-
instance.foo = 'baz'
|
102
|
-
instance.commit
|
103
|
-
collection.find(instance.id, version: 1).foo.should == 'bar'
|
104
|
-
end
|
105
|
-
|
106
|
-
it 'should return previous version of a deleted object' do
|
107
|
-
instance = model.new
|
108
|
-
instance.commit.delete
|
109
|
-
expect { collection.find(instance.id) }.to raise_error MemoryModel::RecordNotFoundError
|
110
|
-
collection.find(instance.id, version: 1).should be_present
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
describe "#insert" do
|
116
|
-
it 'should raise an error for an invalid object' do
|
117
|
-
expect { collection.insert Object.new }.to raise_error MemoryModel::Collection::InvalidTypeError
|
118
|
-
end
|
119
|
-
|
120
|
-
it 'should duplicate a record being inserted' do
|
121
|
-
instance = model.new
|
122
|
-
instance.should_receive :dup
|
123
|
-
collection.insert instance
|
124
|
-
end
|
125
|
-
|
126
|
-
it 'should freeze a record being inserted' do
|
127
|
-
instance = model.new
|
128
|
-
collection.insert instance
|
129
|
-
collection.last.should == instance
|
130
|
-
collection.records(false).last.should be_frozen
|
131
|
-
end
|
132
64
|
end
|
133
65
|
|
134
66
|
describe '#inspect' do
|
135
67
|
it 'should delegate inspect to all' do
|
136
|
-
all_mock =
|
68
|
+
all_mock = double
|
137
69
|
all_mock.should_receive(:inspect)
|
138
70
|
collection.stub(:all).and_return(all_mock)
|
139
71
|
collection.inspect
|
@@ -142,7 +74,7 @@ describe MemoryModel::Collection do
|
|
142
74
|
|
143
75
|
describe '#records' do
|
144
76
|
let(:mock_record) do
|
145
|
-
mock_record =
|
77
|
+
mock_record = double
|
146
78
|
mock_record.stub(:deleted?).and_return(false)
|
147
79
|
mock_record
|
148
80
|
end
|
@@ -151,65 +83,11 @@ describe MemoryModel::Collection do
|
|
151
83
|
collection.instance_variable_set :@records, [mock_record]
|
152
84
|
end
|
153
85
|
|
154
|
-
it 'should dup records' do
|
155
|
-
mock_record.should_receive(:dup)
|
156
|
-
collection.records
|
157
|
-
end
|
158
|
-
|
159
|
-
it 'should not dup records' do
|
160
|
-
mock_record.should_not_receive(:dup)
|
161
|
-
collection.records(false)
|
162
|
-
end
|
163
86
|
end
|
164
87
|
|
165
88
|
describe '#records' do
|
166
|
-
it 'should
|
167
|
-
|
168
|
-
collection.records.each do |record|
|
169
|
-
record.should_not be_frozen
|
170
|
-
end
|
171
|
-
collection.records.size.should == 3
|
172
|
-
end
|
173
|
-
end
|
174
|
-
|
175
|
-
describe '#method_missing' do
|
176
|
-
it 'should delegate method to all' do
|
177
|
-
all_mock = mock
|
178
|
-
all_mock.should_receive(:test_method)
|
179
|
-
collection.stub(:all).and_return(all_mock)
|
180
|
-
collection.test_method
|
181
|
-
end
|
182
|
-
end
|
183
|
-
|
184
|
-
describe '#respond_to_missing?' do
|
185
|
-
it 'should check if all responds to' do
|
186
|
-
all_mock = mock
|
187
|
-
all_mock.should_receive(:respond_to?)
|
188
|
-
collection.stub(:all).and_return(all_mock)
|
189
|
-
collection.send :respond_to_missing?, :test_method
|
190
|
-
end
|
191
|
-
end
|
192
|
-
|
193
|
-
describe 'sorted' do
|
194
|
-
it 'should be sorted by timestamp, with most recent first' do
|
195
|
-
item_1 = model.new.commit
|
196
|
-
item_2 = model.new.commit
|
197
|
-
collection[1].should == item_1
|
198
|
-
collection[0].should == item_2
|
199
|
-
end
|
200
|
-
end
|
201
|
-
|
202
|
-
describe '#unique' do
|
203
|
-
it 'should contain unique items' do
|
204
|
-
instance = model.new
|
205
|
-
3.times { instance.commit }
|
206
|
-
collection.send(:unique).size.should == 1
|
207
|
-
collection.records.size.should == 3
|
208
|
-
end
|
209
|
-
|
210
|
-
it 'should call sorted' do
|
211
|
-
collection.should_receive(:sorted).and_return([])
|
212
|
-
collection.send(:unique)
|
89
|
+
it 'should be an array' do
|
90
|
+
collection.send(:records).should be_an Array
|
213
91
|
end
|
214
92
|
end
|
215
93
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,18 @@
|
|
1
1
|
require 'simplecov'
|
2
|
+
require 'coveralls'
|
3
|
+
|
4
|
+
require 'rspec/autorun'
|
5
|
+
require 'bundler/setup'
|
6
|
+
require 'pry'
|
7
|
+
|
8
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
9
|
+
SimpleCov::Formatter::HTMLFormatter,
|
10
|
+
Coveralls::SimpleCov::Formatter
|
11
|
+
]
|
2
12
|
SimpleCov.start
|
3
13
|
|
4
14
|
require 'memory_model'
|
15
|
+
|
5
16
|
Dir["./spec/support/**/*.rb"].sort.each {|f| require f}
|
6
17
|
|
7
18
|
RSpec.configure do |config|
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# RSpec matcher to spec delegations.
|
2
|
+
#
|
3
|
+
# Usage:
|
4
|
+
#
|
5
|
+
# describe Post do
|
6
|
+
# it { should delegate(:name).to(:author).with_prefix } # post.author_name
|
7
|
+
# it { should delegate(:month).to(:created_at) }
|
8
|
+
# it { should delegate(:year).to(:created_at) }
|
9
|
+
# end
|
10
|
+
|
11
|
+
RSpec::Matchers.define :delegate do |target_method|
|
12
|
+
match do |delegator|
|
13
|
+
source_method = @prefix ? :"#{@to}_#{target_method}" : target_method
|
14
|
+
@delegator = delegator
|
15
|
+
begin
|
16
|
+
@delegator.send(@to)
|
17
|
+
rescue NoMethodError
|
18
|
+
raise "#{@delegator} does not respond to #{@to}!"
|
19
|
+
end
|
20
|
+
allow(@delegator).to receive(@to).and_return(double 'receiver', target_method => :called)
|
21
|
+
args = (target_method =~ /[^\]]=$/) ? [:called] : []
|
22
|
+
@delegator.send(source_method, *args) == :called
|
23
|
+
end
|
24
|
+
|
25
|
+
description do
|
26
|
+
"delegate :#{target_method} to its #{@to}#{@prefix ? ' with prefix' : ''}"
|
27
|
+
end
|
28
|
+
|
29
|
+
failure_message_for_should do |text|
|
30
|
+
"expected #{@delegator} to delegate :#{target_method} to its #{@to}#{@prefix ? ' with prefix' : ''}"
|
31
|
+
end
|
32
|
+
|
33
|
+
failure_message_for_should_not do |text|
|
34
|
+
"expected #{@delegator} not to delegate :#{target_method} to its #{@to}#{@prefix ? ' with prefix' : ''}"
|
35
|
+
end
|
36
|
+
|
37
|
+
chain(:to) { |receiver| @to = receiver }
|
38
|
+
chain(:with_prefix) { @prefix = true }
|
39
|
+
|
40
|
+
end
|
metadata
CHANGED
@@ -1,52 +1,46 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memory_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jason Waldrip
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-10-17 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: activemodel
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
19
|
+
version: '3.2'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ! '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
26
|
+
version: '3.2'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: activesupport
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ! '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: '
|
33
|
+
version: '3.2'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ! '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: '
|
40
|
+
version: '3.2'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: concerned_inheritance
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ! '>='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,23 +48,20 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ! '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
56
|
+
name: appraisal
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ! '>='
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
|
-
type: :
|
62
|
+
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ! '>='
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,7 +69,6 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: guard-rspec
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - ! '>='
|
84
74
|
- !ruby/object:Gem::Version
|
@@ -86,7 +76,20 @@ dependencies:
|
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: guard-bundler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
93
|
requirements:
|
91
94
|
- - ! '>='
|
92
95
|
- !ruby/object:Gem::Version
|
@@ -94,7 +97,6 @@ dependencies:
|
|
94
97
|
- !ruby/object:Gem::Dependency
|
95
98
|
name: rb-fsevent
|
96
99
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
100
|
requirements:
|
99
101
|
- - ! '>='
|
100
102
|
- !ruby/object:Gem::Version
|
@@ -102,7 +104,6 @@ dependencies:
|
|
102
104
|
type: :development
|
103
105
|
prerelease: false
|
104
106
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
107
|
requirements:
|
107
108
|
- - ! '>='
|
108
109
|
- !ruby/object:Gem::Version
|
@@ -110,7 +111,6 @@ dependencies:
|
|
110
111
|
- !ruby/object:Gem::Dependency
|
111
112
|
name: rspec
|
112
113
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
114
|
requirements:
|
115
115
|
- - ! '>='
|
116
116
|
- !ruby/object:Gem::Version
|
@@ -118,7 +118,6 @@ dependencies:
|
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
121
|
requirements:
|
123
122
|
- - ! '>='
|
124
123
|
- !ruby/object:Gem::Version
|
@@ -126,7 +125,6 @@ dependencies:
|
|
126
125
|
- !ruby/object:Gem::Dependency
|
127
126
|
name: simplecov
|
128
127
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
128
|
requirements:
|
131
129
|
- - ! '>='
|
132
130
|
- !ruby/object:Gem::Version
|
@@ -134,7 +132,6 @@ dependencies:
|
|
134
132
|
type: :development
|
135
133
|
prerelease: false
|
136
134
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
135
|
requirements:
|
139
136
|
- - ! '>='
|
140
137
|
- !ruby/object:Gem::Version
|
@@ -142,7 +139,6 @@ dependencies:
|
|
142
139
|
- !ruby/object:Gem::Dependency
|
143
140
|
name: terminal-notifier-guard
|
144
141
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
142
|
requirements:
|
147
143
|
- - ! '>='
|
148
144
|
- !ruby/object:Gem::Version
|
@@ -150,7 +146,6 @@ dependencies:
|
|
150
146
|
type: :development
|
151
147
|
prerelease: false
|
152
148
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
149
|
requirements:
|
155
150
|
- - ! '>='
|
156
151
|
- !ruby/object:Gem::Version
|
@@ -158,7 +153,6 @@ dependencies:
|
|
158
153
|
- !ruby/object:Gem::Dependency
|
159
154
|
name: test-unit
|
160
155
|
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
156
|
requirements:
|
163
157
|
- - ! '>='
|
164
158
|
- !ruby/object:Gem::Version
|
@@ -166,7 +160,62 @@ dependencies:
|
|
166
160
|
type: :development
|
167
161
|
prerelease: false
|
168
162
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
|
163
|
+
requirements:
|
164
|
+
- - ! '>='
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: coveralls
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ! '>='
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: pry
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ! '>='
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ! '>='
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: colorize
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ! '>='
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ! '>='
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: faker
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ! '>='
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
170
219
|
requirements:
|
171
220
|
- - ! '>='
|
172
221
|
- !ruby/object:Gem::Version
|
@@ -180,87 +229,93 @@ extensions: []
|
|
180
229
|
extra_rdoc_files: []
|
181
230
|
files:
|
182
231
|
- .gitignore
|
183
|
-
- .idea/.rakeTasks
|
184
|
-
- .idea/dictionaries/jwaldrip.xml
|
185
|
-
- .idea/encodings.xml
|
186
|
-
- .idea/memory_model.iml
|
187
|
-
- .idea/misc.xml
|
188
|
-
- .idea/modules.xml
|
189
|
-
- .idea/scopes/scope_settings.xml
|
190
|
-
- .idea/vcs.xml
|
191
|
-
- .idea/workspace.xml
|
192
232
|
- .rspec
|
233
|
+
- .ruby-version
|
193
234
|
- .travis.yml
|
235
|
+
- Appraisals
|
194
236
|
- Gemfile
|
195
237
|
- Guardfile
|
196
238
|
- LICENSE.txt
|
197
239
|
- README.md
|
198
240
|
- Rakefile
|
241
|
+
- gemfiles/rails_3.gemfile
|
242
|
+
- gemfiles/rails_3.gemfile.lock
|
243
|
+
- gemfiles/rails_4.gemfile
|
244
|
+
- gemfiles/rails_4.gemfile.lock
|
199
245
|
- lib/memory_model.rb
|
200
246
|
- lib/memory_model/base.rb
|
201
|
-
- lib/memory_model/base/
|
202
|
-
- lib/memory_model/base/
|
203
|
-
- lib/memory_model/base/
|
204
|
-
- lib/memory_model/base/
|
205
|
-
- lib/memory_model/base/
|
206
|
-
- lib/memory_model/base/
|
207
|
-
- lib/memory_model/base/
|
247
|
+
- lib/memory_model/base/actions.rb
|
248
|
+
- lib/memory_model/base/actions/class_methods.rb
|
249
|
+
- lib/memory_model/base/attributes.rb
|
250
|
+
- lib/memory_model/base/auto_increment.rb
|
251
|
+
- lib/memory_model/base/collectible.rb
|
252
|
+
- lib/memory_model/base/conversion.rb
|
253
|
+
- lib/memory_model/base/fields.rb
|
254
|
+
- lib/memory_model/base/fields/field.rb
|
255
|
+
- lib/memory_model/base/fields/field_set.rb
|
256
|
+
- lib/memory_model/base/operations.rb
|
257
|
+
- lib/memory_model/base/operations/comparisons.rb
|
208
258
|
- lib/memory_model/base/persistence.rb
|
209
|
-
- lib/memory_model/base/versionable.rb
|
210
259
|
- lib/memory_model/collection.rb
|
211
|
-
- lib/memory_model/
|
260
|
+
- lib/memory_model/collection/finders.rb
|
261
|
+
- lib/memory_model/collection/index.rb
|
262
|
+
- lib/memory_model/collection/index/multi.rb
|
263
|
+
- lib/memory_model/collection/index/unique.rb
|
264
|
+
- lib/memory_model/collection/initializers.rb
|
265
|
+
- lib/memory_model/collection/loader_delegate.rb
|
266
|
+
- lib/memory_model/collection/marshaled_record.rb
|
267
|
+
- lib/memory_model/collection/operations.rb
|
212
268
|
- lib/memory_model/version.rb
|
213
269
|
- memory_model.gemspec
|
214
|
-
- spec/
|
215
|
-
- spec/memory_model/base/
|
216
|
-
- spec/memory_model/base/
|
217
|
-
- spec/memory_model/base/
|
270
|
+
- spec/benchmark/benchmark.rb
|
271
|
+
- spec/memory_model/base/actions_spec.rb
|
272
|
+
- spec/memory_model/base/attributes_spec.rb
|
273
|
+
- spec/memory_model/base/collectible_spec.rb
|
218
274
|
- spec/memory_model/base/fieldable/field_set_spec.rb
|
219
275
|
- spec/memory_model/base/fieldable/field_spec.rb
|
220
|
-
- spec/memory_model/base/
|
276
|
+
- spec/memory_model/base/fields_spec.rb
|
277
|
+
- spec/memory_model/base/operations/comparisons_spec.rb
|
221
278
|
- spec/memory_model/base/persistence_spec.rb
|
222
|
-
- spec/memory_model/base/versionable_spec.rb
|
223
279
|
- spec/memory_model/base_spec.rb
|
224
280
|
- spec/memory_model/collection_spec.rb
|
225
|
-
- spec/memory_model/core_ext/object_spec.rb
|
226
281
|
- spec/spec_helper.rb
|
227
282
|
- spec/support/active_model_lint.rb
|
283
|
+
- spec/support/delegate_matcher.rb
|
228
284
|
homepage: http://github.com/jwaldrip/memory_model
|
229
285
|
licenses: []
|
286
|
+
metadata: {}
|
230
287
|
post_install_message:
|
231
288
|
rdoc_options: []
|
232
289
|
require_paths:
|
233
290
|
- lib
|
234
291
|
required_ruby_version: !ruby/object:Gem::Requirement
|
235
|
-
none: false
|
236
292
|
requirements:
|
237
293
|
- - ! '>='
|
238
294
|
- !ruby/object:Gem::Version
|
239
295
|
version: '0'
|
240
296
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
241
|
-
none: false
|
242
297
|
requirements:
|
243
298
|
- - ! '>='
|
244
299
|
- !ruby/object:Gem::Version
|
245
300
|
version: '0'
|
246
301
|
requirements: []
|
247
302
|
rubyforge_project:
|
248
|
-
rubygems_version: 1.
|
303
|
+
rubygems_version: 2.1.5
|
249
304
|
signing_key:
|
250
|
-
specification_version:
|
305
|
+
specification_version: 4
|
251
306
|
summary: An in memory, ORM
|
252
307
|
test_files:
|
253
|
-
- spec/
|
254
|
-
- spec/memory_model/base/
|
255
|
-
- spec/memory_model/base/
|
256
|
-
- spec/memory_model/base/
|
308
|
+
- spec/benchmark/benchmark.rb
|
309
|
+
- spec/memory_model/base/actions_spec.rb
|
310
|
+
- spec/memory_model/base/attributes_spec.rb
|
311
|
+
- spec/memory_model/base/collectible_spec.rb
|
257
312
|
- spec/memory_model/base/fieldable/field_set_spec.rb
|
258
313
|
- spec/memory_model/base/fieldable/field_spec.rb
|
259
|
-
- spec/memory_model/base/
|
314
|
+
- spec/memory_model/base/fields_spec.rb
|
315
|
+
- spec/memory_model/base/operations/comparisons_spec.rb
|
260
316
|
- spec/memory_model/base/persistence_spec.rb
|
261
|
-
- spec/memory_model/base/versionable_spec.rb
|
262
317
|
- spec/memory_model/base_spec.rb
|
263
318
|
- spec/memory_model/collection_spec.rb
|
264
|
-
- spec/memory_model/core_ext/object_spec.rb
|
265
319
|
- spec/spec_helper.rb
|
266
320
|
- spec/support/active_model_lint.rb
|
321
|
+
- spec/support/delegate_matcher.rb
|
data/.idea/.rakeTasks
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
-
You are allowed to:
|
4
|
-
1. Remove rake task
|
5
|
-
2. Add existing rake tasks
|
6
|
-
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
-
--><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
|