isomorfeus-data 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isomorfeus/data/object_expander.rb +5 -4
- data/lib/isomorfeus/data/version.rb +1 -1
- data/lib/isomorfeus_data/lucid_object/mixin.rb +16 -4
- metadata +20 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb046c8cee5e36e1b718bff9661851657c403efe02aefb81c999849e1e040a8d
|
4
|
+
data.tar.gz: c0eca11aada669a12d111c4d4e4e800b8ac46528e686dd3370b9d1958d51e964
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 530831d5f854d3ed6e3e2a87d13cc0bd2c9e2bdb960b369941668cf3f622dc3b67b281a39aaee4350045ee50c5e5bfc9a7a41d40f8fb2143147333fda8af9675
|
7
|
+
data.tar.gz: c56e046ff4ed72be681189c982b29772e37b2a048aa6183a8fc81e662315cef17552225665e7a471e65723a6c473e49b71d492a4d53be0bf6e71f810b26df726
|
@@ -9,22 +9,23 @@ module Isomorfeus
|
|
9
9
|
|
10
10
|
attr_accessor :environment
|
11
11
|
|
12
|
-
def initialize(
|
12
|
+
def initialize(class_name:, compress: false, &block)
|
13
13
|
if block_given?
|
14
14
|
res = block.call(self)
|
15
15
|
self.environment = res unless self.environment
|
16
16
|
else
|
17
|
-
@env_path = File.expand_path(File.join(Isomorfeus.data_object_envs_path,
|
17
|
+
@env_path = File.expand_path(File.join(Isomorfeus.data_object_envs_path, class_name.underscore))
|
18
18
|
open_environment
|
19
19
|
end
|
20
20
|
@db = self.environment.database('objects', create: true)
|
21
21
|
@index_db = self.environment.database('index', create: true, dupsort: true)
|
22
|
+
@compress = compress
|
22
23
|
@use_class_cache = !Isomorfeus.development?
|
23
24
|
ObjectSpace.define_finalizer(self, self.class.finalize(self))
|
24
25
|
end
|
25
26
|
|
26
27
|
def create_object(sid_s, obj)
|
27
|
-
Isomorfeus::Hamster::Marshal.dump(@db, sid_s, obj, class_cache: @use_class_cache)
|
28
|
+
Isomorfeus::Hamster::Marshal.dump(@db, sid_s, obj, class_cache: @use_class_cache, compress: @compress)
|
28
29
|
end
|
29
30
|
|
30
31
|
def destroy_object(sid_s)
|
@@ -37,7 +38,7 @@ module Isomorfeus
|
|
37
38
|
end
|
38
39
|
|
39
40
|
def save_object(sid_s, obj)
|
40
|
-
Isomorfeus::Hamster::Marshal.dump(@db, sid_s, obj, class_cache: @use_class_cache)
|
41
|
+
Isomorfeus::Hamster::Marshal.dump(@db, sid_s, obj, class_cache: @use_class_cache, compress: @compress)
|
41
42
|
end
|
42
43
|
|
43
44
|
def index_delete(key, val)
|
@@ -6,6 +6,16 @@ module LucidObject
|
|
6
6
|
base.include(Isomorfeus::Data::GenericInstanceApi)
|
7
7
|
base.include(LucidI18n::Mixin)
|
8
8
|
|
9
|
+
base.instance_exec do
|
10
|
+
def store_compressed(quality: 5)
|
11
|
+
@_store_compressed = quality
|
12
|
+
end
|
13
|
+
|
14
|
+
def _store_compressed
|
15
|
+
@_store_compressed
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
9
19
|
def [](name)
|
10
20
|
send(name)
|
11
21
|
end
|
@@ -97,11 +107,13 @@ module LucidObject
|
|
97
107
|
|
98
108
|
def object_expander
|
99
109
|
return @object_expander if @object_expander
|
110
|
+
compress = _store_compressed
|
111
|
+
compress = false if compress.nil?
|
100
112
|
@object_expander = if @_setup_environment_block
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
113
|
+
Isomorfeus::Data::ObjectExpander.new(class_name: self.to_s, compress: compress, &@_setup_index_block)
|
114
|
+
else
|
115
|
+
Isomorfeus::Data::ObjectExpander.new(class_name: self.to_s, compress: compress)
|
116
|
+
end
|
105
117
|
end
|
106
118
|
|
107
119
|
def object_accelerator
|
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.
|
4
|
+
version: 2.2.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-02-
|
11
|
+
date: 2022-02-20 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.
|
75
|
+
version: 0.14.17
|
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.
|
82
|
+
version: 0.14.17
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: isomorfeus-ferret
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,98 +100,98 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.6.
|
103
|
+
version: 0.6.6
|
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.
|
110
|
+
version: 0.6.6
|
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.
|
117
|
+
version: 2.2.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.
|
124
|
+
version: 2.2.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.
|
131
|
+
version: 2.2.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.
|
138
|
+
version: 2.2.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.
|
145
|
+
version: 10.6.40
|
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.
|
152
|
+
version: 10.6.40
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: isomorfeus-redux
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 4.1.
|
159
|
+
version: 4.1.18
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 4.1.
|
166
|
+
version: 4.1.18
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: isomorfeus-transport
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - '='
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 2.
|
173
|
+
version: 2.2.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.
|
180
|
+
version: 2.2.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.
|
187
|
+
version: 2.2.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.
|
194
|
+
version: 2.2.0
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: rake
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,14 +212,14 @@ dependencies:
|
|
212
212
|
requirements:
|
213
213
|
- - "~>"
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version: 3.
|
215
|
+
version: 3.11.0
|
216
216
|
type: :development
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
220
|
- - "~>"
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version: 3.
|
222
|
+
version: 3.11.0
|
223
223
|
description: Develop apps with powerful reactive data access and queries.
|
224
224
|
email: jan@kursator.de
|
225
225
|
executables: []
|