dxlite 0.5.2 → 0.6.1
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 +15 -6
- data.tar.gz.sig +0 -0
- metadata +3 -23
- 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: cdef9eda0edd930a2698134328be46b4be487c13f3125e38b30e36e93ca5d22f
|
4
|
+
data.tar.gz: e44e9f3791b109b90e139ae749defcf7014adbbc21d642fb8aca70cd4378ce4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8875b822287ebd3037ccf1cff2ecd39dafcc70a6d99f75b35006448503f5624e1f7fd5dc61ccd6e1d909bb7a78331b5c39832dc0d9f3af7a751ea24e4f65fc5
|
7
|
+
data.tar.gz: d6abb77ad3dcfdddb2aa30449204286e2be4f7db49f0425380b8d8384212c58fcff9afc3af25f1b45c986c48471be91517bb8958a2a7e1fd49d32dc85dcd7f80
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/dxlite.rb
CHANGED
@@ -6,12 +6,21 @@ require 'c32'
|
|
6
6
|
require 'kvx'
|
7
7
|
require 'json'
|
8
8
|
require 'recordx'
|
9
|
-
require '
|
9
|
+
require 'rxfreadwrite'
|
10
10
|
|
11
11
|
|
12
|
+
# DxLite can perform the following:
|
13
|
+
#
|
14
|
+
# * read or write an XML file
|
15
|
+
# * read or write a JSON file (in Dynarex format)
|
16
|
+
# * import an Array of records (Hash objects)
|
17
|
+
#
|
18
|
+
# note: It cannot read a Dynarex file in
|
19
|
+
# the raw Dynarex format (.txt plain text)
|
20
|
+
|
12
21
|
class DxLite
|
13
22
|
using ColouredText
|
14
|
-
include
|
23
|
+
include RXFReadWriteModule
|
15
24
|
|
16
25
|
attr_accessor :summary, :filepath
|
17
26
|
attr_reader :records, :schema
|
@@ -21,7 +30,7 @@ class DxLite
|
|
21
30
|
@autosave, @debug = autosave, debug
|
22
31
|
|
23
32
|
return unless s
|
24
|
-
buffer, type =
|
33
|
+
buffer, type = RXFReader.read(s)
|
25
34
|
|
26
35
|
@filepath = s if type == :file or type == :dfs
|
27
36
|
|
@@ -158,7 +167,7 @@ class DxLite
|
|
158
167
|
|
159
168
|
def parse_xml(buffer)
|
160
169
|
|
161
|
-
doc = Rexle.new(buffer)
|
170
|
+
doc = Rexle.new(buffer.force_encoding('UTF-8'))
|
162
171
|
|
163
172
|
asummary = doc.root.xpath('summary/*').map do |node|
|
164
173
|
puts 'node: ' + node.xml.inspect if @debug
|
@@ -172,7 +181,7 @@ class DxLite
|
|
172
181
|
@schema = summary[:schema]
|
173
182
|
puts 'schema: ' + schema.inspect if @debug
|
174
183
|
|
175
|
-
@fields = @schema[/\(([^\)]+)/,1].split(/ *,
|
184
|
+
@fields = @schema[/\(([^\)]+)/,1].split(/ *, */)
|
176
185
|
puts 'fields: ' + @fields.inspect if @debug
|
177
186
|
|
178
187
|
@summary = summary
|
@@ -360,7 +369,7 @@ class DxLite
|
|
360
369
|
|
361
370
|
h[:summary].each do |key, value|
|
362
371
|
|
363
|
-
if %i(recordx_type format_mask schema).include? key then
|
372
|
+
if %i(recordx_type format_mask schema default_key).include? key then
|
364
373
|
@summary[key] = value
|
365
374
|
else
|
366
375
|
@summary[key.to_s] = value
|
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.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,28 +35,8 @@ cert_chain:
|
|
35
35
|
9pK+pqislEMFrWscGeMsc6YMS7ALxEujTuwTWyxmWAXnYft4ff2O1Zh2sPmdOlgf
|
36
36
|
camg7d8q+VZZzAtz0cFc4pip
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-
|
38
|
+
date: 2022-03-18 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
|
-
- !ruby/object:Gem::Dependency
|
41
|
-
name: kvx
|
42
|
-
requirement: !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
44
|
-
- - "~>"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '1.0'
|
47
|
-
- - ">="
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: 1.0.1
|
50
|
-
type: :runtime
|
51
|
-
prerelease: false
|
52
|
-
version_requirements: !ruby/object:Gem::Requirement
|
53
|
-
requirements:
|
54
|
-
- - "~>"
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: '1.0'
|
57
|
-
- - ">="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: 1.0.1
|
60
40
|
- !ruby/object:Gem::Dependency
|
61
41
|
name: recordx
|
62
42
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
83
|
- !ruby/object:Gem::Version
|
104
84
|
version: '0'
|
105
85
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
86
|
+
rubygems_version: 3.2.22
|
107
87
|
signing_key:
|
108
88
|
specification_version: 4
|
109
89
|
summary: Handles Dynarex documents (in JSON format) faster and with less overheads.
|
metadata.gz.sig
CHANGED
Binary file
|