kvx 1.0.0 → 1.1.0

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/kvx.rb +15 -5
  4. data.tar.gz.sig +0 -0
  5. metadata +8 -9
  6. metadata.gz.sig +3 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7d5de64957cdd3c219a4038db563dc40d2a4491d88f2c9dcf770d6e509a499a
4
- data.tar.gz: e097440702f891917b7cf2d2e7fd08643509d93862e0547b2db47e23fa420030
3
+ metadata.gz: e0985854184a09b20770031ef31762156103e708c9a52d35f39442f35e454a3a
4
+ data.tar.gz: 9f6ddacfe15e0189d8ee4875a70c4d1a0fc79c31dbbde264c528f7b3a6bc69ba
5
5
  SHA512:
6
- metadata.gz: c9fbcec52757af9fdbed34f0a25e2cef448634a0bd1dd9576266ed3e24d8d419a0eea28bc7bc650b76245aa4c3580cc7441b93fddbe1973afa117dffd7bacf73
7
- data.tar.gz: 4ca00225ba83c2f51e3d49d4860a2489b7b5e7bb5bd5b2a8f9559de5a8c4dbf75f6471216bf4c43f2f5ad1a94147dcddcd020f401c8d8e48d99ea5492ae708c4
6
+ metadata.gz: 5675ccfb52ff495bf136f4bea6def10fa8481b669f4d653dec571fe9b6c13dad812485f225f7f49d195321d0fc380b04414e5f738027c0d6f8efffd1ffbf0670
7
+ data.tar.gz: 7d2eb7037efcd05b8a94d552173d20c26ff6f0a2183e0e7b40e32546b05ddb0bd226f9d85d669aa05b5fc2183bed25488ca6ce207e9aa15cef83ebf082f56b15
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/kvx.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  # file: kvx.rb
4
4
 
5
5
  require 'line-tree'
6
- require 'rxfhelper'
6
+ require 'rxfreadwrite'
7
7
  require 'rexle-builder'
8
8
 
9
9
  module RegGem
@@ -28,7 +28,7 @@ end
28
28
  # * s -> h
29
29
 
30
30
  class Kvx
31
- include RXFHelperModule
31
+ include RXFReadWriteModule
32
32
  using ColouredText
33
33
 
34
34
  attr_accessor :attributes, :summary
@@ -308,14 +308,18 @@ s = "
308
308
 
309
309
  def parse_string(s)
310
310
 
311
- buffer, type = RXFHelper.read(s)
311
+ buffer, type = RXFReader.read(s)
312
312
  puts ('buffer: ' + buffer.inspect).debug if @debug
313
313
 
314
314
  if buffer.lstrip =~ /^<\?xml/ then
315
- doc = Rexle.new(buffer)
315
+
316
+ s = buffer.force_encoding("UTF-8")
317
+ doc = Rexle.new(s)
316
318
  @instructions = doc.instructions
317
319
  puts '@instructions: ' + @instructions.inspect if @debug
320
+
318
321
  xml_to_h(doc.root)
322
+
319
323
  else
320
324
  parse_to_h(buffer)
321
325
  end
@@ -325,14 +329,20 @@ s = "
325
329
  def methodize(h)
326
330
 
327
331
  h.each do |k,v|
332
+
328
333
  define_singleton_method(k){v} unless self.methods.include? k
334
+
335
+ unless self.methods.include? (k.to_s + '=').to_sym then
336
+ define_singleton_method((k.to_s + '=').to_sym){|x| h[k] = x}
337
+ end
338
+
329
339
  end
330
340
 
331
341
  end
332
342
 
333
343
  def parse_to_h(s, header_pattern: %r(^<\?kvx[\s\?]))
334
344
 
335
- raw_txt, _ = RXFHelper.read(s)
345
+ raw_txt, _ = RXFReader.read(s)
336
346
 
337
347
  # does the raw_txt contain header information?
338
348
  a = s.strip.lines
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kvx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  m/+jxdgFjKKGxeZqunu9cp5ca9wSjjtKh/VA/3xZtPwokCa7vCMB+ZxUP0jvd++u
36
36
  OTXy8k/zqddw/VfD/It1UUK4
37
37
  -----END CERTIFICATE-----
38
- date: 2021-12-29 00:00:00.000000000 Z
38
+ date: 2022-02-20 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: line-tree
@@ -58,25 +58,25 @@ dependencies:
58
58
  - !ruby/object:Gem::Version
59
59
  version: 0.9.3
60
60
  - !ruby/object:Gem::Dependency
61
- name: rxfhelper
61
+ name: rxfreadwrite
62
62
  requirement: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - "~>"
65
65
  - !ruby/object:Gem::Version
66
- version: '1.1'
66
+ version: '0.1'
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 1.1.3
69
+ version: 0.1.1
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '1.1'
76
+ version: '0.1'
77
77
  - - ">="
78
78
  - !ruby/object:Gem::Version
79
- version: 1.1.3
79
+ version: 0.1.1
80
80
  description:
81
81
  email: digital.robertson@gmail.com
82
82
  executables: []
@@ -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
- rubyforge_project:
107
- rubygems_version: 2.7.10
106
+ rubygems_version: 3.2.22
108
107
  signing_key:
109
108
  specification_version: 4
110
109
  summary: Kvx (Keys, Values, and XML) makes it convenient to store and retrieve the
metadata.gz.sig CHANGED
@@ -1 +1,3 @@
1
- ��4_��}-�~�6d?(�Ψ;��)��?�nc)�T,�f��32�sQC�v�T`�������jiƃT.Tdc�m*�Ś ��ga�/78O@api�����2������n�z�spI�ii�O�_(�2��3y�"A��q?ݝj��e�Ǿzjz]04����9D2B6ƒ��3yl�e�D��:^g$
1
+ �)'a[1oa����P�}\��T�)���ڰȀW5z���)H���f��Sr�2.��TT܀uK���T��������z�1��M���r��9D��OC���6@�? �^8J
2
+ YNJ�.�fjjy��M���b�y����T<c�^�;��
3
+ �u��Om�e���ِ���9vQDqWל�J�:y�6.Z<�,X�u�c����_��y4$]C[OjӒe �svulX�/.p�ua`���T�t�^o�/�s��nťcLYV��g�#�+��Q��q/��Ii��E�0�㦍%; P5�?Uu��G� 7��(�+��2<Z