placeholder 0.0.5 → 0.0.6
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/README.markdown +1 -1
 - data/VERSION +1 -1
 - data/lib/placeholder.rb +3 -3
 - data/placeholder.gemspec +1 -1
 - data/spec/placeholder_spec.rb +2 -2
 - metadata +3 -3
 
    
        data/README.markdown
    CHANGED
    
    | 
         @@ -30,7 +30,7 @@ If you just need a square image, simply do: 
     | 
|
| 
       30 
30 
     | 
    
         | 
| 
       31 
31 
     | 
    
         
             
            You can also pass CSS classes and an ID if you'd like:
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
       33 
     | 
    
         
            -
            `= Placeholder.new(80, : 
     | 
| 
      
 33 
     | 
    
         
            +
            `= Placeholder.new(80, :id => "gravatar", :class => "active admin")`
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
       35 
35 
     | 
    
         
             
            About the Author
         
     | 
| 
       36 
36 
     | 
    
         
             
            ----------------
         
     | 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            0.0. 
     | 
| 
      
 1 
     | 
    
         
            +
            0.0.6
         
     | 
    
        data/lib/placeholder.rb
    CHANGED
    
    | 
         @@ -1,6 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            class Placeholder
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
              attr_accessor :height, :width, :bg_color, :fg_color, :text, : 
     | 
| 
      
 3 
     | 
    
         
            +
              attr_accessor :height, :width, :bg_color, :fg_color, :text, :class, :id
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
              def initialize(size, options = {})
         
     | 
| 
       6 
6 
     | 
    
         
             
                measure(size)
         
     | 
| 
         @@ -46,8 +46,8 @@ class Placeholder 
     | 
|
| 
       46 
46 
     | 
    
         | 
| 
       47 
47 
     | 
    
         
             
              def css_stuff
         
     | 
| 
       48 
48 
     | 
    
         
             
                str = ""
         
     | 
| 
       49 
     | 
    
         
            -
                str += "class=\"#{@ 
     | 
| 
       50 
     | 
    
         
            -
                str += "id=\"#{@ 
     | 
| 
      
 49 
     | 
    
         
            +
                str += "class=\"#{@class}\"" unless @class.nil?
         
     | 
| 
      
 50 
     | 
    
         
            +
                str += "id=\"#{@id}\"" unless @id.nil?
         
     | 
| 
       51 
51 
     | 
    
         
             
                str
         
     | 
| 
       52 
52 
     | 
    
         
             
              end
         
     | 
| 
       53 
53 
     | 
    
         | 
    
        data/placeholder.gemspec
    CHANGED
    
    
    
        data/spec/placeholder_spec.rb
    CHANGED
    
    | 
         @@ -37,12 +37,12 @@ describe "Placeholder" do 
     | 
|
| 
       37 
37 
     | 
    
         
             
              end
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
              it "should allow css_classes" do
         
     | 
| 
       40 
     | 
    
         
            -
                p = Placeholder.new(300, : 
     | 
| 
      
 40 
     | 
    
         
            +
                p = Placeholder.new(300, :class => "c1 c2")
         
     | 
| 
       41 
41 
     | 
    
         
             
                p.to_s.should == "<img src=\"http://placehold.it/300x300\" alt=\"placeholder\" class=\"c1 c2\" />"
         
     | 
| 
       42 
42 
     | 
    
         
             
              end
         
     | 
| 
       43 
43 
     | 
    
         | 
| 
       44 
44 
     | 
    
         
             
              it "should allow css_id" do
         
     | 
| 
       45 
     | 
    
         
            -
                p = Placeholder.new(300, : 
     | 
| 
      
 45 
     | 
    
         
            +
                p = Placeholder.new(300, :id => "gravatar")
         
     | 
| 
       46 
46 
     | 
    
         
             
                p.to_s.should == "<img src=\"http://placehold.it/300x300\" alt=\"placeholder\" id=\"gravatar\" />"
         
     | 
| 
       47 
47 
     | 
    
         
             
              end
         
     | 
| 
       48 
48 
     | 
    
         | 
    
        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:  
     | 
| 
      
 4 
     | 
    
         
            +
              hash: 19
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       6 
6 
     | 
    
         
             
              segments: 
         
     | 
| 
       7 
7 
     | 
    
         
             
              - 0
         
     | 
| 
       8 
8 
     | 
    
         
             
              - 0
         
     | 
| 
       9 
     | 
    
         
            -
              -  
     | 
| 
       10 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 9 
     | 
    
         
            +
              - 6
         
     | 
| 
      
 10 
     | 
    
         
            +
              version: 0.0.6
         
     | 
| 
       11 
11 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       12 
12 
     | 
    
         
             
            authors: 
         
     | 
| 
       13 
13 
     | 
    
         
             
            - Matt Darby
         
     |