rowx 0.4.0 → 0.4.1

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
  SHA1:
3
- metadata.gz: 966d3405e30f74f4e5573192ed59d29be655c634
4
- data.tar.gz: e5c9bb2c81f11f9e8a8d99b39d11bee7efe9e52d
3
+ metadata.gz: d761d637c04b552b45abe3528d4dcb6f45f1c688
4
+ data.tar.gz: 18f6f0e2f3296a0de917bcab96da3b21bbacb35a
5
5
  SHA512:
6
- metadata.gz: 989b35a675a4e8179a56bf86f96a79fd9675b96a0909a1dee25b38057567f4d8b7e6c3806fd1a17395f68d19cc4b2169b0cd150fa4d56c07657d29a485a205da
7
- data.tar.gz: d52412e7ebe964a040fbb1d236009e936bcc62a625fba1b09a68db0b4e1c94f88bbd490898d9c04039e9f406313b107ec1946882a5a5d5e33d29fc6260b58e4c
6
+ metadata.gz: 210c130607762713ae3bb5fcbce9181db1901e0ac96f756b0442b8d29570d1d0e6c32d41c3b532dab865b6fd53b552fbe60b1e8b78920e054eb243e2d767ebb8
7
+ data.tar.gz: 6f5f9e8135a61b4ca8528016faf8ba29caea1d395bd2e6068ee0714e95724c303e0d9de93b7857745a1a96b3388ac70aa3a53bea9e29bde9a45234e55fecc612
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rowx.rb CHANGED
@@ -26,7 +26,8 @@ class RowX
26
26
 
27
27
  def initialize(txt, level: nil)
28
28
 
29
- a = LineTree.new(txt.gsub(/^-*$/m,''), level: level, ignore_blank_lines: false).to_a
29
+ a = LineTree.new(txt.gsub(/^-*$/m,''), \
30
+ level: level, ignore_blank_lines: false).to_a
30
31
  keyfield = a[0][0][/\w+:/]; i = 0
31
32
 
32
33
  # find the keyfield. if there's only 1 keyfield in all of the rows it's
@@ -60,9 +61,15 @@ class RowX
60
61
 
61
62
  value, name = s.split(':',2).reverse
62
63
  name ||= 'description'
63
-
64
+
64
65
  children = scan_a(field[1..-1]) if field[-1] .is_a?(Array)
65
- value = value.to_s.strip.gsub('<','&lt;').gsub('>','&gt;')
66
+ value = value.to_s.strip.gsub('<','&lt;').gsub('>','&gt;')
67
+
68
+ # it's a line which has been commented out?
69
+ if name[0] == '#' then
70
+ value = name[1..-1] + ': ' + value
71
+ name = '!-'
72
+ end
66
73
 
67
74
  result = [name, {}, value]
68
75
  result << children if children
@@ -78,4 +85,4 @@ class RowX
78
85
 
79
86
  end
80
87
 
81
- end
88
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rowx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  yaP43m5g1gqUfr6ys6w86uiM1Khmw6RXdAZBrQU+jmXYRU0OejB3+MdhPte5gP6n
32
32
  k3UhzyiVjlkLhQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-03-02 00:00:00.000000000 Z
34
+ date: 2015-03-03 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: line-tree
metadata.gz.sig CHANGED
Binary file