line-tree 0.5.6 → 0.5.7
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/lib/line-tree.rb +14 -13
- data.tar.gz.sig +0 -0
- metadata +18 -18
- metadata.gz.sig +1 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e19c4df01c5cc1e49c1a2027e4fe25b33cd7c108
|
4
|
+
data.tar.gz: d5c3314fb2525afc9794513494cca8202fb667e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e3b8abc6f3ababc817e05d84a149a524bda2e3887504bb2df71d1a53f25e1fca64e952b0d8183968b6807e324dca87b1541176a05ae46d063082916f8d75808
|
7
|
+
data.tar.gz: 0d85d1a505c07939b3939b53f82bd4aa7f5ad2216569bd3d4f537699f46a2960a4b9cdf9e765b839a2ce7d12e4f5bbdee0b11961b70f4cc68d93fc8f600ea26a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/line-tree.rb
CHANGED
@@ -13,8 +13,10 @@ class LineTree
|
|
13
13
|
|
14
14
|
@ignore_non_element = ignore_non_element
|
15
15
|
@ignore_label = ignore_label
|
16
|
+
@ignore_blank_lines = ignore_blank_lines
|
16
17
|
|
17
|
-
lines = ignore_blank_lines ? s.gsub(
|
18
|
+
lines = ignore_blank_lines ? s.gsub(/^ *$\n/,'') : s
|
19
|
+
|
18
20
|
@to_a = scan_shift(lines.strip, level)
|
19
21
|
end
|
20
22
|
|
@@ -31,16 +33,16 @@ class LineTree
|
|
31
33
|
|
32
34
|
a = lines.split(/(?=^\S+)/)
|
33
35
|
|
34
|
-
a.map do |x|
|
36
|
+
a.map do |x|
|
35
37
|
|
36
|
-
if @ignore_label == true or not x[/.*/][
|
38
|
+
if @ignore_label == true or not x[/.*/][/^ *\w+:\S+/] then
|
37
39
|
|
38
|
-
rlines =
|
40
|
+
rlines = x.lines.map {|x| x.sub(/(.)\n$/,'\1')}
|
39
41
|
|
40
|
-
rlines = [x.gsub(
|
42
|
+
rlines = [x.gsub(/^ {2}/,'')] if level and level < 0
|
41
43
|
label = [rlines.shift]
|
42
|
-
new_lines = rlines.map{|x| x
|
43
|
-
|
44
|
+
new_lines = rlines.map{|x| x.sub(/^ {2}/,'')}
|
45
|
+
|
44
46
|
if new_lines.length > 1 then
|
45
47
|
label + scan_shift(new_lines.join("\n"),level)
|
46
48
|
else
|
@@ -49,10 +51,9 @@ class LineTree
|
|
49
51
|
end
|
50
52
|
|
51
53
|
else
|
52
|
-
[x.lines.map{|x| x.sub(
|
54
|
+
[x.lines.map{|x| x.sub(/^ {2}/,'')}.join]
|
53
55
|
end
|
54
56
|
end
|
55
|
-
|
56
57
|
|
57
58
|
end
|
58
59
|
|
@@ -61,18 +62,18 @@ class LineTree
|
|
61
62
|
s = a.shift
|
62
63
|
|
63
64
|
if @ignore_non_element then
|
64
|
-
non_element = s[
|
65
|
+
non_element = s[/^ *(\w+:)/,1]
|
65
66
|
return [nil,non_element] if non_element
|
66
67
|
end
|
67
68
|
|
68
|
-
r = s.match(/('[^']+[']|[
|
69
|
+
r = s.match(/('[^']+[']|[^ ]+) *(\{.*\})? *(.*)/m)
|
69
70
|
.captures.values_at(0,1,-1)
|
70
71
|
|
71
72
|
if r[1] then
|
72
73
|
|
73
74
|
r[1] = get_attributes(r[1])
|
74
75
|
|
75
|
-
elsif s[/(\w
|
76
|
+
elsif s[/(\w+ *= *["'])/]
|
76
77
|
|
77
78
|
raw_attributes, value = s.split(/(?=[^'"]+$)/,2)
|
78
79
|
r[1] = get_xml_attributes raw_attributes
|
@@ -121,4 +122,4 @@ class LineTree
|
|
121
122
|
end
|
122
123
|
|
123
124
|
|
124
|
-
end
|
125
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: line-tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -12,26 +12,26 @@ cert_chain:
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
14
|
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
-
|
15
|
+
8ixkARkWAmV1MB4XDTE3MDMwNTIwMTYzOFoXDTE4MDMwNTIwMTYzOFowSDESMBAG
|
16
16
|
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
17
|
EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
ggEBAMYEHO7u7PSWyWNCnDIoYaYUFbGDWeeXVH/s1j9nDszw2XuWpcha0QEvhmA/
|
19
|
+
rikd1NjKfPQOcmdhKIDhZsI1o5XADDNfdLeGECE4VvD+AiNaQrKLJmYDJB31iN3k
|
20
|
+
k9a5xmzND/25YmIwGfrUVvIg6L5jf5Bzh68SHfYLfgmEjJRgT/Ze5mlg4+JtgB5b
|
21
|
+
BK2UJzwyTg/zQcSgbKYqJdEOJcmOHFnuy5HRmkfKJPvFpHuoF1eGv4X7w7v259vM
|
22
|
+
BglXs+DGljnPZu9N9m8QPd+UmM2Aep9wffbnZpDQ8tl51OA4hDqAtRw+wiMVAp0P
|
23
|
+
8yz9Qa0bhPcwaAaDMeTi33/uCmECAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
|
24
|
+
DwQEAwIEsDAdBgNVHQ4EFgQUKbYZEpa8nAinM6KOO63oAprrSGowJgYDVR0RBB8w
|
25
25
|
HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAl8HIvKoO
|
27
|
+
lD5/4p1EUi6/TD6fE6mnwSjXfiIYMvVUKeUrZF6OEmkTSmAXn/7Kr81DZkya7GXh
|
28
|
+
DXPLgzbYT1dQb7USjW6wF0Md/Dl4y0KE6Px0EkdV9yq8XRReXo54b3m5u9eaMyq/
|
29
|
+
w/TI6EfIg061p41o9FAFxyI9pqN7QNMsyK8FTBgOYsc+L1QAQLQoQ7zjZxdlTQNs
|
30
|
+
4K01bd7bIVPf9ZNEWkgjSJRiioUYVzsezQzB/nD9KPcbS5lAKapavHcycXsKXDpk
|
31
|
+
m6UjuCKOiPqABbG2jvwjzF2RT9/yszKHPuB+qsEDC9HhonU7t7xizbYXXFCa7Ocj
|
32
|
+
UE2/ecWxKMEncA==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2017-03-05 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rexle
|
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
version: '0'
|
82
82
|
requirements: []
|
83
83
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.
|
84
|
+
rubygems_version: 2.6.8
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: line-tree
|
metadata.gz.sig
CHANGED
@@ -1,3 +1 @@
|
|
1
|
-
|
2
|
-
�4�pG8���'�NlG�a���$MCS�LO�|�_��x�-��&�F���%�O���\�^B�-JN��3��U������d9w꧞�(�ٵ�9�d���#�^��eq�0�'A��-�ATpx�2�^�Qߖ�#"#��?��Y¹ed���
|
3
|
-
N�壢s&�_Z��� ]�dJ�UJ�i��Cf.m`
|
1
|
+
J�0nsp�L���z�v�� �HQ�Y~����]�w���]�����ה�Xv�g�2m�q$��7�ʯͻw��P&'�x��gc���_U�){��%5:6(�Ԭ�#�b�Oʬ���I��=Xfbhֈ���ڡ2V�
|