dynarex 1.8.2 → 1.8.3

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: e08090973a91214fcbeb4a90a977d807df41aa8cb6a09a5e190a490755c13a9c
4
- data.tar.gz: c5fbf4b0c7fc003735bedd57485e95eb877b2f1c22c7f2c5198baade4873ee26
3
+ metadata.gz: e8ef98976afc4fcc30bb3f964d33ddc30bae0c4b84f2631cdd2f134e4ac6af48
4
+ data.tar.gz: f9be49ef4a36640b96543dbecf9f9b625ae94d451c81e2e116b84dbdbc55df5f
5
5
  SHA512:
6
- metadata.gz: cea2e080fc4911d1007bce2c97f4d21c7763be227d956a7816f527d2f4261bd6af7cc024a58a9ce895b68786544684cc73487f21ddf425cb698b4d33c7de48fd
7
- data.tar.gz: 454ab3e2ab145a18177a6fb9b72add99706d8f9587c0a17a4e1a506afc96f9fc7ee97d18453c91c3835192ae3525d271b798584681f3570137fae28b008c1f6c
6
+ metadata.gz: ec3763b8c3621c6c69db7d86cd32e44b2f0d29d2a050044d937b89f0f4196c8c7b1488ddf0a359a4fac82a651c297b3c7665bbfbeaff415b1d09f8681dca8928
7
+ data.tar.gz: 52961337168cb97e0991a3df28aba516ac6eed1931ee6ffb978bca71a55358aea0a74c4e7433af7002b9a637da0aec990ed4b2c29c33a051022cc8a2dbeb8fae
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -74,14 +74,19 @@ class Dynarex
74
74
  puts 'inside Dynarex::initialize' if debug
75
75
  @username, @password, @schema, @default_key, @json_out, @debug = username,
76
76
  password, schema, default_key, json_out, debug
77
-
77
+ puts '@debug: ' + @debug.inspect if debug
78
78
  @delimiter = delimiter
79
79
  @spaces_delimited = false
80
80
  @order = 'ascending'
81
81
  @limit = nil
82
82
  @records, @flat_records = [], []
83
83
 
84
- openx(rawx.clone) if rawx
84
+ if rawx then
85
+
86
+ return import(rawx) if rawx =~ /\.txt$/
87
+ openx(rawx.clone)
88
+
89
+ end
85
90
 
86
91
  end
87
92
 
@@ -405,15 +410,23 @@ EOF
405
410
  display_xml(opt)
406
411
  end
407
412
 
408
- #Save the document to a local file.
413
+ # Save the document to a file.
409
414
 
410
415
  def save(filepath=nil, options={})
411
-
416
+
417
+ puts 'inside Dynarex::save' if @debug
418
+
412
419
  opt = {pretty: true}.merge options
413
420
  filepath ||= @local_filepath
414
421
  @local_filepath = filepath
415
422
  xml = display_xml(opt)
416
423
  buffer = block_given? ? yield(xml) : xml
424
+
425
+ if @debug then
426
+ puts 'before write; filepath: ' + filepath.inspect
427
+ puts 'buffer: ' + buffer.inspect
428
+ end
429
+
417
430
  FileX.write filepath, buffer
418
431
  FileX.write(filepath.sub(/\.xml$/,'.json'), self.to_json) if @json_out
419
432
  end
@@ -457,6 +470,7 @@ EOF
457
470
 
458
471
  def create(obj, id: nil, custom_attributes: {})
459
472
 
473
+ puts 'inside create' if @debug
460
474
  raise 'Dynarex#create(): input error: no arg provided' unless obj
461
475
 
462
476
  case obj.class.to_s.downcase.to_sym
@@ -720,7 +734,9 @@ EOF
720
734
 
721
735
  def hash_create(raw_params={}, id=nil, attr: {})
722
736
 
737
+ puts 'inside hash_create' if @debug
723
738
  record = make_record(raw_params, id, attr: attr)
739
+ puts 'record: ' + record.inspect
724
740
  method_name = @order == 'ascending' ? :add : :prepend
725
741
  @doc.root.element('records').method(method_name).call record
726
742
 
@@ -1132,7 +1148,10 @@ EOF
1132
1148
  elsif s[/^(?:http|df)s?:\/\//] then # url
1133
1149
  buffer, _ = RXFHelper.read s, {username: @username,
1134
1150
  password: @password, auto: false}
1151
+ @local_filepath = s if s =~ /^dfs:\/\/.*\.xml$/
1152
+
1135
1153
  else # local file
1154
+
1136
1155
  @local_filepath = s
1137
1156
 
1138
1157
  if File.exists? s then
@@ -1144,6 +1163,8 @@ EOF
1144
1163
  end
1145
1164
  end
1146
1165
  #@logger.debug 'buffer: ' + buffer[0..120]
1166
+
1167
+ return import(buffer) if buffer =~ /^<\?dynarex\b/
1147
1168
 
1148
1169
  if buffer then
1149
1170
 
@@ -1279,6 +1300,8 @@ EOF
1279
1300
  attributes = row.attributes
1280
1301
  result.merge body[@default_key.to_sym] => attributes.merge({id: id, body: body})
1281
1302
  end
1303
+
1304
+ puts 'records_to_h a: ' + a.inspect if @debug
1282
1305
  #@logger.debug 'a: ' + a.inspect
1283
1306
  a
1284
1307
 
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.2
4
+ version: 1.8.3
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: 2018-08-11 00:00:00.000000000 Z
33
+ date: 2018-09-03 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