dxlite 0.5.2 → 0.6.1

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: d801e5f83ee0cb995d9ce93d12f0dec7b12dee2d54abc9de52e756ad597ab2e4
4
- data.tar.gz: 90aac22d4b4355a49f966e8f2b6a7002b7f5837dbd753c523fe20cee141f63e0
3
+ metadata.gz: cdef9eda0edd930a2698134328be46b4be487c13f3125e38b30e36e93ca5d22f
4
+ data.tar.gz: e44e9f3791b109b90e139ae749defcf7014adbbc21d642fb8aca70cd4378ce4e
5
5
  SHA512:
6
- metadata.gz: fb2f3379b28b49e39c41a8cacc231a4e1b953b521c50f2cc2a406f5d081ebc9c3f35c8e48c29ec59122e40e7bab625e319941752d15a4bc7c45f425e0e056a13
7
- data.tar.gz: ab1798ce52a986be50e48bdd3e31c745fd96e256ee39c49197bfaaf823799d5bdec0120e26932e4549c466d370bb0290575112d4ffc514f7decb5e959615a331
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 'rxfhelper'
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 RXFHelperModule
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 = RXFHelper.read(s)
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.5.2
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-02-15 00:00:00.000000000 Z
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.3.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