dynarex 1.7.11 → 1.7.12
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.tar.gz.sig +0 -0
- data/lib/dynarex.rb +36 -3
- metadata +11 -11
- metadata.gz.sig +1 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf8be329312f960ac9071137b011d0623295ee50
|
4
|
+
data.tar.gz: b1d4939cdfc2bc871602aa81efe9a98eaced2eef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb8ea5b406fc64f3c39cb04f8a140c4cbc85e3405b5c5e4ba3c92e4795198bfa0bc64eba66a2a68201f6de98abddd83aca2b69f581dd2bce2d3484d8310c3f64
|
7
|
+
data.tar.gz: 91dd2ae03c9dd8d7e4f858198dfecc5314f91f0ffc8f85ebcbf35e4c6fddbcd0abdce5d21e5bd721b51a9c4e56103c38cc5d4572cdd3bb6f6f54757007dbb228
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/dynarex.rb
CHANGED
@@ -24,6 +24,26 @@ class DynarexException < Exception
|
|
24
24
|
end
|
25
25
|
|
26
26
|
|
27
|
+
class DynarexRecordset < Array
|
28
|
+
|
29
|
+
def initialize(a, caller=nil)
|
30
|
+
super(a)
|
31
|
+
@caller = caller
|
32
|
+
end
|
33
|
+
|
34
|
+
def reject!()
|
35
|
+
|
36
|
+
a = self.to_a.clone
|
37
|
+
a2 = super
|
38
|
+
a3 = a - a2
|
39
|
+
|
40
|
+
@caller.delete a3.map(&:id)
|
41
|
+
self
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
|
27
47
|
class Dynarex
|
28
48
|
|
29
49
|
attr_accessor :format_mask, :delimiter, :xslt_schema, :schema, :linked,
|
@@ -62,7 +82,8 @@ class Dynarex
|
|
62
82
|
end
|
63
83
|
|
64
84
|
def all()
|
65
|
-
@doc.root.xpath("records/*").map {|x| recordx_to_record x}
|
85
|
+
a = @doc.root.xpath("records/*").map {|x| recordx_to_record x}
|
86
|
+
DynarexRecordset.new(a, self)
|
66
87
|
end
|
67
88
|
|
68
89
|
def clone()
|
@@ -437,8 +458,14 @@ EOF
|
|
437
458
|
#Updates a record from an id and a hash containing field name and field value.
|
438
459
|
# dynarex.update 4, name: Jeff, age: 38
|
439
460
|
|
440
|
-
def update(id,
|
461
|
+
def update(id, obj)
|
441
462
|
|
463
|
+
params = if obj.is_a? Hash then
|
464
|
+
obj
|
465
|
+
elsif obj.is_a? RecordX
|
466
|
+
obj.to_h
|
467
|
+
end
|
468
|
+
|
442
469
|
fields = capture_fields(params)
|
443
470
|
|
444
471
|
# for each field update each record field
|
@@ -457,7 +484,9 @@ EOF
|
|
457
484
|
#Delete a record.
|
458
485
|
# dyarex.delete 3 # deletes record with id 3
|
459
486
|
|
460
|
-
def delete(x)
|
487
|
+
def delete(x)
|
488
|
+
|
489
|
+
return x.each {|id| self.delete id} if x.is_a? Array
|
461
490
|
|
462
491
|
if x.to_i.to_s == x.to_s and x[/[0-9]/] then
|
463
492
|
@doc.root.delete("records/*[@id='#{x}']")
|
@@ -493,6 +522,10 @@ EOF
|
|
493
522
|
!@doc.root.element("records/*[@id='#{id}']").nil?
|
494
523
|
end
|
495
524
|
|
525
|
+
def refresh()
|
526
|
+
@dirty_flag = true
|
527
|
+
end
|
528
|
+
|
496
529
|
# used internally by to_rss()
|
497
530
|
#
|
498
531
|
def rss_xslt(opt={})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynarex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -119,20 +119,20 @@ dependencies:
|
|
119
119
|
requirements:
|
120
120
|
- - "~>"
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: '0.
|
122
|
+
version: '0.5'
|
123
123
|
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.
|
125
|
+
version: 0.5.0
|
126
126
|
type: :runtime
|
127
127
|
prerelease: false
|
128
128
|
version_requirements: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
130
|
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: '0.
|
132
|
+
version: '0.5'
|
133
133
|
- - ">="
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version: 0.
|
135
|
+
version: 0.5.0
|
136
136
|
- !ruby/object:Gem::Dependency
|
137
137
|
name: rxraw-lineparser
|
138
138
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,20 +179,20 @@ dependencies:
|
|
179
179
|
requirements:
|
180
180
|
- - "~>"
|
181
181
|
- !ruby/object:Gem::Version
|
182
|
-
version: '0.
|
182
|
+
version: '0.3'
|
183
183
|
- - ">="
|
184
184
|
- !ruby/object:Gem::Version
|
185
|
-
version: 0.
|
185
|
+
version: 0.3.1
|
186
186
|
type: :runtime
|
187
187
|
prerelease: false
|
188
188
|
version_requirements: !ruby/object:Gem::Requirement
|
189
189
|
requirements:
|
190
190
|
- - "~>"
|
191
191
|
- !ruby/object:Gem::Version
|
192
|
-
version: '0.
|
192
|
+
version: '0.3'
|
193
193
|
- - ">="
|
194
194
|
- !ruby/object:Gem::Version
|
195
|
-
version: 0.
|
195
|
+
version: 0.3.1
|
196
196
|
- !ruby/object:Gem::Dependency
|
197
197
|
name: kvx
|
198
198
|
requirement: !ruby/object:Gem::Requirement
|
@@ -202,7 +202,7 @@ dependencies:
|
|
202
202
|
version: '0.6'
|
203
203
|
- - ">="
|
204
204
|
- !ruby/object:Gem::Version
|
205
|
-
version: 0.6.
|
205
|
+
version: 0.6.1
|
206
206
|
type: :runtime
|
207
207
|
prerelease: false
|
208
208
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -212,7 +212,7 @@ dependencies:
|
|
212
212
|
version: '0.6'
|
213
213
|
- - ">="
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version: 0.6.
|
215
|
+
version: 0.6.1
|
216
216
|
description:
|
217
217
|
email: james@r0bertson.co.uk
|
218
218
|
executables: []
|
metadata.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
�
|
2
|
-
�iB<����Ø{C� `�����ܹn�a���H�/�?ւ��-�/��%��H�|+,G��)�h���+@z{qV��s���G~��%�J����3� �)�-˵�f��{Pmp����On���n��L�J���6����`�]�V�^��Z
|
1
|
+
~����e��ψ�of@z�����/�(�!Z��oYBw�sP>�_�\�X��Vk�h ��;T g���[�Ak��F�d.�Y�H������3+ii�u��G>�3|��`���d��� bC�+�=
|