line-tree 0.3.10 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b1d8b1746041adb44a1565d06ee0e99a6160b8b
4
- data.tar.gz: 07e23606ccef2e084662cc41528e28652b87a37d
3
+ metadata.gz: 0b218eb5c7d7c50b5b1a5021561cbd328c39bb8d
4
+ data.tar.gz: 758d5c720ab244fde1b0c3ea6e4fc7fa767c4b2a
5
5
  SHA512:
6
- metadata.gz: 70701eba112ed9e6dfc56c78329c5322358742efe4b1f207d3f43f88f3ea773370a038e9b65422a8656368f58d9d9968ce5272a1d215fb76740b2dfcb84270ac
7
- data.tar.gz: af3387a85784bdf7184b0e81039a57afbe23c9d48b42ea9c78e1fd2e393adda326e1312d5705bce80db8e92f4528c7632acd631fdaf2f53ebc8fda2b71b3c578
6
+ metadata.gz: ebb2ac986b0e4c4fc5c0756a0ba8f5a3c3b942384f983292f61a193db74d2be5741d0a4cf5d4174931356b4804ce71a732415650764acb4a08294ad29c6021ba
7
+ data.tar.gz: 36863ede5c28ce7cec94d4d2337cd2048b7f63d7e81fe15977626bc5016dfb59325731c19b4fbcbaef81b7bf3b45edba944bd34d53cc3b5895eb82ed4449e9d6
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/line-tree.rb CHANGED
@@ -19,21 +19,25 @@ class LineTree
19
19
 
20
20
  a.map do |x|
21
21
 
22
- rlines = x.split(/\n/)
23
- label = [rlines.shift]
24
- new_lines = rlines.map{|x| x[2..-1]}
25
-
26
- if new_lines.length > 1 then
27
- label + scan_shift(new_lines.join("\n"))
22
+ unless x[/.*/][/^\s*\w+:\w+/] then
23
+ rlines = x.split(/\n/)
24
+ label = [rlines.shift]
25
+ new_lines = rlines.map{|x| x[2..-1]}
26
+
27
+ if new_lines.length > 1 then
28
+ label + scan_shift(new_lines.join("\n"))
29
+ else
30
+ new_lines.length > 0 ? label + [new_lines] : label
31
+ end
28
32
  else
29
- new_lines.length > 0 ? label + [new_lines] : label
33
+ [x]
30
34
  end
31
35
  end
32
36
  end
33
37
 
34
38
  def scan_a(a)
35
39
 
36
- r = a.shift.match(/('[^']+[']|[^\s]+)\s*(\{[^\}]+\})?\s*(.*)/).captures.values_at(0,-1,1)
40
+ r = a.shift.match(/('[^']+[']|[^\s]+)\s*(\{[^\}]+\})?\s*(.*)/m).captures.values_at(0,-1,1)
37
41
 
38
42
  r[-1] = get_attributes(r.last) if r.last
39
43
  a.map {|x| r << scan_a(x.clone) } if a.is_a? Array
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.3.10
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -29,7 +29,7 @@ cert_chain:
29
29
  Dz+jRefuoazkdPPGcZD+mCU2F42iAyY8omZZjf105rpw/tU49czillRb982Rnja1
30
30
  iAgNdWiPNW8ECExJQhYpRbJN0t+PWcMV
31
31
  -----END CERTIFICATE-----
32
- date: 2013-10-03 00:00:00.000000000 Z
32
+ date: 2013-10-05 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rexle
metadata.gz.sig CHANGED
Binary file