isomorfeus-data 2.2.11 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7edcc25158eb863dcb53427511afa3097f33ff8ce7381bab1bcbe205befb4e89
4
- data.tar.gz: f5484ef3b0d8a7587d1c7fd3ac0925865286047f14f194cfd3de2cc5b68ed2bc
3
+ metadata.gz: 2120087d068df84bf8e9cb63c2fdc9779fd31e852cc1dcaddd219726f37b38cc
4
+ data.tar.gz: '0603831a90d8e162fcd67bac5c2fb86c91229925a99e3ff7aabfc7da2745bca3'
5
5
  SHA512:
6
- metadata.gz: 0f1026b18985f4bd97e7131d49340e5ec79f3053e8dc5e481734736f7c4502dc38646453a269b1d00b32c3715e9b74c3c09005186403aef72bff0137c337a243
7
- data.tar.gz: 627b7d8734514dc7e69fcdb7c34acadb8c2118b01a4ca30e1dadf1f21b5ef8c180689d3e596244fea122ee4656a8775a8011fd257cf6cf7f0685c2bccba5ac16
6
+ metadata.gz: 2fce64490222cb88495787bfbf80061c1e22745d07751695d59661826aea6f8e2097386d3458e6a56ac0e15cd08c1f1ae1d3009bc098fb916ee4e814b1e143ad
7
+ data.tar.gz: 71938112fffa7501f7fba9f37e387e2946e6e87ca8165d814d1235b5e72dac1b1ee61d575e72cc7fe2782419ab4f0e22c649faedf40bae5043ed6ccb9e1eb054
@@ -50,11 +50,11 @@ module Isomorfeus
50
50
  end
51
51
 
52
52
  def index_put(key, val)
53
- @index_db.put(key, val)
53
+ environment.transaction { @index_db.put(key, val) }
54
54
  end
55
55
 
56
- def each(&block)
57
- @db.each do |key, obj|
56
+ def each(readonly: true, &block)
57
+ @db.each(readonly: readonly) do |key, obj|
58
58
  block.call(Isomorfeus::Hamster::Marshal.unserialize(obj, class_cache: @use_class_cache))
59
59
  end
60
60
  end
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  module Data
3
- VERSION = '2.2.11'
3
+ VERSION = '2.3.0'
4
4
  end
5
5
  end
@@ -106,6 +106,16 @@ module LucidDocument
106
106
  end
107
107
  end
108
108
 
109
+ def each(&block)
110
+ self.ferret_accelerator.each do |id|
111
+ doc = self.ferret_accelerator.index.doc(id)&.load
112
+ if doc
113
+ key = doc.delete(:key)
114
+ block.call(self.new(key: key, fields: doc))
115
+ end
116
+ end
117
+ end
118
+
109
119
  def search(query, options = {})
110
120
  top_docs = []
111
121
  self.ferret_accelerator.search_each(query, options) do |id|
@@ -125,6 +125,12 @@ module LucidObject
125
125
  end
126
126
  end
127
127
 
128
+ def each(readonly: true, &block)
129
+ self.object_expander.each(readonly: readonly) do |obj|
130
+ block.call(obj) if obj.class == self
131
+ end
132
+ end
133
+
128
134
  def search(attr, val, options = {})
129
135
  idx_type = self.indexed_attributes[attr]
130
136
  raise "Can only search indexed attributes, but attribute :#{attr} is not indexed!" unless idx_type
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.11
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-03 00:00:00.000000000 Z
11
+ date: 2022-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.14.17
75
+ version: 0.14.21
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.14.17
82
+ version: 0.14.21
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: isomorfeus-ferret
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -100,56 +100,56 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.6.6
103
+ version: 0.6.7
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.6.6
110
+ version: 0.6.7
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: isomorfeus-i18n
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 2.2.11
117
+ version: 2.3.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 2.2.11
124
+ version: 2.3.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: isomorfeus-policy
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 2.2.11
131
+ version: 2.3.0
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: 2.2.11
138
+ version: 2.3.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: isomorfeus-preact
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 10.6.56
145
+ version: 10.6.60
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 10.6.56
152
+ version: 10.6.60
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: isomorfeus-redux
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -170,28 +170,28 @@ dependencies:
170
170
  requirements:
171
171
  - - '='
172
172
  - !ruby/object:Gem::Version
173
- version: 2.2.11
173
+ version: 2.3.0
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - '='
179
179
  - !ruby/object:Gem::Version
180
- version: 2.2.11
180
+ version: 2.3.0
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: isomorfeus
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - '='
186
186
  - !ruby/object:Gem::Version
187
- version: 2.2.11
187
+ version: 2.3.0
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - '='
193
193
  - !ruby/object:Gem::Version
194
- version: 2.2.11
194
+ version: 2.3.0
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: rake
197
197
  requirement: !ruby/object:Gem::Requirement