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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rowx.rb +11 -4
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d761d637c04b552b45abe3528d4dcb6f45f1c688
|
4
|
+
data.tar.gz: 18f6f0e2f3296a0de917bcab96da3b21bbacb35a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,''),
|
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('<','<').gsub('>','>')
|
66
|
+
value = value.to_s.strip.gsub('<','<').gsub('>','>')
|
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.
|
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-
|
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
|