placeholdit 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -34,6 +34,10 @@ The same placeholder image with a blue background and red text (not recommended)
34
34
 
35
35
  $ <%= placeholdit_image_tag "500", text: "Buy me!", background_color: '#004eff', text_color: '#ff0000' %>
36
36
 
37
+ Alternatively, calling placeholdit will work as well:
38
+
39
+ $ <%= placeholdit "500" %>
40
+
37
41
 
38
42
  ## Contributing
39
43
 
data/lib/placeholdit.rb CHANGED
@@ -30,6 +30,8 @@ module Placeholdit
30
30
  image_tag
31
31
  end
32
32
 
33
+ alias :placeholdit :placeholdit_image_tag
34
+
33
35
  private
34
36
 
35
37
  def remove_hex_pound(str)
@@ -1,3 +1,3 @@
1
1
  module Placeholdit
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -34,4 +34,8 @@ describe Placeholdit::ViewHelpers do
34
34
  view.placeholdit_image_tag("500", text_color: 'ffffff', background_color: '#000000').should == "<img src='http://placehold.it/500/000000/ffffff' alt='A placeholder image' class='placeholder' height='500' width='500' />"
35
35
  end
36
36
 
37
+ it "should alias to placeholdit" do
38
+ view.placeholdit("500", text_color: 'fff', background_color: '000').should == "<img src='http://placehold.it/500/000/fff' alt='A placeholder image' class='placeholder' height='500' width='500' />"
39
+ end
40
+
37
41
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: placeholdit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
17
- requirement: &70257118635060 !ruby/object:Gem::Requirement
17
+ requirement: &70319125584760 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *70257118635060
25
+ version_requirements: *70319125584760
26
26
  description: A Rails view helper for placeholder images via http://placehold.it
27
27
  email:
28
28
  - jeffmehlhoff@mac.com