kvx 1.1.2 → 1.1.3

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 +10 -2
  4. data.tar.gz.sig +0 -0
  5. metadata +2 -2
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f4470d45e160be12a005f238aa279f1fbee524685577307ae63bf5092395b89
4
- data.tar.gz: e2dc7d72fb2905b14d44e1707296fd91584964f7d0790ab2c922566c02b13e6d
3
+ metadata.gz: 9593cb5e316de67bd9d1f60da12863f2a7b723455292fd47b90414f432bde395
4
+ data.tar.gz: 4d9895d44ab99d29b047f9b6fc3befe12c48a1593e90e96d5ce56035be0f8efb
5
5
  SHA512:
6
- metadata.gz: 4c3815f945237a18b5c3d6e6c659b04cf6fed79218c7584113918c6668abc2d017d59f426dcdbae67cb39ece6ce7f68b7d4ad43b686557df16bdce83f2b7cf83
7
- data.tar.gz: d561ab4b23680593408bc67033d38e9d03fc3e0f67c3af5662934adbd13b5db4bffcb85de7a1067b0b63dcbf34ad42c7089a6d5a97789d36ff2d674240bf4328
6
+ metadata.gz: 752439f262e50697f9523030846b5c2ae8298ddce5abfc4478db06029594be76ca09679cd44f8ab43a8c8462b71dffe0cf5c9bd1d9744e19a9139d90e82aa85b
7
+ data.tar.gz: f851c04b8e76a5a39aa67463c48fbce12619d2d67a1fc7dff207eb501bbc187cad36715fb4da8e88b68dcbe6f12cab59f5e7299b8d29d45864fa714626fe19c8
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/kvx.rb CHANGED
@@ -34,7 +34,8 @@ class Kvx
34
34
  attr_accessor :attributes, :summary
35
35
  attr_reader :to_h
36
36
 
37
- def initialize(x=nil, summary: {}, body: {}, attributes: {}, debug: false)
37
+ def initialize(x=nil, summary: {}, body: {}, attributes: {},
38
+ comment_char: nil, debug: false)
38
39
 
39
40
  @header = attributes.any?
40
41
  @identifier = 'kvx'
@@ -42,6 +43,7 @@ class Kvx
42
43
  @ignore_blank_lines ||= false
43
44
 
44
45
  @attributes, @debug = attributes, debug
46
+ @comment_char = comment_char
45
47
 
46
48
  h = {
47
49
  hash: :passthru,
@@ -415,7 +417,13 @@ s = "
415
417
  puts ('lines: ' + lines.inspect).debug if @debug
416
418
 
417
419
  puts ('inside scan_to_h').info if @debug
418
- raw_a = LineTree.new(lines.join.gsub(/(^-*$)|(?<=\S) +#.*/,'').strip,
420
+ txt = lines.join.gsub(/^-*$/,'')
421
+
422
+ if @comment_char then
423
+ txt.gsub!(/(?<=\S) +#{@comment_char}.*|#{@comment_char}[^\n]+/,'')
424
+ end
425
+
426
+ raw_a = LineTree.new(txt.strip,
419
427
  ignore_blank_lines: @ignore_blank_lines).to_a
420
428
  puts ('raw_a: ' + raw_a.inspect).debug if @debug
421
429
 
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.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  kHNn+ERume1+043nzGdoGxJEUVUPYjRHDzWB1QG7OyRO+e9RZvsTQyTp2+EWVCPD
36
36
  haPJ+LVlPvQPLLPI124YDQp8
37
37
  -----END CERTIFICATE-----
38
- date: 2022-09-20 00:00:00.000000000 Z
38
+ date: 2022-09-27 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: line-tree
metadata.gz.sig CHANGED
Binary file