lstrip-on-steroids 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -2,9 +2,9 @@ require "rake/gempackagetask"
2
2
 
3
3
  spec = Gem::Specification.new do |s|
4
4
  s.name = "lstrip-on-steroids"
5
- s.version = "1.0.0"
5
+ s.version = "1.0.1"
6
6
  s.authors = ["Caius Durling", "Ash Moran"]
7
- s.email = %w[ dev@caius.name ash.moran@patchspace.co.uk ]
7
+ s.email = %w[dev@caius.name ash.moran@patchspace.co.uk]
8
8
  s.homepage = "http://github.com/caius/lstrip-on-steroids"
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.summary = "Intelligently strips leading whitespace from a multiline string"
@@ -17,7 +17,7 @@ module LStripOnSteroids
17
17
  end
18
18
 
19
19
  def strip_bare_top_and_bottom
20
- [0, -1].each { |i| @lines.delete_at(i) if bare?(@lines[i]) }
20
+ [0, -1].each { |i| @lines.delete_at(i) if @lines[i] && bare?(@lines[i]) }
21
21
  end
22
22
 
23
23
  def indent_size line
@@ -2,6 +2,14 @@ require File.join(File.dirname(__FILE__), "..", "lib", "lstrip_on_steroids")
2
2
 
3
3
  describe String do
4
4
  describe "#-@" do
5
+ it "doesn't alter an empty string" do
6
+ (-"").should eq ""
7
+ end
8
+
9
+ it "removes whitespace from a single line" do
10
+ (-" foo").should eq "foo"
11
+ end
12
+
5
13
  it "removes whitespace" do
6
14
  string = -%{
7
15
  foo
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lstrip-on-steroids
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-08-27 00:00:00.000000000Z
13
+ date: 2011-10-13 00:00:00.000000000Z
14
14
  dependencies: []
15
15
  description:
16
16
  email:
@@ -44,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
44
44
  version: '0'
45
45
  requirements: []
46
46
  rubyforge_project:
47
- rubygems_version: 1.8.9
47
+ rubygems_version: 1.8.11
48
48
  signing_key:
49
49
  specification_version: 3
50
50
  summary: Intelligently strips leading whitespace from a multiline string