oreilly-snippets 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/oreilly/snippets/version.rb +1 -1
- data/lib/oreilly/snippets.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0665f1c4662d4210fee1977523b0d67aea964901
|
4
|
+
data.tar.gz: d56b78197b8912cd40869a692ea9f38d00d4d0aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df67277eed2c5692cb4bb2c703d7c212b74c7a70d6b131a6cc248180aca591ee871f1d2a65b208ffb44671e09d45f28e415069b467f2cf0eed63ebe253bd8749
|
7
|
+
data.tar.gz: 2968b5febfa65029c32eedec864cfda1b0d7e74f48512a597422f774ddf5fa7681f0b8ecaa6270c507ac654907ef06549605fd54f60dc144504e4ecc92b640d6
|
data/lib/oreilly/snippets.rb
CHANGED
@@ -69,7 +69,7 @@ module Oreilly
|
|
69
69
|
smallest = nil
|
70
70
|
lines = content.split "\n"
|
71
71
|
lines.each do |l|
|
72
|
-
if l =~ /^(\s
|
72
|
+
if l =~ /^(\s*)\S/
|
73
73
|
if smallest
|
74
74
|
if $1.length < smallest.length
|
75
75
|
smallest = $1
|
@@ -80,8 +80,8 @@ module Oreilly
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
|
84
|
-
|
83
|
+
content.gsub!( /^#{smallest}/, '' ) if smallest
|
84
|
+
content
|
85
85
|
end
|
86
86
|
|
87
87
|
|