dxlite 0.6.2 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/dxlite.rb +38 -3
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e816ab0daf222f885ee7ea249cdf9a012bbd6fff5b5dbd70ad7954d5e64fca0
|
4
|
+
data.tar.gz: ba6b9adc13348320094513bbfd1f1640f2701b536144979db8bbca80e24da322
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22a4b6eb08241bc846b2514b95221eb53b2bb2bf43fdabb59bf051a2b318fe67c0a5c6ddd4f420cfc51b81bcc5b4ac586892a43198008d81f1575a2a0ea61822
|
7
|
+
data.tar.gz: ae300e9cabda3974a9b41b07e5a3698509476c1a593edef09176df5eeaf6405a7d22f6219df6835b5455a0bed46374ca73547443271869f4010770bdee249f44
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/dxlite.rb
CHANGED
@@ -82,7 +82,7 @@ class DxLite
|
|
82
82
|
|
83
83
|
end
|
84
84
|
|
85
|
-
def create(rawh, id: nil, custom_attributes: {created: Time.now})
|
85
|
+
def create(rawh, id: nil, custom_attributes: {created: Time.now.to_s})
|
86
86
|
|
87
87
|
if @debug then
|
88
88
|
puts 'create:: rawh: ' + rawh.inspect
|
@@ -94,8 +94,16 @@ class DxLite
|
|
94
94
|
if key then
|
95
95
|
|
96
96
|
r = records.find {|x| x[:body][key.to_sym] == rawh[key.to_sym]}
|
97
|
+
|
97
98
|
if r then
|
99
|
+
|
100
|
+
# if the client is using create() instead of update() to update a
|
101
|
+
# record then update the record
|
102
|
+
#
|
103
|
+
r[:body].merge!(rawh)
|
98
104
|
r[:last_modified] = Time.now.to_s
|
105
|
+
save() if @autosave
|
106
|
+
|
99
107
|
return false
|
100
108
|
end
|
101
109
|
|
@@ -225,13 +233,39 @@ class DxLite
|
|
225
233
|
record_name = schema()[/(?<=\/)[^\(]+/]
|
226
234
|
|
227
235
|
records = @records.map {|h| {record_name.to_sym => h} }
|
228
|
-
|
236
|
+
|
237
|
+
a = if @summary[:order] == 'descending' then
|
238
|
+
|
239
|
+
records.sort_by do |x|
|
240
|
+
|
241
|
+
if @debug then
|
242
|
+
puts 'x: ' + x.inspect
|
243
|
+
puts 'created: ' + Date.parse(x[:post][:created]).inspect
|
244
|
+
end
|
245
|
+
|
246
|
+
created = DateTime.parse(x[:post][:created])
|
247
|
+
|
248
|
+
last_modified = if x[:post][:last_modified] then
|
249
|
+
DateTime.parse(x[:post][:last_modified])
|
250
|
+
else
|
251
|
+
nil
|
252
|
+
end
|
253
|
+
|
254
|
+
last_modified || created
|
255
|
+
|
256
|
+
end.reverse
|
257
|
+
|
258
|
+
else
|
259
|
+
|
260
|
+
records
|
261
|
+
|
262
|
+
end
|
229
263
|
|
230
264
|
h = {
|
231
265
|
root_name.to_sym =>
|
232
266
|
{
|
233
267
|
summary: @summary,
|
234
|
-
records:
|
268
|
+
records: a
|
235
269
|
}
|
236
270
|
}
|
237
271
|
|
@@ -285,6 +319,7 @@ class DxLite
|
|
285
319
|
if r then
|
286
320
|
|
287
321
|
r[:body].merge!(obj)
|
322
|
+
r[:last_modified] = Time.now.to_s
|
288
323
|
save() if @autosave
|
289
324
|
|
290
325
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dxlite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
9pK+pqislEMFrWscGeMsc6YMS7ALxEujTuwTWyxmWAXnYft4ff2O1Zh2sPmdOlgf
|
36
36
|
camg7d8q+VZZzAtz0cFc4pip
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-
|
38
|
+
date: 2022-04-07 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: recordx
|
metadata.gz.sig
CHANGED
Binary file
|