dynarex 1.8.11 → 1.8.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 +24 -6
- 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: e190bb819e928a82ee758b9c01a07fd06168088dd9b8d7ab6c0f60d6586d3809
|
4
|
+
data.tar.gz: 3da35d504531ddd6436821e129473b122645b5cc3bf928aebe67e23877472d62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43042f3593485b6991af830cc98fddc44f283789d30e7365af132a7737f3548bb876564606536ee2b5aa4e0463d3dd50dd92c3559356ec942047f97d3af9e6c3
|
7
|
+
data.tar.gz: daf6d0081f699a528d7290078ebfeaa6ae6af391e9dd6e99e620e9c00b2e9ac608be2eb3eee99e0fd20a4c8fcf29cd6d4efe04e23bfc4af2f256f79f96fbf215
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/dynarex.rb
CHANGED
@@ -72,7 +72,7 @@ class Dynarex
|
|
72
72
|
using ColouredText
|
73
73
|
|
74
74
|
attr_accessor :format_mask, :delimiter, :xslt_schema, :schema, :linked,
|
75
|
-
:order, :type, :limit, :xslt, :json_out
|
75
|
+
:order, :type, :limit, :xslt, :json_out, :unique
|
76
76
|
|
77
77
|
|
78
78
|
#Create a new dynarex document from 1 of the following options:
|
@@ -85,13 +85,14 @@ class Dynarex
|
|
85
85
|
|
86
86
|
def initialize(rawx=nil, username: nil, password: nil, schema: nil,
|
87
87
|
default_key: nil, json_out: true, debug: false,
|
88
|
-
delimiter: ' # ', autosave: false, order: 'ascending'
|
88
|
+
delimiter: ' # ', autosave: false, order: 'ascending',
|
89
|
+
unique: false)
|
89
90
|
|
90
91
|
|
91
92
|
puts 'inside Dynarex::initialize' if debug
|
92
|
-
@username, @password, @schema, @default_key, @json_out, @debug =
|
93
|
-
|
94
|
-
@autosave = autosave
|
93
|
+
@username, @password, @schema, @default_key, @json_out, @debug = \
|
94
|
+
username, password, schema, default_key, json_out, debug
|
95
|
+
@autosave, @unique = autosave, unique
|
95
96
|
|
96
97
|
puts ('@debug: ' + @debug.inspect).debug if debug
|
97
98
|
@delimiter = delimiter
|
@@ -731,6 +732,12 @@ EOF
|
|
731
732
|
xml
|
732
733
|
end
|
733
734
|
|
735
|
+
def unique=(bool)
|
736
|
+
self.summary.merge!({unique: bool})
|
737
|
+
@dirty_flag = true
|
738
|
+
@unique = bool
|
739
|
+
end
|
740
|
+
|
734
741
|
def xpath(x)
|
735
742
|
@doc.root.xpath x
|
736
743
|
end
|
@@ -1011,6 +1018,7 @@ EOF
|
|
1011
1018
|
@summary[:recordx_type] = 'dynarex'
|
1012
1019
|
@summary[:schema] = @schema
|
1013
1020
|
@summary[:format_mask] = @format_mask
|
1021
|
+
@summary[:unique] = @unique
|
1014
1022
|
|
1015
1023
|
raw_lines.shift while raw_lines.first.strip.empty?
|
1016
1024
|
|
@@ -1070,7 +1078,17 @@ EOF
|
|
1070
1078
|
|
1071
1079
|
a2.compact!
|
1072
1080
|
a3 = a2.compact.map(&:first)
|
1073
|
-
|
1081
|
+
|
1082
|
+
if a3 != a3.uniq then
|
1083
|
+
|
1084
|
+
if @unique then
|
1085
|
+
raise DynarexException, "Duplicate id found"
|
1086
|
+
else
|
1087
|
+
add_id(a2)
|
1088
|
+
end
|
1089
|
+
|
1090
|
+
end
|
1091
|
+
|
1074
1092
|
a2
|
1075
1093
|
end
|
1076
1094
|
|
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.12
|
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-01-
|
33
|
+
date: 2019-01-07 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
|