dxlite 0.5.0 → 0.6.0
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/lib/dxlite.rb +17 -5
- data.tar.gz.sig +0 -0
- metadata +5 -6
- 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: d5f7ff09ef018e512c58d742d1147b0808845c383a8e951fd973f682a7bc1fc1
|
4
|
+
data.tar.gz: 63ee1993b296960d11ba2c0144e7d0b5eccb7c9d95c825ad684b5ed4d9c008c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 175d5dc5ff60d75663435b4b3f3d2df8fb71ca19782313406fc08b14001b1d3d1e29aaec2bab587b9e87259d0d87c6f9f67e17203232df3afb13a142a8d757dc
|
7
|
+
data.tar.gz: 54ec532d5826582eedee068aa749d68112bab86f6da808cfec6a2b940bca5ef699071df8c8867242f666bc370449f44bc75575cdc9d3dab2a2d44b096f2c3033
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/dxlite.rb
CHANGED
@@ -6,11 +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
|
23
|
+
include RXFReadWriteModule
|
14
24
|
|
15
25
|
attr_accessor :summary, :filepath
|
16
26
|
attr_reader :records, :schema
|
@@ -20,7 +30,7 @@ class DxLite
|
|
20
30
|
@autosave, @debug = autosave, debug
|
21
31
|
|
22
32
|
return unless s
|
23
|
-
buffer, type =
|
33
|
+
buffer, type = RXFReader.read(s)
|
24
34
|
|
25
35
|
@filepath = s if type == :file or type == :dfs
|
26
36
|
|
@@ -157,7 +167,7 @@ class DxLite
|
|
157
167
|
|
158
168
|
def parse_xml(buffer)
|
159
169
|
|
160
|
-
doc = Rexle.new(buffer)
|
170
|
+
doc = Rexle.new(buffer.force_encoding('UTF-8'))
|
161
171
|
|
162
172
|
asummary = doc.root.xpath('summary/*').map do |node|
|
163
173
|
puts 'node: ' + node.xml.inspect if @debug
|
@@ -171,7 +181,7 @@ class DxLite
|
|
171
181
|
@schema = summary[:schema]
|
172
182
|
puts 'schema: ' + schema.inspect if @debug
|
173
183
|
|
174
|
-
@fields = @schema[/\(([^\)]+)/,1].split(/ *,
|
184
|
+
@fields = @schema[/\(([^\)]+)/,1].split(/ *, */)
|
175
185
|
puts 'fields: ' + @fields.inspect if @debug
|
176
186
|
|
177
187
|
@summary = summary
|
@@ -191,7 +201,7 @@ class DxLite
|
|
191
201
|
@filepath = file
|
192
202
|
|
193
203
|
s = File.extname(file) == '.json' ? to_json() : to_xml()
|
194
|
-
|
204
|
+
FileX.write file, s
|
195
205
|
end
|
196
206
|
|
197
207
|
def to_a()
|
@@ -371,6 +381,8 @@ class DxLite
|
|
371
381
|
|
372
382
|
end
|
373
383
|
|
384
|
+
make_methods()
|
385
|
+
|
374
386
|
end
|
375
387
|
|
376
388
|
end
|
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.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
9pK+pqislEMFrWscGeMsc6YMS7ALxEujTuwTWyxmWAXnYft4ff2O1Zh2sPmdOlgf
|
36
36
|
camg7d8q+VZZzAtz0cFc4pip
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-02-
|
38
|
+
date: 2022-02-20 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: kvx
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
version: '1.0'
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 1.0
|
49
|
+
version: 1.1.0
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -56,7 +56,7 @@ dependencies:
|
|
56
56
|
version: '1.0'
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 1.0
|
59
|
+
version: 1.1.0
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: recordx
|
62
62
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,8 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
|
107
|
-
rubygems_version: 2.7.10
|
106
|
+
rubygems_version: 3.2.22
|
108
107
|
signing_key:
|
109
108
|
specification_version: 4
|
110
109
|
summary: Handles Dynarex documents (in JSON format) faster and with less overheads.
|
metadata.gz.sig
CHANGED
Binary file
|