massive_record 0.1.1 → 0.2.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +28 -5
- data/Gemfile.lock +12 -12
- data/README.md +29 -1
- data/lib/massive_record/adapters/initialize.rb +18 -0
- data/lib/massive_record/adapters/thrift/adapter.rb +25 -0
- data/lib/massive_record/adapters/thrift/column_family.rb +24 -0
- data/lib/massive_record/adapters/thrift/connection.rb +73 -0
- data/lib/massive_record/{thrift → adapters/thrift/hbase}/hbase.rb +0 -0
- data/lib/massive_record/{thrift → adapters/thrift/hbase}/hbase_constants.rb +0 -0
- data/lib/massive_record/{thrift → adapters/thrift/hbase}/hbase_types.rb +0 -0
- data/lib/massive_record/adapters/thrift/row.rb +150 -0
- data/lib/massive_record/adapters/thrift/scanner.rb +59 -0
- data/lib/massive_record/adapters/thrift/table.rb +169 -0
- data/lib/massive_record/orm/attribute_methods/read.rb +2 -1
- data/lib/massive_record/orm/base.rb +61 -3
- data/lib/massive_record/orm/coders/chained.rb +71 -0
- data/lib/massive_record/orm/coders/json.rb +17 -0
- data/lib/massive_record/orm/coders/yaml.rb +15 -0
- data/lib/massive_record/orm/coders.rb +3 -0
- data/lib/massive_record/orm/errors.rb +15 -2
- data/lib/massive_record/orm/finders/scope.rb +166 -0
- data/lib/massive_record/orm/finders.rb +45 -24
- data/lib/massive_record/orm/persistence.rb +4 -4
- data/lib/massive_record/orm/relations/interface.rb +170 -0
- data/lib/massive_record/orm/relations/metadata.rb +150 -0
- data/lib/massive_record/orm/relations/proxy/references_many.rb +229 -0
- data/lib/massive_record/orm/relations/proxy/references_one.rb +40 -0
- data/lib/massive_record/orm/relations/proxy/references_one_polymorphic.rb +49 -0
- data/lib/massive_record/orm/relations/proxy.rb +174 -0
- data/lib/massive_record/orm/relations.rb +6 -0
- data/lib/massive_record/orm/schema/column_interface.rb +1 -1
- data/lib/massive_record/orm/schema/field.rb +62 -27
- data/lib/massive_record/orm/single_table_inheritance.rb +21 -0
- data/lib/massive_record/version.rb +1 -1
- data/lib/massive_record/wrapper/adapter.rb +6 -0
- data/lib/massive_record/wrapper/base.rb +6 -7
- data/lib/massive_record/wrapper/cell.rb +9 -32
- data/lib/massive_record/wrapper/column_families_collection.rb +2 -2
- data/lib/massive_record/wrapper/errors.rb +10 -0
- data/lib/massive_record/wrapper/tables_collection.rb +1 -1
- data/lib/massive_record.rb +5 -12
- data/spec/orm/cases/attribute_methods_spec.rb +5 -1
- data/spec/orm/cases/base_spec.rb +77 -4
- data/spec/orm/cases/column_spec.rb +1 -1
- data/spec/orm/cases/finder_default_scope.rb +53 -0
- data/spec/orm/cases/finder_scope_spec.rb +288 -0
- data/spec/orm/cases/finders_spec.rb +56 -13
- data/spec/orm/cases/persistence_spec.rb +20 -5
- data/spec/orm/cases/single_table_inheritance_spec.rb +26 -0
- data/spec/orm/cases/table_spec.rb +1 -1
- data/spec/orm/cases/timestamps_spec.rb +16 -16
- data/spec/orm/coders/chained_spec.rb +73 -0
- data/spec/orm/coders/json_spec.rb +6 -0
- data/spec/orm/coders/yaml_spec.rb +6 -0
- data/spec/orm/models/best_friend.rb +7 -0
- data/spec/orm/models/friend.rb +4 -0
- data/spec/orm/models/person.rb +20 -6
- data/spec/orm/models/{person_with_timestamps.rb → person_with_timestamp.rb} +1 -1
- data/spec/orm/models/test_class.rb +3 -0
- data/spec/orm/relations/interface_spec.rb +207 -0
- data/spec/orm/relations/metadata_spec.rb +202 -0
- data/spec/orm/relations/proxy/references_many_spec.rb +624 -0
- data/spec/orm/relations/proxy/references_one_polymorphic_spec.rb +106 -0
- data/spec/orm/relations/proxy/references_one_spec.rb +111 -0
- data/spec/orm/relations/proxy_spec.rb +13 -0
- data/spec/orm/schema/field_spec.rb +101 -2
- data/spec/shared/orm/coders/an_orm_coder.rb +14 -0
- data/spec/shared/orm/relations/proxy.rb +154 -0
- data/spec/shared/orm/relations/singular_proxy.rb +68 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/thrift/cases/encoding_spec.rb +28 -7
- data/spec/wrapper/cases/adapter_spec.rb +9 -0
- data/spec/wrapper/cases/connection_spec.rb +13 -10
- data/spec/wrapper/cases/table_spec.rb +85 -85
- metadata +74 -22
- data/TODO.md +0 -8
- data/lib/massive_record/exceptions.rb +0 -11
- data/lib/massive_record/wrapper/column_family.rb +0 -22
- data/lib/massive_record/wrapper/connection.rb +0 -71
- data/lib/massive_record/wrapper/row.rb +0 -173
- data/lib/massive_record/wrapper/scanner.rb +0 -61
- data/lib/massive_record/wrapper/table.rb +0 -149
- data/spec/orm/cases/hbase/connection_spec.rb +0 -13
@@ -0,0 +1,68 @@
|
|
1
|
+
shared_examples_for "singular proxy" do
|
2
|
+
let(:proxy_target) { mock(Object).as_null_object }
|
3
|
+
let(:find_proxy_target_returns) { subject.represents_a_collection? ? [proxy_target] : proxy_target }
|
4
|
+
|
5
|
+
before do
|
6
|
+
subject.metadata = mock(MassiveRecord::ORM::Relations::Metadata, :find_with => nil).as_null_object if subject.metadata.nil?
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "forward method calls to proxy_target" do
|
10
|
+
let(:proxy_target) { mock(Object, :proxy_target_method => "return value", :id => "dummy-id") }
|
11
|
+
|
12
|
+
before do
|
13
|
+
subject.proxy_target = proxy_target
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
describe "#respond_to?" do
|
18
|
+
it "should check proxy to see if it responds to something" do
|
19
|
+
should respond_to :proxy_target
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should respond to proxy_target_method" do
|
23
|
+
should respond_to :proxy_target_method
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should not respond to a dummy method" do
|
27
|
+
should_not respond_to :dummy_method_which_does_not_exists
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
describe "#method_missing" do
|
33
|
+
it "should call proxy's method if exists in proxy" do
|
34
|
+
subject.should_receive(:loaded?).once
|
35
|
+
subject.loaded?
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should call proxy_target's method if it responds to it" do
|
39
|
+
proxy_target.should_receive(:proxy_target_method).and_return(proxy_target)
|
40
|
+
subject.proxy_target_method.should == proxy_target
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should rause no method error if no one responds to it" do
|
44
|
+
lambda { subject.dummy_method_which_does_not_exists }.should raise_error NoMethodError
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe "comparison of class" do
|
49
|
+
let(:proxy_target) { Person.new }
|
50
|
+
|
51
|
+
it "should be answer correctly to which class it is" do
|
52
|
+
subject.should be_a(Person)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should be comparable correctly" do
|
56
|
+
(Person === subject).should be_true
|
57
|
+
end
|
58
|
+
|
59
|
+
it "should be compared correctly in a case when construction" do
|
60
|
+
case subject
|
61
|
+
when Person
|
62
|
+
else
|
63
|
+
fail
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -24,23 +24,44 @@ describe "encoding" do
|
|
24
24
|
it "should save standard caracteres" do
|
25
25
|
m = Apache::Hadoop::Hbase::Thrift::Mutation.new
|
26
26
|
m.column = "info:first_name"
|
27
|
-
m.value = "Vincent"
|
27
|
+
m.value = "Vincent".force_encoding(Encoding::BINARY)
|
28
28
|
|
29
|
-
m.value.encoding.should == Encoding::
|
30
|
-
@client.mutateRow(@table_name, "ID1", [m]).should be_nil
|
29
|
+
m.value.encoding.should == Encoding::BINARY
|
30
|
+
@client.mutateRow(@table_name, "ID1", [m]).should be_nil
|
31
31
|
end
|
32
32
|
|
33
33
|
it "should save UTF8 caracteres" do
|
34
|
-
pending "UTF8 enconding need to be fixed!"
|
35
|
-
|
36
34
|
m = Apache::Hadoop::Hbase::Thrift::Mutation.new
|
37
35
|
m.column = "info:first_name"
|
38
|
-
m.value = "Thorbjørn"
|
36
|
+
m.value = "Thorbjørn".force_encoding(Encoding::BINARY)
|
39
37
|
|
40
|
-
m.value.encoding.should == Encoding::
|
38
|
+
m.value.encoding.should == Encoding::BINARY
|
41
39
|
@client.mutateRow(@table_name, "ID1", [m]).should be_nil
|
42
40
|
end
|
43
41
|
|
42
|
+
it "should save JSON" do
|
43
|
+
m = Apache::Hadoop::Hbase::Thrift::Mutation.new
|
44
|
+
m.column = "info:first_name"
|
45
|
+
m.value = { :p1 => "Vincent", :p2 => "Thorbjørn"}.to_json.force_encoding(Encoding::BINARY)
|
46
|
+
|
47
|
+
m.value.encoding.should == Encoding::BINARY
|
48
|
+
@client.mutateRow(@table_name, "ID1", [m]).should be_nil
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should take care of several encodings" do
|
52
|
+
m1 = Apache::Hadoop::Hbase::Thrift::Mutation.new
|
53
|
+
m1.column = "info:first_name"
|
54
|
+
m1.value = { :p1 => "Vincent", :p2 => "Thorbjørn"}.to_json.force_encoding(Encoding::BINARY)
|
55
|
+
|
56
|
+
m2 = Apache::Hadoop::Hbase::Thrift::Mutation.new
|
57
|
+
m2.column = "info:company_name"
|
58
|
+
# "incompatible character encodings: ASCII-8BIT and UTF-8" is raised if we don't force encoding
|
59
|
+
# because m1 is binary and m2 is UTF-8
|
60
|
+
m2.value = "Thorbjørn".force_encoding(Encoding::BINARY)
|
61
|
+
|
62
|
+
@client.mutateRow(@table_name, "ID1", [m1, m2]).should be_nil
|
63
|
+
end
|
64
|
+
|
44
65
|
it "should destroy the table" do
|
45
66
|
@client.disableTable(@table_name).should be_nil
|
46
67
|
@client.deleteTable(@table_name).should be_nil
|
@@ -1,11 +1,15 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe "A connection" do
|
4
4
|
|
5
5
|
before do
|
6
6
|
@connection = MassiveRecord::Wrapper::Connection.new(:host => MR_CONFIG['host'], :port => MR_CONFIG['port'])
|
7
7
|
end
|
8
8
|
|
9
|
+
after do
|
10
|
+
@connection.close if @connection.open?
|
11
|
+
end
|
12
|
+
|
9
13
|
it "should have a host and port attributes" do
|
10
14
|
connections = [@connection, MassiveRecord::Wrapper::Connection.new(:host => "somewhere")]
|
11
15
|
|
@@ -15,25 +19,24 @@ describe MassiveRecord::Wrapper::Connection do
|
|
15
19
|
end
|
16
20
|
end
|
17
21
|
|
18
|
-
it "should not be
|
19
|
-
|
20
|
-
@connection.active?.should be_false
|
22
|
+
it "should not be open" do
|
23
|
+
@connection.open?.should be_false
|
21
24
|
end
|
22
25
|
|
23
26
|
it "should not be able to open a new connection with a wrong configuration and Raise an error" do
|
24
27
|
@connection.port = 1234
|
25
|
-
lambda{@connection.open}.should raise_error(MassiveRecord::ConnectionException)
|
28
|
+
lambda{@connection.open}.should raise_error(MassiveRecord::Wrapper::Errors::ConnectionException)
|
26
29
|
end
|
27
30
|
|
28
|
-
it "should be
|
31
|
+
it "should be open if opened" do
|
29
32
|
@connection.open.should be_true
|
33
|
+
@connection.open?.should be_true
|
30
34
|
end
|
31
35
|
|
32
|
-
it "should not be
|
33
|
-
@connection.open
|
34
|
-
@connection.active?.should be_true
|
36
|
+
it "should not be open if closed" do
|
37
|
+
@connection.open.should be_true
|
35
38
|
@connection.close.should be_true
|
36
|
-
@connection.
|
39
|
+
@connection.open?.should be_false
|
37
40
|
end
|
38
41
|
|
39
42
|
it "should have a collection of tables" do
|
@@ -1,13 +1,15 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe "A table" do
|
4
4
|
|
5
|
-
|
5
|
+
before(:all) do
|
6
|
+
@connection = MassiveRecord::Wrapper::Connection.new(:host => MR_CONFIG['host'], :port => MR_CONFIG['port'])
|
7
|
+
@connection.open
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "with an open connection" do
|
6
11
|
|
7
12
|
before do
|
8
|
-
@connection = MassiveRecord::Wrapper::Connection.new(:host => MR_CONFIG['host'], :port => MR_CONFIG['port'])
|
9
|
-
@connection.open
|
10
|
-
|
11
13
|
@table = MassiveRecord::Wrapper::Table.new(@connection, MR_CONFIG['table'])
|
12
14
|
end
|
13
15
|
|
@@ -53,31 +55,27 @@ describe MassiveRecord::Wrapper::Table do
|
|
53
55
|
row.values = {
|
54
56
|
:info => { :first_name => "John", :last_name => "Doe", :email => "john@base.com" },
|
55
57
|
:misc => {
|
56
|
-
:like => ["Eating", "Sleeping", "Coding"],
|
58
|
+
:like => ["Eating", "Sleeping", "Coding"].to_json,
|
57
59
|
:dislike => {
|
58
60
|
"Washing" => "Boring 6/10",
|
59
61
|
"Ironing" => "Boring 8/10"
|
60
|
-
},
|
61
|
-
:empty => {},
|
62
|
+
}.to_json,
|
63
|
+
:empty => {}.to_json,
|
62
64
|
:value_to_increment => "1"
|
63
65
|
}
|
64
66
|
}
|
65
67
|
row.table = @table
|
66
68
|
row.save
|
67
69
|
end
|
68
|
-
|
69
|
-
it "should contains one row" do
|
70
|
-
@table.all.size.should == 1
|
71
|
-
end
|
72
|
-
|
73
|
-
it "should load the first row" do
|
74
|
-
@table.first.should be_a_kind_of(MassiveRecord::Wrapper::Row)
|
75
|
-
end
|
76
|
-
|
70
|
+
|
77
71
|
it "should list 5 column names" do
|
78
72
|
@table.column_names.size.should == 7
|
79
73
|
end
|
80
74
|
|
75
|
+
it "should only load one column" do
|
76
|
+
@table.get("ID1", :info, :first_name).should == "John"
|
77
|
+
end
|
78
|
+
|
81
79
|
it "should only load one column family" do
|
82
80
|
@table.first(:select => ["info"]).column_families.should == ["info"]
|
83
81
|
@table.all(:limit => 1, :select => ["info"]).first.column_families.should == ["info"]
|
@@ -137,9 +135,6 @@ describe MassiveRecord::Wrapper::Table do
|
|
137
135
|
row = MassiveRecord::Wrapper::Row.new
|
138
136
|
row.updated_at.should be_nil
|
139
137
|
end
|
140
|
-
|
141
|
-
|
142
|
-
|
143
138
|
|
144
139
|
it "should merge data" do
|
145
140
|
row = @table.first
|
@@ -149,24 +144,11 @@ describe MassiveRecord::Wrapper::Table do
|
|
149
144
|
)
|
150
145
|
end
|
151
146
|
|
152
|
-
it "should merge array data" do
|
153
|
-
row = @table.first
|
154
|
-
row.merge_columns({ :misc => { :like => ["Playing"] } })
|
155
|
-
row.columns["misc:like"].deserialize_value.should =~ ["Eating", "Sleeping", "Coding", "Playing"]
|
156
|
-
end
|
157
|
-
|
158
|
-
it "should merge hash data" do
|
159
|
-
row = @table.first
|
160
|
-
row.merge_columns({ :misc => { :dislike => { "Ironing" => "Boring 10/10", "Running" => "Boring 5/10" } } })
|
161
|
-
row.columns["misc:dislike"].deserialize_value["Ironing"].should eql("Boring 10/10") # Check updated value
|
162
|
-
row.columns["misc:dislike"].deserialize_value.keys.should =~ ["Washing", "Ironing", "Running"] # Check new value
|
163
|
-
end
|
164
|
-
|
165
147
|
it "should deserialize Array / Hash values from YAML automatically" do
|
166
148
|
row = @table.first
|
167
|
-
row.values["misc:like"].class.should eql(Array)
|
168
|
-
row.values["misc:dislike"].class.should eql(Hash)
|
169
|
-
row.values["misc:empty"].class.should eql(Hash)
|
149
|
+
ActiveSupport::JSON.decode(row.values["misc:like"]).class.should eql(Array)
|
150
|
+
ActiveSupport::JSON.decode(row.values["misc:dislike"]).class.should eql(Hash)
|
151
|
+
ActiveSupport::JSON.decode(row.values["misc:empty"]).class.should eql(Hash)
|
170
152
|
end
|
171
153
|
|
172
154
|
it "should display the previous value (versioning) of the column 'info:first_name'" do
|
@@ -214,71 +196,89 @@ describe MassiveRecord::Wrapper::Table do
|
|
214
196
|
@table.first.should be_nil
|
215
197
|
end
|
216
198
|
|
217
|
-
it "should
|
199
|
+
it "should exists in the database" do
|
200
|
+
@table.exists?.should be_true
|
201
|
+
end
|
202
|
+
|
203
|
+
it "should destroy the test table" do
|
204
|
+
@table.destroy.should be_true
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
end
|
209
|
+
|
210
|
+
describe "can be scanned" do
|
211
|
+
before do
|
212
|
+
@table = MassiveRecord::Wrapper::Table.new(@connection, MR_CONFIG['table'])
|
213
|
+
@table.column_families.create(:info)
|
214
|
+
@table.column_families.create(:misc)
|
215
|
+
|
216
|
+
@table.save
|
217
|
+
|
218
|
+
["A", "B"].each do |prefix|
|
218
219
|
1.upto(5).each do |i|
|
219
220
|
row = MassiveRecord::Wrapper::Row.new
|
220
|
-
row.id = "
|
221
|
+
row.id = "#{prefix}#{i}"
|
221
222
|
row.values = { :info => { :first_name => "John #{i}", :last_name => "Doe #{i}" } }
|
222
223
|
row.table = @table
|
223
224
|
row.save
|
224
225
|
end
|
225
|
-
|
226
|
-
@table.all.size.should == 5
|
227
|
-
end
|
228
|
-
|
229
|
-
it "should find rows" do
|
230
|
-
ids_list = [["ID1"], ["ID1", "ID2", "ID3"]]
|
231
|
-
ids_list.each do |ids|
|
232
|
-
@table.find(ids).each do |row|
|
233
|
-
ids.include?(row.id).should be_true
|
234
|
-
end
|
235
|
-
end
|
236
|
-
end
|
237
|
-
|
238
|
-
it "should collect 5 IDs" do
|
239
|
-
@table.all.collect(&:id).should eql(1.upto(5).collect{|i| "ID#{i}"})
|
240
|
-
end
|
241
|
-
|
242
|
-
it "should iterate through a collection of rows" do
|
243
|
-
@table.all.each do |row|
|
244
|
-
row.id.should_not be_nil
|
245
|
-
end
|
246
226
|
end
|
227
|
+
end
|
247
228
|
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
group_number += 1
|
252
|
-
group.each do |row|
|
253
|
-
row.id.should_not be_nil
|
254
|
-
end
|
255
|
-
end
|
256
|
-
group_number.should == 3
|
257
|
-
end
|
229
|
+
after do
|
230
|
+
@table.destroy
|
231
|
+
end
|
258
232
|
|
259
|
-
|
260
|
-
|
261
|
-
|
233
|
+
it "should contains 10 rows" do
|
234
|
+
@table.all.size.should == 10
|
235
|
+
@table.all.collect(&:id).size.should == 10
|
236
|
+
end
|
262
237
|
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
end
|
238
|
+
it "should load the first row" do
|
239
|
+
@table.first.should be_a_kind_of(MassiveRecord::Wrapper::Row)
|
240
|
+
end
|
267
241
|
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
242
|
+
it "should find rows from a list of IDs" do
|
243
|
+
ids_list = [["A1"], ["A1", "A2", "A3"]]
|
244
|
+
ids_list.each do |ids|
|
245
|
+
@table.find(ids).each do |row|
|
246
|
+
ids.include?(row.id).should be_true
|
247
|
+
end
|
274
248
|
end
|
249
|
+
end
|
275
250
|
|
276
|
-
|
277
|
-
|
251
|
+
it "should iterate through a collection of rows" do
|
252
|
+
@table.all.each do |row|
|
253
|
+
row.id.should_not be_nil
|
278
254
|
end
|
255
|
+
end
|
279
256
|
|
257
|
+
it "should iterate through a collection of rows using a batch process" do
|
258
|
+
group_number = 0
|
259
|
+
@table.find_in_batches(:batch_size => 2, :select => ["info"]) do |group|
|
260
|
+
group_number += 1
|
261
|
+
group.each do |row|
|
262
|
+
row.id.should_not be_nil
|
263
|
+
end
|
264
|
+
end
|
265
|
+
group_number.should == 5
|
280
266
|
end
|
281
267
|
|
282
|
-
|
268
|
+
it "should find 1 row using the :start option" do
|
269
|
+
@table.all(:start => "A1").size.should == 1
|
270
|
+
end
|
271
|
+
|
272
|
+
it "should find 5 rows using the :start option" do
|
273
|
+
@table.all(:start => "A").size.should == 5
|
274
|
+
end
|
283
275
|
|
276
|
+
it "should find 9 rows using the :offset option" do
|
277
|
+
@table.all(:offset => "A2").size.should == 9
|
278
|
+
end
|
279
|
+
|
280
|
+
it "should find 4 rows using both :offset and :start options" do
|
281
|
+
@table.all(:offset => "A2", :start => "A").size.should == 4
|
282
|
+
end
|
283
|
+
end
|
284
284
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: massive_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
4
|
+
prerelease: true
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
- beta
|
10
|
+
version: 0.2.0.beta
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Companybook
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2011-
|
18
|
+
date: 2011-04-08 00:00:00 +02:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
@@ -91,22 +92,42 @@ files:
|
|
91
92
|
- Manifest
|
92
93
|
- README.md
|
93
94
|
- Rakefile
|
94
|
-
- TODO.md
|
95
95
|
- autotest/discover.rb
|
96
96
|
- lib/massive_record.rb
|
97
|
-
- lib/massive_record/
|
97
|
+
- lib/massive_record/adapters/initialize.rb
|
98
|
+
- lib/massive_record/adapters/thrift/adapter.rb
|
99
|
+
- lib/massive_record/adapters/thrift/column_family.rb
|
100
|
+
- lib/massive_record/adapters/thrift/connection.rb
|
101
|
+
- lib/massive_record/adapters/thrift/hbase/hbase.rb
|
102
|
+
- lib/massive_record/adapters/thrift/hbase/hbase_constants.rb
|
103
|
+
- lib/massive_record/adapters/thrift/hbase/hbase_types.rb
|
104
|
+
- lib/massive_record/adapters/thrift/row.rb
|
105
|
+
- lib/massive_record/adapters/thrift/scanner.rb
|
106
|
+
- lib/massive_record/adapters/thrift/table.rb
|
98
107
|
- lib/massive_record/orm/attribute_methods.rb
|
99
108
|
- lib/massive_record/orm/attribute_methods/dirty.rb
|
100
109
|
- lib/massive_record/orm/attribute_methods/read.rb
|
101
110
|
- lib/massive_record/orm/attribute_methods/write.rb
|
102
111
|
- lib/massive_record/orm/base.rb
|
103
112
|
- lib/massive_record/orm/callbacks.rb
|
113
|
+
- lib/massive_record/orm/coders.rb
|
114
|
+
- lib/massive_record/orm/coders/chained.rb
|
115
|
+
- lib/massive_record/orm/coders/json.rb
|
116
|
+
- lib/massive_record/orm/coders/yaml.rb
|
104
117
|
- lib/massive_record/orm/column.rb
|
105
118
|
- lib/massive_record/orm/config.rb
|
106
119
|
- lib/massive_record/orm/errors.rb
|
107
120
|
- lib/massive_record/orm/finders.rb
|
121
|
+
- lib/massive_record/orm/finders/scope.rb
|
108
122
|
- lib/massive_record/orm/id_factory.rb
|
109
123
|
- lib/massive_record/orm/persistence.rb
|
124
|
+
- lib/massive_record/orm/relations.rb
|
125
|
+
- lib/massive_record/orm/relations/interface.rb
|
126
|
+
- lib/massive_record/orm/relations/metadata.rb
|
127
|
+
- lib/massive_record/orm/relations/proxy.rb
|
128
|
+
- lib/massive_record/orm/relations/proxy/references_many.rb
|
129
|
+
- lib/massive_record/orm/relations/proxy/references_one.rb
|
130
|
+
- lib/massive_record/orm/relations/proxy/references_one_polymorphic.rb
|
110
131
|
- lib/massive_record/orm/schema.rb
|
111
132
|
- lib/massive_record/orm/schema/column_families.rb
|
112
133
|
- lib/massive_record/orm/schema/column_family.rb
|
@@ -115,23 +136,18 @@ files:
|
|
115
136
|
- lib/massive_record/orm/schema/field.rb
|
116
137
|
- lib/massive_record/orm/schema/fields.rb
|
117
138
|
- lib/massive_record/orm/schema/table_interface.rb
|
139
|
+
- lib/massive_record/orm/single_table_inheritance.rb
|
118
140
|
- lib/massive_record/orm/table.rb
|
119
141
|
- lib/massive_record/orm/timestamps.rb
|
120
142
|
- lib/massive_record/orm/validations.rb
|
121
143
|
- lib/massive_record/rails/railtie.rb
|
122
144
|
- lib/massive_record/spec/support/simple_database_cleaner.rb
|
123
|
-
- lib/massive_record/thrift/hbase.rb
|
124
|
-
- lib/massive_record/thrift/hbase_constants.rb
|
125
|
-
- lib/massive_record/thrift/hbase_types.rb
|
126
145
|
- lib/massive_record/version.rb
|
146
|
+
- lib/massive_record/wrapper/adapter.rb
|
127
147
|
- lib/massive_record/wrapper/base.rb
|
128
148
|
- lib/massive_record/wrapper/cell.rb
|
129
149
|
- lib/massive_record/wrapper/column_families_collection.rb
|
130
|
-
- lib/massive_record/wrapper/
|
131
|
-
- lib/massive_record/wrapper/connection.rb
|
132
|
-
- lib/massive_record/wrapper/row.rb
|
133
|
-
- lib/massive_record/wrapper/scanner.rb
|
134
|
-
- lib/massive_record/wrapper/table.rb
|
150
|
+
- lib/massive_record/wrapper/errors.rb
|
135
151
|
- lib/massive_record/wrapper/tables_collection.rb
|
136
152
|
- massive_record.gemspec
|
137
153
|
- spec/config.yml.example
|
@@ -143,28 +159,45 @@ files:
|
|
143
159
|
- spec/orm/cases/config_spec.rb
|
144
160
|
- spec/orm/cases/dirty_spec.rb
|
145
161
|
- spec/orm/cases/encoding_spec.rb
|
162
|
+
- spec/orm/cases/finder_default_scope.rb
|
163
|
+
- spec/orm/cases/finder_scope_spec.rb
|
146
164
|
- spec/orm/cases/finders_spec.rb
|
147
|
-
- spec/orm/cases/hbase/connection_spec.rb
|
148
165
|
- spec/orm/cases/i18n_spec.rb
|
149
166
|
- spec/orm/cases/id_factory_spec.rb
|
150
167
|
- spec/orm/cases/persistence_spec.rb
|
168
|
+
- spec/orm/cases/single_table_inheritance_spec.rb
|
151
169
|
- spec/orm/cases/table_spec.rb
|
152
170
|
- spec/orm/cases/timestamps_spec.rb
|
153
171
|
- spec/orm/cases/validation_spec.rb
|
172
|
+
- spec/orm/coders/chained_spec.rb
|
173
|
+
- spec/orm/coders/json_spec.rb
|
174
|
+
- spec/orm/coders/yaml_spec.rb
|
154
175
|
- spec/orm/models/address.rb
|
176
|
+
- spec/orm/models/best_friend.rb
|
177
|
+
- spec/orm/models/friend.rb
|
155
178
|
- spec/orm/models/person.rb
|
156
|
-
- spec/orm/models/
|
179
|
+
- spec/orm/models/person_with_timestamp.rb
|
157
180
|
- spec/orm/models/test_class.rb
|
181
|
+
- spec/orm/relations/interface_spec.rb
|
182
|
+
- spec/orm/relations/metadata_spec.rb
|
183
|
+
- spec/orm/relations/proxy/references_many_spec.rb
|
184
|
+
- spec/orm/relations/proxy/references_one_polymorphic_spec.rb
|
185
|
+
- spec/orm/relations/proxy/references_one_spec.rb
|
186
|
+
- spec/orm/relations/proxy_spec.rb
|
158
187
|
- spec/orm/schema/column_families_spec.rb
|
159
188
|
- spec/orm/schema/column_family_spec.rb
|
160
189
|
- spec/orm/schema/column_interface_spec.rb
|
161
190
|
- spec/orm/schema/field_spec.rb
|
162
191
|
- spec/orm/schema/fields_spec.rb
|
163
192
|
- spec/orm/schema/table_interface_spec.rb
|
193
|
+
- spec/shared/orm/coders/an_orm_coder.rb
|
194
|
+
- spec/shared/orm/relations/proxy.rb
|
195
|
+
- spec/shared/orm/relations/singular_proxy.rb
|
164
196
|
- spec/spec_helper.rb
|
165
197
|
- spec/support/connection_helpers.rb
|
166
198
|
- spec/support/mock_massive_record_connection.rb
|
167
199
|
- spec/thrift/cases/encoding_spec.rb
|
200
|
+
- spec/wrapper/cases/adapter_spec.rb
|
168
201
|
- spec/wrapper/cases/connection_spec.rb
|
169
202
|
- spec/wrapper/cases/table_spec.rb
|
170
203
|
has_rdoc: true
|
@@ -187,11 +220,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
187
220
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
188
221
|
none: false
|
189
222
|
requirements:
|
190
|
-
- - "
|
223
|
+
- - ">"
|
191
224
|
- !ruby/object:Gem::Version
|
192
225
|
segments:
|
193
|
-
-
|
194
|
-
|
226
|
+
- 1
|
227
|
+
- 3
|
228
|
+
- 1
|
229
|
+
version: 1.3.1
|
195
230
|
requirements: []
|
196
231
|
|
197
232
|
rubyforge_project: massive_record
|
@@ -209,27 +244,44 @@ test_files:
|
|
209
244
|
- spec/orm/cases/config_spec.rb
|
210
245
|
- spec/orm/cases/dirty_spec.rb
|
211
246
|
- spec/orm/cases/encoding_spec.rb
|
247
|
+
- spec/orm/cases/finder_default_scope.rb
|
248
|
+
- spec/orm/cases/finder_scope_spec.rb
|
212
249
|
- spec/orm/cases/finders_spec.rb
|
213
|
-
- spec/orm/cases/hbase/connection_spec.rb
|
214
250
|
- spec/orm/cases/i18n_spec.rb
|
215
251
|
- spec/orm/cases/id_factory_spec.rb
|
216
252
|
- spec/orm/cases/persistence_spec.rb
|
253
|
+
- spec/orm/cases/single_table_inheritance_spec.rb
|
217
254
|
- spec/orm/cases/table_spec.rb
|
218
255
|
- spec/orm/cases/timestamps_spec.rb
|
219
256
|
- spec/orm/cases/validation_spec.rb
|
257
|
+
- spec/orm/coders/chained_spec.rb
|
258
|
+
- spec/orm/coders/json_spec.rb
|
259
|
+
- spec/orm/coders/yaml_spec.rb
|
220
260
|
- spec/orm/models/address.rb
|
261
|
+
- spec/orm/models/best_friend.rb
|
262
|
+
- spec/orm/models/friend.rb
|
221
263
|
- spec/orm/models/person.rb
|
222
|
-
- spec/orm/models/
|
264
|
+
- spec/orm/models/person_with_timestamp.rb
|
223
265
|
- spec/orm/models/test_class.rb
|
266
|
+
- spec/orm/relations/interface_spec.rb
|
267
|
+
- spec/orm/relations/metadata_spec.rb
|
268
|
+
- spec/orm/relations/proxy/references_many_spec.rb
|
269
|
+
- spec/orm/relations/proxy/references_one_polymorphic_spec.rb
|
270
|
+
- spec/orm/relations/proxy/references_one_spec.rb
|
271
|
+
- spec/orm/relations/proxy_spec.rb
|
224
272
|
- spec/orm/schema/column_families_spec.rb
|
225
273
|
- spec/orm/schema/column_family_spec.rb
|
226
274
|
- spec/orm/schema/column_interface_spec.rb
|
227
275
|
- spec/orm/schema/field_spec.rb
|
228
276
|
- spec/orm/schema/fields_spec.rb
|
229
277
|
- spec/orm/schema/table_interface_spec.rb
|
278
|
+
- spec/shared/orm/coders/an_orm_coder.rb
|
279
|
+
- spec/shared/orm/relations/proxy.rb
|
280
|
+
- spec/shared/orm/relations/singular_proxy.rb
|
230
281
|
- spec/spec_helper.rb
|
231
282
|
- spec/support/connection_helpers.rb
|
232
283
|
- spec/support/mock_massive_record_connection.rb
|
233
284
|
- spec/thrift/cases/encoding_spec.rb
|
285
|
+
- spec/wrapper/cases/adapter_spec.rb
|
234
286
|
- spec/wrapper/cases/connection_spec.rb
|
235
287
|
- spec/wrapper/cases/table_spec.rb
|