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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46f4de27b813767b7895893a57d91abb6144e1f379563bbb913ce73649469e32
4
- data.tar.gz: 1a4c441b228c56a3d950658b8781778c0bcef5a3a86045997eee042b2f410844
3
+ metadata.gz: 2cbfa0df9b949e1cd271ef3fd8435382367cba5fbe6872de878e738ea3aa787a
4
+ data.tar.gz: da488a2e612795a42b3c4146606af29cb98b63a865e0581fcd8be48a4087f871
5
5
  SHA512:
6
- metadata.gz: 807747d86bb83d1e32d9430612dab9b9c7e59b7dc292e438cdbc029e6d7ece2f1340f2ce1dbc67f6ad42be83f9e7013c10024824412b6616b7ecde618f392f94
7
- data.tar.gz: 8e2fb44789b5b3cf811ff6f1ffdd4bb0c50dbc5c45bfbb7603773f72c4c662b803121293508db72ea4f45d395605cf5e7fdd201c468a5cda1fd9800bf3c96943
6
+ metadata.gz: c08679945a7c3253fb8201ba9a42fb3ee7dba3823ccbabe4dde0165fa1e68340290384760a07d4becda906f0f9106a26bed8a6d52ec06e50047869983fa640c7
7
+ data.tar.gz: 2494ba9634b2ea922e14be2045b75a52568113fc368c70f63208afeb14785e39ef022b5e91af04cd449bec46555dcc75c05f5463233d96a0c0af6d50cc38ca20
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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.18
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-03-11 00:00:00.000000000 Z
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