dynarex 1.9.1 → 1.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/lib/dynarex.rb +17 -11
  4. data.tar.gz.sig +0 -0
  5. metadata +29 -30
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5372615b4ec91fc55c240cae2a993e641e3c53da03986c7fc68871393953efce
4
- data.tar.gz: c6ded46e9e56dd208c1c8f8babb9675adc54b13b31dc4ca0cbba3c6067e0d739
3
+ metadata.gz: c46d4fcb9b14d12267b5ad08cafd81951384aeafcbe68953836b1e83769c836a
4
+ data.tar.gz: 5616c928edbf1e4ef7076ca5236e335009bc6b11f922b34a16c67fb10967709f
5
5
  SHA512:
6
- metadata.gz: e560695bd9a1179eaa5b96947d24b63f99d81dac67646c12a19211863bce9e604e37f253108b9ce0a449173b6652a5dc7b3024ba494f14b8e6edc9102bd4e606
7
- data.tar.gz: f1cb6159a438012e52f27843d998df8d00c8d16d748b4f28c533535adc76af61bb127c6c7891373c2a1491797f19218570ab4f653da1fc65bfff5665cc5b2690
6
+ metadata.gz: 51947520e02a33849f82ed868b95fccd70d5afd607f5d6b79c5acc0d27a2946b3bd42a1157179cdc476751d9d2623857d92a5a5495e3a646b76bf7f4f37720ab
7
+ data.tar.gz: 4012981e3cb950c54eba69cae53b809708be07c93748787f3b57368464547010be66183fb3d8a048c7786f52aa68f3b3f2543168dc34df3e0e8b09e955419a3f
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/dynarex.rb CHANGED
@@ -15,7 +15,7 @@ require 'yaml'
15
15
  require 'rowx'
16
16
  require 'ostruct'
17
17
  require 'table-formatter'
18
- #require 'rxfhelper'
18
+ require 'rxfreader'
19
19
  require 'kvx'
20
20
  require 'json'
21
21
 
@@ -72,7 +72,7 @@ end
72
72
 
73
73
 
74
74
  class Dynarex
75
- include RXFHelperModule
75
+ include RXFReadWriteModule
76
76
  using ColouredText
77
77
 
78
78
  attr_accessor :format_mask, :delimiter, :xslt_schema, :schema, :linked,
@@ -94,8 +94,8 @@ class Dynarex
94
94
 
95
95
 
96
96
  puts 'inside Dynarex::initialize' if debug
97
- @username, @password, @schema, @default_key, @json_out, @debug = \
98
- username, password, schema, default_key, json_out, debug
97
+ @username, @password, @schema, = username, password, schema
98
+ @default_key, @json_out, @debug = default_key, json_out, debug
99
99
  @autosave, @unique = autosave, unique
100
100
  @local_filepath = filepath
101
101
 
@@ -324,7 +324,7 @@ class Dynarex
324
324
  def to_html(domain: '')
325
325
 
326
326
  h = {username: @username, password: @password}
327
- xsl_buffer = RXFHelper.read(domain + @xslt, h).first
327
+ xsl_buffer = RXFReader.read(domain + @xslt, h).first
328
328
  Rexslt.new(xsl_buffer, self.to_doc).to_s
329
329
 
330
330
  end
@@ -529,12 +529,12 @@ EOF
529
529
  return self
530
530
 
531
531
  end
532
- raw_buffer, type = RXFHelper.read(x, auto: false)
532
+ raw_buffer, type = RXFReader.read(x, auto: false)
533
533
 
534
534
  if raw_buffer.is_a? String then
535
535
 
536
536
  buffer = block_given? ? yield(raw_buffer) : raw_buffer.clone
537
- string_parse buffer
537
+ string_parse buffer.force_encoding('UTF-8')
538
538
 
539
539
  else
540
540
  foreign_import x
@@ -930,7 +930,7 @@ EOF
930
930
 
931
931
  raw_lines.map do |line|
932
932
 
933
- buffer = RXFHelper.read(line.chomp, auto: false).first
933
+ buffer = RXFReader.read(line.chomp, auto: false).first
934
934
 
935
935
  doc = Rexle.new buffer
936
936
 
@@ -994,6 +994,9 @@ EOF
994
994
  raise DynarexException, 'record_name can\'t be nil. Check the schema'
995
995
  end
996
996
 
997
+ puts 'attributes: ' + attributes.inspect if @debug
998
+ puts '@record_name: ' + @record_name.inspect
999
+
997
1000
  xml.send(@record_name, attributes) do
998
1001
  item[:body].each do |name,value|
999
1002
 
@@ -1252,6 +1255,9 @@ EOF
1252
1255
  if s.match(ptrn) then
1253
1256
 
1254
1257
  @root_name, raw_summary, record_name, raw_fields = s.match(ptrn).captures
1258
+ reserved = %w(require parent gem)
1259
+
1260
+ raise 'reserved keyword: ' + record_name if reserved.include? record_name
1255
1261
  summary, fields = [raw_summary || '',raw_fields].map {|x| x.split(/,/).map &:strip}
1256
1262
 
1257
1263
  if fields.include? 'id' then
@@ -1260,7 +1266,7 @@ EOF
1260
1266
 
1261
1267
  create_find fields
1262
1268
 
1263
- reserved = %w(require parent)
1269
+
1264
1270
  raise 'reserved keyword' if (fields & reserved).any?
1265
1271
 
1266
1272
  else
@@ -1298,14 +1304,14 @@ EOF
1298
1304
  dynarex_new(s)
