dynarex 1.8.18 → 1.8.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/dynarex.rb +13 -3
- 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: 2cbfa0df9b949e1cd271ef3fd8435382367cba5fbe6872de878e738ea3aa787a
|
4
|
+
data.tar.gz: da488a2e612795a42b3c4146606af29cb98b63a865e0581fcd8be48a4087f871
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c08679945a7c3253fb8201ba9a42fb3ee7dba3823ccbabe4dde0165fa1e68340290384760a07d4becda906f0f9106a26bed8a6d52ec06e50047869983fa640c7
|
7
|
+
data.tar.gz: 2494ba9634b2ea922e14be2045b75a52568113fc368c70f63208afeb14785e39ef022b5e91af04cd449bec46555dcc75c05f5463233d96a0c0af6d50cc38ca20
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/dynarex.rb
CHANGED
@@ -56,6 +56,10 @@ class DynarexRecordset < Array
|
|
56
56
|
self
|
57
57
|
end
|
58
58
|
|
59
|
+
def sum(field)
|
60
|
+
self.inject(0) {|r, x| r + x[field.to_sym][/\d+(\.\d+)?$/].to_f }
|
61
|
+
end
|
62
|
+
|
59
63
|
def index(val)
|
60
64
|
self.map(&:to_h).index val.to_h
|
61
65
|
end
|
@@ -155,6 +159,8 @@ class Dynarex
|
|
155
159
|
@doc
|
156
160
|
end
|
157
161
|
|
162
|
+
# XML import
|
163
|
+
#
|
158
164
|
def foreign_import(options={})
|
159
165
|
o = {xml: '', schema: ''}.merge(options)
|
160
166
|
h = {xml: o[:xml], schema: @schema, foreign_schema: o[:schema]}
|
@@ -351,7 +357,7 @@ EOF
|
|
351
357
|
if raw_summary_fields then
|
352
358
|
summary_fields = raw_summary_fields.split(',') # .map(&:to_sym)
|
353
359
|
sumry = summary_fields.map {|x| x.strip!; x + ': ' + \
|
354
|
-
self.summary[x.to_sym]}.join("\n") + "\n"
|
360
|
+
self.summary[x.to_sym]}.join("\n") + "\n\n"
|
355
361
|
end
|
356
362
|
|
357
363
|
if @raw_header then
|
@@ -404,11 +410,11 @@ EOF
|
|
404
410
|
header ? docheader + "--#\n" + out : out
|
405
411
|
|
406
412
|
elsif self.delimiter.length > 0 then
|
407
|
-
|
413
|
+
puts 'dinddd'
|
408
414
|
tfo = TableFormatter.new border: false, wrap: false, \
|
409
415
|
divider: self.delimiter
|
410
416
|
tfo.source = self.to_a.map{|x| x.values}
|
411
|
-
docheader + tfo.display
|
417
|
+
docheader + tfo.display.strip
|
412
418
|
|
413
419
|
else
|
414
420
|
|
@@ -928,6 +934,10 @@ EOF
|
|
928
934
|
attributes[key] = item[key] || '' unless key == :body
|
929
935
|
end
|
930
936
|
|
937
|
+
if @record_name.nil? then
|
938
|
+
raise DynarexException, 'record_name can\'t be nil. Check the schema'
|
939
|
+
end
|
940
|
+
|
931
941
|
xml.send(@record_name, attributes) do
|
932
942
|
item[:body].each do |name,value|
|
933
943
|
|
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.8.
|
4
|
+
version: 1.8.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
+2pKHQJfU1lEmVoo4afsLMvmq/CZPJba1LR3Z1QJXYCWt9IEZTECStKlK7H6RiIx
|
31
31
|
gRA=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2019-
|
33
|
+
date: 2019-06-02 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: dynarex-import
|
metadata.gz.sig
CHANGED
Binary file
|