persistence 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/persistence.rb +0 -1
- data/lib/persistence/adapter/abstract.rb +1 -1
- data/lib/persistence/adapter/abstract/enable_disable.rb +1 -1
- data/lib/persistence/adapter/abstract/primary_key/id_property_string.rb +1 -1
- data/lib/persistence/adapter/abstract/primary_key/simple.rb +1 -1
- data/lib/persistence/adapter/mock/bucket/index/index_interface.rb +1 -1
- data/lib/persistence/cursor/atomic.rb +2 -2
- data/lib/persistence/object.rb +1 -1
- data/lib/persistence/object/autodetermine.rb +5 -4
- data/lib/persistence/object/class_instance.rb +12 -8
- data/lib/persistence/object/complex.rb +4 -4
- data/lib/persistence/object/complex/array.rb +6 -4
- data/lib/persistence/object/complex/array/class_instance.rb +1 -1
- data/lib/persistence/object/complex/array/object_instance.rb +1 -1
- data/lib/persistence/object/complex/attributes/attributes_array.rb +1 -1
- data/lib/persistence/object/complex/hash.rb +6 -4
- data/lib/persistence/object/complex/hash/class_instance.rb +1 -1
- data/lib/persistence/object/complex/hash/object_instance.rb +1 -1
- data/lib/persistence/object/complex/object_instance.rb +3 -3
- data/lib/persistence/object/flat.rb +6 -5
- data/lib/persistence/object/flat/class_instance.rb +2 -2
- data/lib/persistence/object/flat/file.rb +4 -3
- data/lib/persistence/object/flat/file/class_instance.rb +23 -30
- data/lib/persistence/object/flat/file/file_persistence.rb +4 -53
- data/lib/persistence/object/flat/file/object_instance.rb +21 -42
- data/lib/persistence/object/index.rb +0 -1
- data/lib/persistence/object/index_hash.rb +1 -1
- data/lib/persistence/object/object_instance.rb +11 -11
- data/lib/persistence/object/parse_persistence_args.rb +2 -108
- data/lib/persistence/object/parse_persistence_args/class_instance.rb +124 -0
- data/lib/persistence/object/parse_persistence_args/object_instance.rb +124 -0
- data/lib/persistence/port/bucket/bucket_interface.rb +0 -18
- data/lib/persistence/port/port_interface.rb +1 -19
- data/lib/requires.rb +10 -9
- data/spec/persistence/object/complex/attributes_spec.rb +1 -140
- data/spec/persistence/object/flat/bignum_spec.rb +12 -4
- data/spec/persistence/object/flat/class_spec.rb +9 -4
- data/spec/persistence/object/flat/file/class_instance_spec.rb +0 -1
- data/spec/persistence/object/flat/file_spec.rb +6 -9
- data/spec/persistence/object/indexes/block_index_spec.rb +1 -1
- data/spec/persistence/object/parse_persistence_args/class_instance_spec.rb +61 -0
- data/spec/persistence/object/parse_persistence_args/object_instance_spec.rb +63 -0
- data/spec/persistence/object_spec.rb +48 -82
- data/spec/persistence/port/bucket/index/bucket_index_spec.rb +1 -0
- data/spec/{Persistence_spec.rb → persistence_spec.rb} +0 -0
- metadata +8 -5
- data/spec/persistence/object/parse_persistence_args_spec.rb +0 -65
@@ -4,7 +4,14 @@ require_relative '../../../../lib/persistence.rb'
|
|
4
4
|
describe Bignum do
|
5
5
|
|
6
6
|
before :all do
|
7
|
+
|
7
8
|
::Persistence.enable_port( :mock, ::Persistence::Adapter::Mock.new )
|
9
|
+
|
10
|
+
class Bignum
|
11
|
+
include ::Persistence::Object::Flat
|
12
|
+
explicit_index :explicit_index
|
13
|
+
end
|
14
|
+
|
8
15
|
end
|
9
16
|
|
10
17
|
after :all do
|
@@ -12,16 +19,17 @@ describe Bignum do
|
|
12
19
|
end
|
13
20
|
|
14
21
|
it "can put a bignum number object to a persistence port and get it back" do
|
15
|
-
|
16
|
-
include ::Persistence::Object::Flat
|
17
|
-
explicit_index :explicit_index
|
18
|
-
end
|
22
|
+
|
19
23
|
bignum_object = 10**20
|
20
24
|
bignum_object.persist!
|
21
25
|
Bignum.persist( bignum_object.persistence_id ).should == bignum_object
|
22
26
|
bignum_object.cease!
|
23
27
|
Bignum.persist( bignum_object.persistence_id ).should == nil
|
24
28
|
|
29
|
+
end
|
30
|
+
|
31
|
+
it "can put a bignum number object to a persistence port and get it back via an indexed value" do
|
32
|
+
bignum_object = 10**20
|
25
33
|
storage_key = 10**40
|
26
34
|
bignum_object.persist!( :explicit_index => storage_key )
|
27
35
|
Bignum.persist( :explicit_index => storage_key ).should == bignum_object
|
@@ -5,6 +5,10 @@ describe Class do
|
|
5
5
|
|
6
6
|
before :all do
|
7
7
|
::Persistence.enable_port( :mock, ::Persistence::Adapter::Mock.new )
|
8
|
+
class Class
|
9
|
+
include ::Persistence::Object::Flat
|
10
|
+
explicit_index :explicit_index
|
11
|
+
end
|
8
12
|
end
|
9
13
|
|
10
14
|
after :all do
|
@@ -12,10 +16,6 @@ describe Class do
|
|
12
16
|
end
|
13
17
|
|
14
18
|
it "can put a class object to a persistence port and get it back" do
|
15
|
-
class Class
|
16
|
-
include ::Persistence::Object::Flat
|
17
|
-
explicit_index :explicit_index
|
18
|
-
end
|
19
19
|
|
20
20
|
class_object = Object
|
21
21
|
class_object.persist!
|
@@ -25,6 +25,11 @@ describe Class do
|
|
25
25
|
::CascadingConfiguration::Core::Encapsulation.encapsulation( :default ).remove_configuration( Class, :instance_persistence_port )
|
26
26
|
::CascadingConfiguration::Core::Encapsulation.encapsulation( :default ).remove_configuration( Class, :instance_persistence_bucket )
|
27
27
|
|
28
|
+
end
|
29
|
+
|
30
|
+
it "can put a class object to a persistence port and get it back by indexed key" do
|
31
|
+
|
32
|
+
class_object = Object
|
28
33
|
storage_key = String
|
29
34
|
class_object.persist!( :explicit_index, storage_key )
|
30
35
|
Class.persist( :explicit_index, storage_key ).should == class_object
|
@@ -45,7 +45,6 @@ describe ::Persistence::Object::Flat::File::ClassInstance do
|
|
45
45
|
instance_to_persist_two.persistence_port.put_object!( instance_to_persist_two )
|
46
46
|
instance_to_persist_two.persistence_id.should_not == nil
|
47
47
|
|
48
|
-
::Persistence::Object::Flat::File::ClassInstance::FileMock.instance_persistence_port.persist_file_paths_as_objects!
|
49
48
|
persisted_file_two = ::Persistence::Object::Flat::File::ClassInstance::FileMock.persist( instance_to_persist_two.persistence_id )
|
50
49
|
persisted_file_two.is_a?( File ).should == true
|
51
50
|
persisted_file_two.path.should == instance_to_persist_two
|
@@ -17,21 +17,17 @@ describe ::Persistence::Object::Flat::File do
|
|
17
17
|
explicit_index :explicit_index
|
18
18
|
end
|
19
19
|
class ::Persistence::Object::Flat::File::Contents
|
20
|
-
include ::Persistence::Object::Flat
|
21
|
-
explicit_index :explicit_index
|
22
20
|
end
|
23
21
|
class ::Persistence::Object::Flat::File::Path
|
24
|
-
include ::Persistence::Object::Flat
|
25
|
-
explicit_index :explicit_index
|
26
22
|
end
|
27
23
|
file_object = ::Persistence::Object::Flat::File::FileMock.open( __FILE__, 'r' )
|
28
24
|
file_object.persistence_port.persist_files_by_path!
|
29
|
-
file_object.persistence_port.persist_file_paths_as_strings
|
25
|
+
file_object.persistence_port.persist_file_paths_as_strings = true
|
30
26
|
file_object.persist!
|
31
27
|
|
32
28
|
persisted_file = ::Persistence::Object::Flat::File::FileMock.persist( file_object.persistence_id )
|
33
29
|
persisted_file.should == file_object.path
|
34
|
-
file_object.persistence_port.
|
30
|
+
file_object.persistence_port.persist_file_paths_as_strings = false
|
35
31
|
persisted_file = ::Persistence::Object::Flat::File::FileMock.persist( file_object.persistence_id )
|
36
32
|
persisted_file.path.should == file_object.path
|
37
33
|
|
@@ -41,14 +37,15 @@ describe ::Persistence::Object::Flat::File do
|
|
41
37
|
persisted_file.should == file_object.readlines.join
|
42
38
|
file_object.cease!
|
43
39
|
::Persistence::Object::Flat::File::FileMock.persist( file_object.persistence_id ).should == nil
|
44
|
-
|
40
|
+
|
45
41
|
file_object.persistence_port.persist_files_by_path!
|
46
|
-
file_object.persistence_port.persist_file_paths_as_strings
|
42
|
+
file_object.persistence_port.persist_file_paths_as_strings = true
|
47
43
|
file_object.persist!( :explicit_index => __FILE__ )
|
48
44
|
|
45
|
+
file_object.persistence_port.persist_file_paths_as_strings = true
|
49
46
|
persisted_file = ::Persistence::Object::Flat::File::FileMock.persist( :explicit_index => __FILE__ )
|
50
47
|
persisted_file.should == file_object.path
|
51
|
-
file_object.persistence_port.
|
48
|
+
file_object.persistence_port.persist_file_paths_as_strings = false
|
52
49
|
persisted_file = ::Persistence::Object::Flat::File::FileMock.persist( :explicit_index => __FILE__ )
|
53
50
|
persisted_file.path.should == file_object.path
|
54
51
|
|
@@ -0,0 +1,61 @@
|
|
1
|
+
|
2
|
+
require_relative '../../../../lib/persistence.rb'
|
3
|
+
|
4
|
+
describe ::Persistence::Object::ParsePersistenceArgs::ClassInstance do
|
5
|
+
|
6
|
+
before :all do
|
7
|
+
::Persistence.enable_port( :mock, ::Persistence::Adapter::Mock.new )
|
8
|
+
class ::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock
|
9
|
+
include ::Persistence::Object::Flat::File
|
10
|
+
explicit_index :index
|
11
|
+
end
|
12
|
+
class SubFile < File
|
13
|
+
include ::Persistence::Object::Flat::File
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
after :all do
|
18
|
+
::Persistence.disable_port( :mock )
|
19
|
+
end
|
20
|
+
|
21
|
+
######################
|
22
|
+
# process_file_key #
|
23
|
+
######################
|
24
|
+
|
25
|
+
it 'can process a file key for flat persistence' do
|
26
|
+
file_instance = ::SubFile.open( __FILE__ )
|
27
|
+
::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.instance_persistence_port.persist_files_by_path!
|
28
|
+
::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.process_file_key( file_instance ).should == file_instance.path
|
29
|
+
::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.instance_persistence_port.persists_files_by_content!
|
30
|
+
::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.process_file_key( file_instance ).should == file_instance.readlines.join
|
31
|
+
end
|
32
|
+
|
33
|
+
###############################################
|
34
|
+
# parse_class_args_for_index_value_no_value #
|
35
|
+
###############################################
|
36
|
+
|
37
|
+
it 'can parse args for indexed or non-indexed processing' do
|
38
|
+
lambda { ::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.parse_class_args_for_index_value_no_value( [], true ) }.should raise_error( ::Persistence::Exception::KeyValueRequired )
|
39
|
+
# 0 args
|
40
|
+
args = []
|
41
|
+
::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.parse_class_args_for_index_value_no_value( args ).should == [ nil, nil, true ]
|
42
|
+
# 1 arg: index
|
43
|
+
args = [ :index ]
|
44
|
+
::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.parse_class_args_for_index_value_no_value( args ).should == [ ::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.index( :index ), nil, true ]
|
45
|
+
# 2 args: index, key
|
46
|
+
args = [ :index, :key ]
|
47
|
+
::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.parse_class_args_for_index_value_no_value( args ).should == [ ::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.index( :index ), :key, false ]
|
48
|
+
# 2 args: no index, global id
|
49
|
+
args = [ nil, 0 ]
|
50
|
+
::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.parse_class_args_for_index_value_no_value( args ).should == [ nil, 0, false ]
|
51
|
+
# test special case: file key
|
52
|
+
file_instance = ::SubFile.open( __FILE__ )
|
53
|
+
args = [ :index, file_instance ]
|
54
|
+
::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.instance_persistence_port.persist_files_by_path!
|
55
|
+
::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.parse_class_args_for_index_value_no_value( args ).should == [ ::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.index( :index ), ::Persistence::Object::Flat::File::Path.new( file_instance.path ), false ]
|
56
|
+
::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.instance_persistence_port.persists_files_by_content!
|
57
|
+
::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.parse_class_args_for_index_value_no_value( args ).should == [ ::Persistence::Object::ParsePersistenceArgs::ClassInstance::Mock.index( :index ), ::Persistence::Object::Flat::File::Contents.new( file_instance.readlines.join ), false ]
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
@@ -0,0 +1,63 @@
|
|
1
|
+
|
2
|
+
require_relative '../../../../lib/persistence.rb'
|
3
|
+
|
4
|
+
describe ::Persistence::Object::ParsePersistenceArgs::ObjectInstance do
|
5
|
+
|
6
|
+
before :all do
|
7
|
+
::Persistence.enable_port( :mock, ::Persistence::Adapter::Mock.new )
|
8
|
+
class ::Persistence::Object::ParsePersistenceArgs::ObjectInstance::Mock
|
9
|
+
include ::Persistence::Object::Flat::File
|
10
|
+
explicit_index :index
|
11
|
+
end
|
12
|
+
class SubFile < File
|
13
|
+
include ::Persistence::Object::Flat::File
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
after :all do
|
18
|
+
::Persistence.disable_port( :mock )
|
19
|
+
end
|
20
|
+
|
21
|
+
######################
|
22
|
+
# process_file_key #
|
23
|
+
######################
|
24
|
+
|
25
|
+
it 'can process a file key for flat persistence' do
|
26
|
+
file_instance = ::SubFile.open( __FILE__ )
|
27
|
+
instance = ::Persistence::Object::ParsePersistenceArgs::ObjectInstance::Mock.new
|
28
|
+
instance.persistence_port.persist_files_by_path!
|
29
|
+
instance.process_file_key( file_instance ).should == file_instance.path
|
30
|
+
instance.persistence_port.persists_files_by_content!
|
31
|
+
instance.process_file_key( file_instance ).should == file_instance.readlines.join
|
32
|
+
end
|
33
|
+
|
34
|
+
################################################
|
35
|
+
# parse_object_args_for_index_value_no_value #
|
36
|
+
################################################
|
37
|
+
|
38
|
+
it 'can parse args for indexed or non-indexed processing' do
|
39
|
+
instance = ::Persistence::Object::ParsePersistenceArgs::ObjectInstance::Mock.new
|
40
|
+
lambda { instance.parse_object_args_for_index_value_no_value( [], true ) }.should raise_error( ::Persistence::Exception::KeyValueRequired )
|
41
|
+
# 0 args
|
42
|
+
args = []
|
43
|
+
instance.parse_object_args_for_index_value_no_value( args ).should == [ nil, nil, true ]
|
44
|
+
# 1 arg: index
|
45
|
+
args = [ :index ]
|
46
|
+
instance.parse_object_args_for_index_value_no_value( args ).should == [ ::Persistence::Object::ParsePersistenceArgs::ObjectInstance::Mock.index( :index ), nil, true ]
|
47
|
+
# 2 args: index, key
|
48
|
+
args = [ :index, :key ]
|
49
|
+
instance.parse_object_args_for_index_value_no_value( args ).should == [ ::Persistence::Object::ParsePersistenceArgs::ObjectInstance::Mock.index( :index ), :key, false ]
|
50
|
+
# 2 args: no index, global id
|
51
|
+
args = [ nil, 0 ]
|
52
|
+
instance.parse_object_args_for_index_value_no_value( args ).should == [ nil, 0, false ]
|
53
|
+
# test special case: file key
|
54
|
+
file_instance = ::SubFile.open( __FILE__ )
|
55
|
+
args = [ :index, file_instance ]
|
56
|
+
instance.persistence_port.persist_files_by_path!
|
57
|
+
instance.parse_object_args_for_index_value_no_value( args ).should == [ ::Persistence::Object::ParsePersistenceArgs::ObjectInstance::Mock.index( :index ), ::Persistence::Object::Flat::File::Path.new( file_instance.path ), false ]
|
58
|
+
instance.persistence_port.persists_files_by_content!
|
59
|
+
instance.parse_object_args_for_index_value_no_value( args ).should == [ ::Persistence::Object::ParsePersistenceArgs::ObjectInstance::Mock.index( :index ), ::Persistence::Object::Flat::File::Contents.new( file_instance.readlines.join ), false ]
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
@@ -53,6 +53,32 @@ describe ::Persistence::Object do
|
|
53
53
|
instance.persistence_id.nil?.should == false
|
54
54
|
instance.persisted?.should == true
|
55
55
|
|
56
|
+
class ObjectIndexMock
|
57
|
+
|
58
|
+
include ::Persistence::Object::Complex
|
59
|
+
|
60
|
+
explicit_index :explicit_index
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
encapsulation = ::CascadingConfiguration::Core::Encapsulation.encapsulation( :default )
|
65
|
+
|
66
|
+
ObjectIndexMock.count.should == 0
|
67
|
+
ObjectIndexMock.count( :explicit_index ).should == 0
|
68
|
+
instance_one = ObjectIndexMock.new.persist!
|
69
|
+
instance_one.persistence_id.should_not == nil
|
70
|
+
ObjectIndexMock.count.should == 1
|
71
|
+
ObjectIndexMock.count( :explicit_index ).should == 0
|
72
|
+
|
73
|
+
instance_two = ObjectIndexMock.new.persist!( :explicit_index, :some_key )
|
74
|
+
instance_two.persistence_id.should_not == nil
|
75
|
+
ObjectIndexMock.count.should == 2
|
76
|
+
ObjectIndexMock.count( :explicit_index ).should == 1
|
77
|
+
persisted_instance_two_a = ObjectIndexMock.persist( instance_two.persistence_id )
|
78
|
+
persisted_instance_two_a.should == instance_two
|
79
|
+
persisted_instance_two_b = ObjectIndexMock.persist( :explicit_index, :some_key )
|
80
|
+
persisted_instance_two_b.should == instance_two
|
81
|
+
|
56
82
|
end
|
57
83
|
end
|
58
84
|
|
@@ -93,88 +119,6 @@ describe ::Persistence::Object do
|
|
93
119
|
instance.persistence_id.should == nil
|
94
120
|
( instance.persistence_port.get_bucket_name_for_object_id( global_id ) ? true : false ).should == false
|
95
121
|
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
#####################
|
100
|
-
# persistence_id= #
|
101
|
-
# persistence_id #
|
102
|
-
#####################
|
103
|
-
|
104
|
-
it 'can set and get a persistence id that uniquely identifies the object instance' do
|
105
|
-
module ::Persistence::Object::PersistenceIDMock
|
106
|
-
|
107
|
-
class ObjectInstance
|
108
|
-
include ::Persistence::Object::Complex
|
109
|
-
end
|
110
|
-
|
111
|
-
instance = ObjectInstance.new
|
112
|
-
|
113
|
-
instance.persistence_id.should == nil
|
114
|
-
instance.persistence_id = 1
|
115
|
-
instance.persistence_id.should == 1
|
116
|
-
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
################
|
134
|
-
# persist! #
|
135
|
-
# persisted? #
|
136
|
-
# persist #
|
137
|
-
################
|
138
|
-
|
139
|
-
it 'can persist with an index and explicit key' do
|
140
|
-
module ::Persistence::Object::PersistMock
|
141
|
-
|
142
|
-
class ObjectIndexMock
|
143
|
-
|
144
|
-
include ::Persistence::Object::Complex
|
145
|
-
|
146
|
-
explicit_index :explicit_index
|
147
|
-
|
148
|
-
end
|
149
|
-
|
150
|
-
encapsulation = ::CascadingConfiguration::Core::Encapsulation.encapsulation( :default )
|
151
|
-
|
152
|
-
ObjectIndexMock.count.should == 0
|
153
|
-
ObjectIndexMock.count( :explicit_index ).should == 0
|
154
|
-
instance_one = ObjectIndexMock.new.persist!
|
155
|
-
instance_one.persistence_id.should_not == nil
|
156
|
-
ObjectIndexMock.count.should == 1
|
157
|
-
ObjectIndexMock.count( :explicit_index ).should == 0
|
158
|
-
|
159
|
-
instance_two = ObjectIndexMock.new.persist!( :explicit_index, :some_key )
|
160
|
-
instance_two.persistence_id.should_not == nil
|
161
|
-
ObjectIndexMock.count.should == 2
|
162
|
-
ObjectIndexMock.count( :explicit_index ).should == 1
|
163
|
-
persisted_instance_two_a = ObjectIndexMock.persist( instance_two.persistence_id )
|
164
|
-
persisted_instance_two_a.should == instance_two
|
165
|
-
persisted_instance_two_b = ObjectIndexMock.persist( :explicit_index, :some_key )
|
166
|
-
persisted_instance_two_b.should == instance_two
|
167
|
-
|
168
|
-
end
|
169
|
-
end
|
170
|
-
|
171
|
-
############
|
172
|
-
# cease! #
|
173
|
-
############
|
174
|
-
|
175
|
-
it 'can persist with an index and explicit key' do
|
176
|
-
module ::Persistence::Object::CeaseMock
|
177
|
-
|
178
122
|
class ObjectIndexMock
|
179
123
|
|
180
124
|
include ::Persistence::Object::Complex
|
@@ -216,6 +160,28 @@ describe ::Persistence::Object do
|
|
216
160
|
end
|
217
161
|
end
|
218
162
|
|
163
|
+
#####################
|
164
|
+
# persistence_id= #
|
165
|
+
# persistence_id #
|
166
|
+
#####################
|
167
|
+
|
168
|
+
it 'can set and get a persistence id that uniquely identifies the object instance' do
|
169
|
+
module ::Persistence::Object::PersistenceIDMock
|
170
|
+
|
171
|
+
class ObjectInstance
|
172
|
+
include ::Persistence::Object::Complex
|
173
|
+
end
|
174
|
+
|
175
|
+
instance = ObjectInstance.new
|
176
|
+
|
177
|
+
instance.persistence_id.should == nil
|
178
|
+
instance.persistence_id = 1
|
179
|
+
instance.persistence_id.should == 1
|
180
|
+
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
|
219
185
|
##################################
|
220
186
|
# instance_persistence_bucket #
|
221
187
|
# instance_persistence_bucket= #
|
@@ -54,6 +54,7 @@ describe ::Persistence::Port::Bucket::BucketIndex do
|
|
54
54
|
|
55
55
|
instance = ::Persistence::Port::Bucket::BucketIndex::Mock.new
|
56
56
|
instance.some_value = :a_value
|
57
|
+
|
57
58
|
bucket.put_object!( instance )
|
58
59
|
bucket.index( :index ).index_object( instance )
|
59
60
|
bucket.count.should == 1
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: persistence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: module-cluster
|
@@ -110,6 +110,8 @@ files:
|
|
110
110
|
- lib/persistence/object/index.rb
|
111
111
|
- lib/persistence/object/index_hash.rb
|
112
112
|
- lib/persistence/object/object_instance.rb
|
113
|
+
- lib/persistence/object/parse_persistence_args/class_instance.rb
|
114
|
+
- lib/persistence/object/parse_persistence_args/object_instance.rb
|
113
115
|
- lib/persistence/object/parse_persistence_args.rb
|
114
116
|
- lib/persistence/object.rb
|
115
117
|
- lib/persistence/port/bucket/bucket_index.rb
|
@@ -171,14 +173,15 @@ files:
|
|
171
173
|
- spec/persistence/object/flat/true_class_spec.rb
|
172
174
|
- spec/persistence/object/indexes/block_index_spec.rb
|
173
175
|
- spec/persistence/object/indexes/explicit_index_spec.rb
|
174
|
-
- spec/persistence/object/
|
176
|
+
- spec/persistence/object/parse_persistence_args/class_instance_spec.rb
|
177
|
+
- spec/persistence/object/parse_persistence_args/object_instance_spec.rb
|
175
178
|
- spec/persistence/object_spec.rb
|
176
179
|
- spec/persistence/port/bucket/bucket_interface_spec.rb
|
177
180
|
- spec/persistence/port/bucket/index/bucket_index_spec.rb
|
178
181
|
- spec/persistence/port/bucket_spec.rb
|
179
182
|
- spec/persistence/port/controller_spec.rb
|
180
183
|
- spec/persistence/port/port_interface_spec.rb
|
181
|
-
- spec/
|
184
|
+
- spec/persistence_spec.rb
|
182
185
|
- README.md
|
183
186
|
- CHANGELOG.md
|
184
187
|
homepage: http://rubygems.org/gems/persistence
|
@@ -192,7 +195,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
192
195
|
requirements:
|
193
196
|
- - ! '>='
|
194
197
|
- !ruby/object:Gem::Version
|
195
|
-
version:
|
198
|
+
version: 1.9.1
|
196
199
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
200
|
none: false
|
198
201
|
requirements:
|