line-tree 0.4.2 → 0.4.3

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: 35f9480caccfa3233e3a6ec2b2dbaab3c5ddf8bd
4
- data.tar.gz: 7fb35339a544a9413078fb85bdf2bd954c0d7807
3
+ metadata.gz: c01443853dcb5372988684e8fb1d566eecc1214d
4
+ data.tar.gz: 3867f0dac52376ee8ecdea47599125e9cb7a99f1
5
5
  SHA512:
6
- metadata.gz: e104d6a9b7bbbe3adeffb64b53efdcb8b92c4978fd7a69d4bb84785b09804d98c36183730495f7a7a433d7e474946a7c2bf46c23f757304bcebd0652e4dde090
7
- data.tar.gz: 8001ecb0b9d7b29818a03e394603a89bde65fdd0e81cf3196e1f78d9a22de947b08b8a6b2632fc6e8145763d6d7b520287833f2b59dbc534b50c6b9911f2007e
6
+ metadata.gz: 2a8c21bf472453012824922035047a9f115ad85f2fa35c3e83d22b93081db7f36d664f292a9918dabb3e15b29846c7698b77f103484595fe4accca763830432e
7
+ data.tar.gz: 2bd4441e5711798eeb5c9a4fc93b2c2ee121035c2098bb6c4cff3d59e33290ef3a8012ab5cbc79aa141b2b4aaece473ff60c90428349504849f067e57e1c3633
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/line-tree.rb CHANGED
@@ -30,27 +30,19 @@ class LineTree
30
30
  a.map do |x|
31
31
 
32
32
  unless x[/.*/][/^\s*\w+:\S+/] then
33
+
33
34
  rlines = x.split(/\n/)
35
+ rlines = [x] if level and level < 0
36
+
34
37
  label = [rlines.shift]
35
38
  new_lines = rlines.map{|x| x[2..-1]}
36
39
 
37
40
  if new_lines.length > 1 then
38
-
39
- if level then
40
-
41
- if level < 1 then
42
-
43
- [(label + new_lines).join("\n")]
44
- else
45
- label + scan_shift(new_lines.join("\n"),level)
46
- end
47
- else
48
- label + scan_shift(new_lines.join("\n"),level)
49
- end
50
-
51
- else
52
- new_lines.length > 0 ? label + [new_lines] : label
41
+ label + scan_shift(new_lines.join("\n"),level)
42
+ else
43
+ new_lines.length > 0 ? label + [new_lines] : label
53
44
  end
45
+
54
46
  else
55
47
  [x.lines.map{|x| x.sub(/^\s{2}/,'')}.join]
56
48
  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.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  ErtlSTAImlBCK8q5BS4jBBt8VAEpNdkWpWbtDtLPA639pW2QWIcPx13ObWJh7Ejk
32
32
  THoVqqsHTfeg3g==
33
33
  -----END CERTIFICATE-----
34
- date: 2014-12-04 00:00:00.000000000 Z
34
+ date: 2014-12-21 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rexle
metadata.gz.sig CHANGED
Binary file