placeholder 0.0.3 → 0.0.4

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
data/lib/placeholder.rb CHANGED
@@ -16,7 +16,8 @@ class Placeholder
16
16
  end
17
17
 
18
18
  def to_s
19
- "<img src=\"#{url}\" alt=\"placeholder\" />"
19
+ str = "<img src=\"#{url}\" alt=\"placeholder\" />"
20
+ str.html_safe rescue str #Rails 3 sanitizes our little string.
20
21
  end
21
22
 
22
23
  def url
data/placeholder.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{placeholder}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matt Darby"]
12
- s.date = %q{2010-08-18}
12
+ s.date = %q{2010-08-29}
13
13
  s.description = %q{Easy image placeholders via Placehold.it}
14
14
  s.email = %q{matt@protectedmethod.com}
15
15
  s.extra_rdoc_files = [
@@ -36,4 +36,18 @@ describe "Placeholder" do
36
36
  lambda{ Placeholder.new }.should raise_error
37
37
  end
38
38
 
39
+ context "in Rails 3" do
40
+ before do
41
+ class String
42
+ def html_safe; "safe!" end
43
+ end
44
+ end
45
+
46
+ it "should sanitize :to_s in Rails3" do
47
+ p = Placeholder.new(300)
48
+ p.to_s.should == "safe!"
49
+ end
50
+
51
+ end
52
+
39
53
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: placeholder
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Darby
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-18 00:00:00 -04:00
18
+ date: 2010-08-29 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency