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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 925f930bf9cebe001d51faea47e660fd6307846e
4
- data.tar.gz: f30c55cb1529c3b22f90a2fb57673560f662f06c
3
+ metadata.gz: e19c4df01c5cc1e49c1a2027e4fe25b33cd7c108
4
+ data.tar.gz: d5c3314fb2525afc9794513494cca8202fb667e8
5
5
  SHA512:
6
- metadata.gz: e586079ce4d8e7dca1519e3091de50cfd76a9584fab55970f0c79483d71d5d5ff9f84d182efb4528a1b1d58adee8772ac9298448c0dba03ce2312f6cf7707bf7
7
- data.tar.gz: 96698fabae4872f66f9277cf2ae7ac73cfab3be231ece7f413bc959b6a3081a0049995640330067f97e1c50667c9ffc0ad408fe0e7fa2bc7d86cf09b3f094f91
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(/^\s*$\n/,'') : s
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[/.*/][/^\s*\w+:\S+/] then
38
+ if @ignore_label == true or not x[/.*/][/^ *\w+:\S+/] then
37
39
 
38
- rlines = (x).split(/\n/,-1)
40
+ rlines = x.lines.map {|x| x.sub(/(.)\n$/,'\1')}
39
41
 
40
- rlines = [x.gsub(/^\s{2}/,'')] if level and level < 0
42
+ rlines = [x.gsub(/^ {2}/,'')] if level and level < 0
41
43
  label = [rlines.shift]
42
- new_lines = rlines.map{|x| x[2..-1]}
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(/^\s{2}/,'')}.join]
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[/^\s*(\w+:)/,1]
65
+ non_element = s[/^ *(\w+:)/,1]
65
66
  return [nil,non_element] if non_element
66
67
  end
67
68
 
68
- r = s.match(/('[^']+[']|[^\s]+)\s*(\{.*\})?\s*(.*)/m)
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+\s*=\s*["'])/]
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.6
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
- 8ixkARkWAmV1MB4XDTE1MDkyMjE5MjExNVoXDTE2MDkyMTE5MjExNVowSDESMBAG
15
+ 8ixkARkWAmV1MB4XDTE3MDMwNTIwMTYzOFoXDTE4MDMwNTIwMTYzOFowSDESMBAG
16
16
  A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
17
  EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
- ggEBAKoCZRbLwILhPaKiwZZyjlliT5d0r3ND4EgTl41BAeru4B7+QTphTGoLMLcF
19
- VdSc4KXvUeIRBN1p4V0LncItc3Z2tpY/azMhp7puW5HjENToDmpZYo1L40TowIca
20
- vKLi89kB8MZ4Pbz96rNO7TWBk5+9PW49enn4trVty4h0l9JfR4HUWFrLtv66cw75
21
- gC3AW2Z7844K4Vwe2iIQZg/YKk2qoVYrXrPYVY8o2wp7FbHe1cQS15oJ8oW4abwv
22
- KVGh9v/HWBWJpiSGyR/xf6sj5T2sFFE2p9Epz+VsaF6XcRuxM7hqg1GmCe09gnE1
23
- xtu0mwyZWoEKKQfevgNKluztTKECAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
- DwQEAwIEsDAdBgNVHQ4EFgQU4mlrVQsMxMyCY7h28HvpElNidW0wJgYDVR0RBB8w
18
+ ggEBAMYEHO7u7PSWyWNCnDIoYaYUFbGDWeeXVH/s1j9nDszw2XuWpcha0QE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Xh
28
+ DXPLgzbYT1dQb7USjW6wF0Md/Dl4y0KE6Px0EkdV9yq8XRReXo54b3m5u9eaMyq/
29
+ w/TI6EfIg061p41o9FAFxyI9pqN7QNMsyK8FTBgOYsc+L1QAQLQoQ7zjZxdlTQNs
30
+ 4K01bd7bIVPf9ZNEWkgjSJRiioUYVzsezQzB/nD9KPcbS5lAKapavHcycXsKXDpk
31
+ m6UjuCKOiPqABbG2jvwjzF2RT9/yszKHPuB+qsEDC9HhonU7t7xizbYXXFCa7Ocj
32
+ UE2/ecWxKMEncA==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-11-03 00:00:00.000000000 Z
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.4.8
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
- %sm_jȢ*H���L�L��%E�+N��
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
+ J0nsp�L���zv� � �HQ�Y~����]�w���]�����ה�Xv�g�2m�q$��7�ʯͻw��P&'�x��gc���_U�){��%5:6 (�Ԭ�#�b�Oʬ���I��=Xfbhֈ���ڡ2V