kvx 0.9.6 → 0.9.11

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.tar.gz.sig +0 -0
  4. data/lib/kvx.rb +16 -10
  5. metadata +9 -9
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ddaef947e49b210dbee31fcf56ec84e3644681c6a790c9ec80cb9fe314cd9d8
4
- data.tar.gz: 56fae3981651c158701eb34023477125fbe7dd0ee8421d49d0e15174f550aae4
3
+ metadata.gz: 9fe4f150a49ff2f1c88b0cf28b7d24cbd04af9fc64cf7ea697fe0e29ab62a67b
4
+ data.tar.gz: c2ead702dcf44db16cb10a1866051ceb85d947870f491276c610acff2bf2c5be
5
5
  SHA512:
6
- metadata.gz: fd452778a00be2a43d078b61ffdbb2616c1b631a0a1806c6027453c739b755ac90c7cd7e804ee6fe0839dae01d083d02abbffb7900e54fa6b7ba6159abee3248
7
- data.tar.gz: 27c99e9368bc2dfd7cd49527eed157a31a9e2a2bd3d8caaf357fb12c1c5ccf898dc8913a963fdb2594eacf660054403302bc9425b54dfc46e06b588565ed9dd7
6
+ metadata.gz: abf623624bb8630caa32c5d1893013351e3ec328e188bca05343b51286376387c70006cc70ac265958e4b376b299bacf6578c9dab46113c8f36d98d1ae1422f1
7
+ data.tar.gz: 83e9dcbff011d65f72408f1b7b9ab681599eba0057e2ee3bc8b5e78a94a08afbb5b29e01214a08c7e0ee22847c4214398a826c4cd2183c24fae6142285731761
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/kvx.rb CHANGED
@@ -336,7 +336,7 @@ class Kvx
336
336
 
337
337
  lines = txt.gsub(/^-+$/m,'').lines.map do |line|
338
338
 
339
- if not line[/^ *\w+:|^ +/] then
339
+ if not line[/^ *[^:]+:|^ +/] then
340
340
  indent + ' ' + line
341
341
  else
342
342
  indent = line[/^ +/] || ''
@@ -344,22 +344,25 @@ class Kvx
344
344
  end
345
345
 
346
346
  end
347
-
347
+ puts ('lines: ' + lines.inspect).debug if @debug
348
+
348
349
  puts ('inside scan_to_h').info if @debug
349
- raw_a = LineTree.new(lines.join.gsub(/(^-*$)|(^ *#.*)/,'').strip,
350
+ raw_a = LineTree.new(lines.join.gsub(/(^-*$)|(?<=\S) +#.*/,'').strip,
350
351
  ignore_blank_lines: @ignore_blank_lines).to_a
351
352
  puts ('raw_a: ' + raw_a.inspect).debug if @debug
352
353
 
353
354
  # if there are any orphan lines which aren't nested underneath a
354
355
  # label, they will be fixed using the following statement
355
356
 
356
- a = raw_a.chunk {|x| x[0][/^[^:]+:|.*/]}.inject([]) do |r,y|
357
+ a = raw_a.chunk {|x| x[0][/^[^:]+:/]}.inject([]) do |r,y|
358
+
357
359
 
358
360
  puts 'r: ' + r.inspect if @debug
359
361
 
360
362
  if r.last and !y.first[/[^:]+:/] then
361
363
  r.last << y.last[-1]
362
364
  else
365
+ puts 'y: ' + y.inspect if @debug
363
366
  r << y.last[-1]
364
367
  end
365
368
 
@@ -372,13 +375,16 @@ class Kvx
372
375
  s = line.shift
373
376
  puts ('s: ' + s.inspect).debug if @debug
374
377
 
375
- if line.join.length > 0 then
376
-
377
- r2 = if line[0][0][/^[^:]+:/] then
378
-
379
- padding = line[0].length < 2 ? "\n" : "\n "
378
+ if line.join.length > 0 then
379
+
380
+ puts 'line: ' + line.inspect if @debug
381
+
382
+ padding = line[0].length < 2 ? "\n" : "\n "
383
+ s10 = line.map{|x| x.join(padding)}.join("\n")
384
+
385
+ r2 = if s10[/^ *\w+:[\n ]/] then
380
386
 
381
- scan_to_h(line.map{|x| x.join(padding)}.join("\n"))
387
+ scan_to_h(s10)
382
388
 
383
389
  else
384
390
 
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: 0.9.6
4
+ version: 0.9.11
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-05-19 00:00:00.000000000 Z
38
+ date: 2021-06-06 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: line-tree
@@ -61,22 +61,22 @@ dependencies:
61
61
  name: rxfhelper
62
62
  requirement: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: 1.0.0
67
64
  - - "~>"
68
65
  - !ruby/object:Gem::Version
69
66
  version: '1.0'
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 1.0.0
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: 1.0.0
77
74
  - - "~>"
78
75
  - !ruby/object:Gem::Version
79
76
  version: '1.0'
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: 1.0.0
80
80
  description:
81
81
  email: james@jamesrobertson.eu
82
82
  executables: []
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubygems_version: 3.0.3
106
+ rubygems_version: 3.1.2
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Kvx (Keys, Values, and XML) makes it convenient to store and retrieve the
metadata.gz.sig CHANGED
Binary file