rod 0.7.2.6 → 0.7.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/rod/constants.rb +1 -1
- data/lib/rod/index/base.rb +2 -1
- data/lib/rod/index/hash_index.rb +16 -3
- data/lib/rod/property/base.rb +1 -1
- metadata +48 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: 5696079b9fc14e12da61535396f3a74d84cce085
|
4
|
+
data.tar.gz: 2702498d0fbd8c92471244edd7a1afb64423ca72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a5c84069b27b1eb23292eb51037d924e67460dc0b039e20b3fa913d70c51c08f4b87fe5111b4a96e537855b6f6c990bb25b2612cd65913b703373b0f7864a82
|
7
|
+
data.tar.gz: 99bd274f39274c8b8bb09695d26071da27734bc69b64932b54014501cda0c7e87f5e412f2367461afc41f78b2fa632a050215f7a1a3db1f8ccd0ef91edeff168
|
data/lib/rod/constants.rb
CHANGED
data/lib/rod/index/base.rb
CHANGED
@@ -99,9 +99,10 @@ module Rod
|
|
99
99
|
# The +path+ is the path were the index is stored, while +index+ is the previous index instance.
|
100
100
|
# The +klass+ is the class given index belongs to.
|
101
101
|
# Options might include class-specific options.
|
102
|
-
def create(path,klass,options)
|
102
|
+
def create(path,klass,options,property_type)
|
103
103
|
options = options.dup
|
104
104
|
type = options.delete(:index)
|
105
|
+
options[:property_type] = property_type
|
105
106
|
case type
|
106
107
|
when :flat
|
107
108
|
FlatIndex.new(path,klass,options)
|
data/lib/rod/index/hash_index.rb
CHANGED
@@ -19,6 +19,7 @@ module Rod
|
|
19
19
|
@path = path + ".db"
|
20
20
|
@klass = klass
|
21
21
|
@options = options
|
22
|
+
@property_type = options[:property_type]
|
22
23
|
end
|
23
24
|
|
24
25
|
# Stores the index on disk.
|
@@ -39,7 +40,11 @@ module Rod
|
|
39
40
|
open(@path, :create => true) unless opened?
|
40
41
|
_each_key do |key|
|
41
42
|
next if key.empty?
|
42
|
-
|
43
|
+
if @property_type == :string
|
44
|
+
key.force_encoding("UTF-8")
|
45
|
+
else
|
46
|
+
key = Marshal.load(key)
|
47
|
+
end
|
43
48
|
yield key,self[key]
|
44
49
|
end
|
45
50
|
else
|
@@ -83,8 +88,16 @@ module Rod
|
|
83
88
|
protected
|
84
89
|
# Returns an empty BDB based collection proxy.
|
85
90
|
def empty_collection_proxy(key)
|
86
|
-
|
87
|
-
|
91
|
+
if @property_type == :string
|
92
|
+
if key
|
93
|
+
key = key.encode("utf-8")
|
94
|
+
else
|
95
|
+
# TODO empty string should be different from nil
|
96
|
+
key = ""
|
97
|
+
end
|
98
|
+
else
|
99
|
+
key = Marshal.dump(key)
|
100
|
+
end
|
88
101
|
Rod::Berkeley::CollectionProxy.new(self,key)
|
89
102
|
end
|
90
103
|
|
data/lib/rod/property/base.rb
CHANGED
@@ -52,7 +52,7 @@ module Rod
|
|
52
52
|
|
53
53
|
# Returns the index associated with the property.
|
54
54
|
def index
|
55
|
-
@index ||= Index::Base.create(path(@klass.database.path),@klass,@options)
|
55
|
+
@index ||= Index::Base.create(path(@klass.database.path),@klass,@options,@type)
|
56
56
|
end
|
57
57
|
|
58
58
|
# Returns true if the property has an index.
|
metadata
CHANGED
@@ -1,213 +1,213 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksander Pohl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: RubyInline
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.10.0
|
20
|
-
- -
|
20
|
+
- - <
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 4.0.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 3.10.0
|
30
|
-
- -
|
30
|
+
- - <
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 4.0.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: english
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- -
|
37
|
+
- - ! '>='
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: 0.5.0
|
40
|
-
- -
|
40
|
+
- - <
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: 0.6.0
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - ! '>='
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: 0.5.0
|
50
|
-
- -
|
50
|
+
- - <
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 0.6.0
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: activemodel
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- -
|
57
|
+
- - ~>
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '3.2'
|
60
|
-
- -
|
60
|
+
- - ! '>='
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: 3.2.2
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '3.2'
|
70
|
-
- -
|
70
|
+
- - ! '>='
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: 3.2.2
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: bsearch
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
|
-
- -
|
77
|
+
- - ! '>='
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: 1.5.0
|
80
|
-
- -
|
80
|
+
- - <
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.6.0
|
83
83
|
type: :runtime
|
84
84
|
prerelease: false
|
85
85
|
version_requirements: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ! '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 1.5.0
|
90
|
-
- -
|
90
|
+
- - <
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: 1.6.0
|
93
93
|
- !ruby/object:Gem::Dependency
|
94
94
|
name: ref
|
95
95
|
requirement: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
|
-
- -
|
97
|
+
- - ! '>='
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: 1.0.5
|
100
|
-
- -
|
100
|
+
- - <
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: 2.0.0
|
103
103
|
type: :runtime
|
104
104
|
prerelease: false
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- -
|
107
|
+
- - ! '>='
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: 1.0.5
|
110
|
-
- -
|
110
|
+
- - <
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: 2.0.0
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: cucumber
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
|
-
- -
|
117
|
+
- - ~>
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '1.0'
|
120
|
-
- -
|
120
|
+
- - ! '>='
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: 1.0.0
|
123
123
|
type: :development
|
124
124
|
prerelease: false
|
125
125
|
version_requirements: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
|
-
- -
|
127
|
+
- - ~>
|
128
128
|
- !ruby/object:Gem::Version
|
129
129
|
version: '1.0'
|
130
|
-
- -
|
130
|
+
- - ! '>='
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: 1.0.0
|
133
133
|
- !ruby/object:Gem::Dependency
|
134
134
|
name: rspec
|
135
135
|
requirement: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
|
-
- -
|
137
|
+
- - ! '>='
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: 2.2.0
|
140
|
-
- -
|
140
|
+
- - <
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: 2.3.0
|
143
143
|
type: :development
|
144
144
|
prerelease: false
|
145
145
|
version_requirements: !ruby/object:Gem::Requirement
|
146
146
|
requirements:
|
147
|
-
- -
|
147
|
+
- - ! '>='
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: 2.2.0
|
150
|
-
- -
|
150
|
+
- - <
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 2.3.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: rake
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - ! '>='
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: 0.9.0
|
160
|
-
- -
|
160
|
+
- - <
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: 1.0.0
|
163
163
|
type: :development
|
164
164
|
prerelease: false
|
165
165
|
version_requirements: !ruby/object:Gem::Requirement
|
166
166
|
requirements:
|
167
|
-
- -
|
167
|
+
- - ! '>='
|
168
168
|
- !ruby/object:Gem::Version
|
169
169
|
version: 0.9.0
|
170
|
-
- -
|
170
|
+
- - <
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: 1.0.0
|
173
173
|
- !ruby/object:Gem::Dependency
|
174
174
|
name: minitest
|
175
175
|
requirement: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
|
-
- -
|
177
|
+
- - ~>
|
178
178
|
- !ruby/object:Gem::Version
|
179
179
|
version: '4.0'
|
180
|
-
- -
|
180
|
+
- - ! '>='
|
181
181
|
- !ruby/object:Gem::Version
|
182
182
|
version: 4.0.0
|
183
183
|
type: :development
|
184
184
|
prerelease: false
|
185
185
|
version_requirements: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
|
-
- -
|
187
|
+
- - ~>
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: '4.0'
|
190
|
-
- -
|
190
|
+
- - ! '>='
|
191
191
|
- !ruby/object:Gem::Version
|
192
192
|
version: 4.0.0
|
193
193
|
- !ruby/object:Gem::Dependency
|
194
194
|
name: mocha
|
195
195
|
requirement: !ruby/object:Gem::Requirement
|
196
196
|
requirements:
|
197
|
-
- -
|
197
|
+
- - ~>
|
198
198
|
- !ruby/object:Gem::Version
|
199
199
|
version: '0.9'
|
200
|
-
- -
|
200
|
+
- - ! '>='
|
201
201
|
- !ruby/object:Gem::Version
|
202
202
|
version: 0.9.12
|
203
203
|
type: :development
|
204
204
|
prerelease: false
|
205
205
|
version_requirements: !ruby/object:Gem::Requirement
|
206
206
|
requirements:
|
207
|
-
- -
|
207
|
+
- - ~>
|
208
208
|
- !ruby/object:Gem::Version
|
209
209
|
version: '0.9'
|
210
|
-
- -
|
210
|
+
- - ! '>='
|
211
211
|
- !ruby/object:Gem::Version
|
212
212
|
version: 0.9.12
|
213
213
|
description: Ruby Object Database is designed for large amounts of data, whose structure
|
@@ -218,8 +218,8 @@ executables: []
|
|
218
218
|
extensions: []
|
219
219
|
extra_rdoc_files: []
|
220
220
|
files:
|
221
|
-
-
|
222
|
-
-
|
221
|
+
- .gitignore
|
222
|
+
- .travis.yml
|
223
223
|
- Gemfile
|
224
224
|
- README.rdoc
|
225
225
|
- Rakefile
|
@@ -335,18 +335,18 @@ licenses:
|
|
335
335
|
metadata: {}
|
336
336
|
post_install_message:
|
337
337
|
rdoc_options:
|
338
|
-
-
|
338
|
+
- --main
|
339
339
|
- README.rdoc
|
340
340
|
require_paths:
|
341
341
|
- lib
|
342
342
|
required_ruby_version: !ruby/object:Gem::Requirement
|
343
343
|
requirements:
|
344
|
-
- -
|
344
|
+
- - ! '>='
|
345
345
|
- !ruby/object:Gem::Version
|
346
346
|
version: 1.9.2
|
347
347
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
348
348
|
requirements:
|
349
|
-
- -
|
349
|
+
- - ! '>='
|
350
350
|
- !ruby/object:Gem::Version
|
351
351
|
version: '0'
|
352
352
|
requirements: []
|
@@ -356,3 +356,4 @@ signing_key:
|
|
356
356
|
specification_version: 4
|
357
357
|
summary: Ruby Object Database
|
358
358
|
test_files: []
|
359
|
+
has_rdoc:
|