1299
1305
 
1300
1306
  elsif s[/^https?:\/\//] then # url
1301
- buffer, type = RXFHelper.read s, {username: @username,
1307
+ buffer, type = RXFReader.read s, {username: @username,
1302
1308
  password: @password, auto: false}
1303
1309
  elsif s[/^dfs?:\/\//] then
1304
1310
 
1305
1311
  @local_filepath = s
1306
1312
 
1307
1313
  if FileX.exists? s then
1308
- buffer = FileX.read s
1314
+ buffer = FileX.read(s).force_encoding("UTF-8")
1309
1315
  elsif @schema
1310
1316
  dynarex_new @schema, default_key: @default_key
1311
1317
  end
data.tar.gz.sig CHANGED
Binary file
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.9.1
4
+ version: 1.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  Wt/hg1iB0cnuzli8yHYtvBQovgFKUdQ7vGKM2IC9ZoWstmfIRwUAdI/Y2eHvUg3z
36
36
  dRm4fWf/5CZ2qPKTB8vb2s4Q
37
37
  -----END CERTIFICATE-----
38
- date: 2022-01-25 00:00:00.000000000 Z
38
+ date: 2022-02-21 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: dynarex-import
@@ -81,22 +81,22 @@ dependencies:
81
81
  name: rexslt
82
82
  requirement: !ruby/object:Gem::Requirement
83
83
  requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- version: 0.7.0
87
84
  - - "~>"
88
85
  - !ruby/object:Gem::Version
89
86
  version: '0.7'
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 0.7.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: 0.7.0
97
94
  - - "~>"
98
95
  - !ruby/object:Gem::Version
99
96
  version: '0.7'
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: 0.7.0
100
100
  - !ruby/object:Gem::Dependency
101
101
  name: dynarex-xslt
102
102
  requirement: !ruby/object:Gem::Requirement
@@ -141,82 +141,82 @@ dependencies:
141
141
  name: rxraw-lineparser
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: 0.2.0
147
144
  - - "~>"
148
145
  - !ruby/object:Gem::Version
149
146
  version: '0.2'
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: 0.2.0
150
150
  type: :runtime
151
151
  prerelease: false
152
152
  version_requirements: !ruby/object:Gem::Requirement
153
153
  requirements:
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- version: 0.2.0
157
154
  - - "~>"
158
155
  - !ruby/object:Gem::Version
159
156
  version: '0.2'
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: 0.2.0
160
160
  - !ruby/object:Gem::Dependency
161
161
  name: rowx
162
162
  requirement: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '0.7'
166
+ version: '0.8'
167
167
  - - ">="
168
168
  - !ruby/object:Gem::Version
169
- version: 0.7.4
169
+ version: 0.8.0
170
170
  type: :runtime
171
171
  prerelease: false
172
172
  version_requirements: !ruby/object:Gem::Requirement
173
173
  requirements:
174
174
  - - "~>"
175
175
  - !ruby/object:Gem::Version
176
- version: '0.7'
176
+ version: '0.8'
177
177
  - - ">="
178
178
  - !ruby/object:Gem::Version
179
- version: 0.7.4
179
+ version: 0.8.0
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: table-formatter
182
182
  requirement: !ruby/object:Gem::Requirement
183
183
  requirements:
184
- - - ">="
185
- - !ruby/object:Gem::Version
186
- version: 0.7.0
187
184
  - - "~>"
188
185
  - !ruby/object:Gem::Version
189
186
  version: '0.7'
187
+ - - ">="
188
+ - !ruby/object:Gem::Version
189
+ version: 0.7.1
190
190
  type: :runtime
191
191
  prerelease: false
192
192
  version_requirements: !ruby/object:Gem::Requirement
193
193
  requirements:
194
- - - ">="
195
- - !ruby/object:Gem::Version
196
- version: 0.7.0
197
194
  - - "~>"
198
195
  - !ruby/object:Gem::Version
199
196
  version: '0.7'
197
+ - - ">="
198
+ - !ruby/object:Gem::Version
199
+ version: 0.7.1
200
200
  - !ruby/object:Gem::Dependency
201
201
  name: kvx
202
202
  requirement: !ruby/object:Gem::Requirement
203
203
  requirements:
204
204
  - - "~>"
205
205
  - !ruby/object:Gem::Version
206
- version: '1.0'
206
+ version: '1.1'
207
207
  - - ">="
208
208
  - !ruby/object:Gem::Version
209
- version: 1.0.1
209
+ version: 1.1.0
210
210
  type: :runtime
211
211
  prerelease: false
212
212
  version_requirements: !ruby/object:Gem::Requirement
213
213
  requirements:
214
214
  - - "~>"
215
215
  - !ruby/object:Gem::Version
216
- version: '1.0'
216
+ version: '1.1'
217
217
  - - ">="
218
218
  - !ruby/object:Gem::Version
219
- version: 1.0.1
219
+ version: 1.1.0
220
220
  description:
221
221
  email: digital.robertson@gmail.com
222
222
  executables: []
@@ -243,8 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
243
  - !ruby/object:Gem::Version
244
244
  version: '0'
245
245
  requirements: []
246
- rubyforge_project:
247
- rubygems_version: 2.7.10
246
+ rubygems_version: 3.2.22
248
247
  signing_key:
249
248
  specification_version: 4
250
249
  summary: The Dynarex gem creates, reads, updates or delete rows of Dynarex flavoured
metadata.gz.sig CHANGED
Binary file