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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 699d24e1d89e9d93b3d5dd37feda9ee4c74dd868
4
- data.tar.gz: 9039ca84bd421dc8a8c7d51554dfe4fc715cb53e
3
+ metadata.gz: 0665f1c4662d4210fee1977523b0d67aea964901
4
+ data.tar.gz: d56b78197b8912cd40869a692ea9f38d00d4d0aa
5
5
  SHA512:
6
- metadata.gz: d7d2d7e190256cf14cb906686d6b3f184bece1217d4778730e380cff0f8e2f576b2a23daf86b4728ee1833c295617b6d22e40c0f585830c9e4fa534dd7b2b1e0
7
- data.tar.gz: fb09be7dcd0200acfa0f8d76208731c97d1c0d36455390b49d286f9197f36ef4a45a12202439b8f391aadc0c235dcbe1ff5e435061f166cf33f36948e97b7f79
6
+ metadata.gz: df67277eed2c5692cb4bb2c703d7c212b74c7a70d6b131a6cc248180aca591ee871f1d2a65b208ffb44671e09d45f28e415069b467f2cf0eed63ebe253bd8749
7
+ data.tar.gz: 2968b5febfa65029c32eedec864cfda1b0d7e74f48512a597422f774ddf5fa7681f0b8ecaa6270c507ac654907ef06549605fd54f60dc144504e4ecc92b640d6
@@ -1,5 +1,5 @@
1
1
  module Oreilly
2
2
  module Snippets
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
@@ -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
- replaced = content.gsub( /^#{smallest}/, '' )
84
- replaced
83
+ content.gsub!( /^#{smallest}/, '' ) if smallest
84
+ content
85
85
  end
86
86
 
87
87
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oreilly-snippets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Dawson