placeholdit 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.
- checksums.yaml +7 -0
- data/README.md +5 -1
- data/lib/placeholdit.rb +1 -0
- data/lib/placeholdit/version.rb +1 -1
- data/spec/placeholdit_spec.rb +4 -0
- metadata +10 -14
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d995bc0cd38db56cc02393131754c7a15f5811de
|
4
|
+
data.tar.gz: ae8ae72ec82d8dae9a1312fb7c68bdb9b174f9f2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4c823b5f785c48901c3c0e3b76cc56580ea84036a38815b05acd2a18200a1e942696fd48de86793806009accace475fcbbc7f06c2cc655817eb009e7dbada109
|
7
|
+
data.tar.gz: 60c055c4d74a0d547e425940c032c3dd61fdb8b8473325b4107f74fb92ecef1b2d9cd8f3bb07e16530b2587c66afa2732639f095c1c870a4cd2c63f025315e70
|
data/README.md
CHANGED
@@ -20,7 +20,11 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
A basic 500x500 placeholder image:
|
22
22
|
|
23
|
-
<%= placeholdit_image_tag "
|
23
|
+
<%= placeholdit_image_tag "500x500" %>
|
24
|
+
|
25
|
+
A basic 250 width 500 height placeholder image”
|
26
|
+
|
27
|
+
<%= placeholdit_image_tag "250x500" %>
|
24
28
|
|
25
29
|
The same placeholder image with custom text:
|
26
30
|
|
data/lib/placeholdit.rb
CHANGED
@@ -28,6 +28,7 @@ module Placeholdit
|
|
28
28
|
|
29
29
|
image_tag = "<img src='#{src}' alt='#{config[:alt]}' class='#{config[:class]}' height='#{config[:height]}' width='#{config[:width]}'"
|
30
30
|
image_tag += " title='#{config[:title]}'" if config[:title]
|
31
|
+
image_tag += " style='#{config[:style]}'" if config[:style]
|
31
32
|
image_tag += " />"
|
32
33
|
return image_tag.html_safe if defined?(Rails)
|
33
34
|
image_tag
|
data/lib/placeholdit/version.rb
CHANGED
data/spec/placeholdit_spec.rb
CHANGED
@@ -42,4 +42,8 @@ describe Placeholdit::ViewHelpers do
|
|
42
42
|
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' />"
|
43
43
|
end
|
44
44
|
|
45
|
+
it "should accept style" do
|
46
|
+
view.placeholdit_image_tag("500", style: "float:right;").should == "<img src='http://placehold.it/500' alt='A placeholder image' class='placeholder' height='500' width='500' style='float:right;' />"
|
47
|
+
end
|
48
|
+
|
45
49
|
end
|
metadata
CHANGED
@@ -1,30 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: placeholdit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jeff Mehlhoff
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-01-06 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rspec
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
description: A Rails view helper for placeholder images via http://placehold.it
|
@@ -34,7 +31,7 @@ executables: []
|
|
34
31
|
extensions: []
|
35
32
|
extra_rdoc_files: []
|
36
33
|
files:
|
37
|
-
- .gitignore
|
34
|
+
- ".gitignore"
|
38
35
|
- Gemfile
|
39
36
|
- LICENSE
|
40
37
|
- README.md
|
@@ -47,27 +44,26 @@ files:
|
|
47
44
|
- spec/spec_helper.rb
|
48
45
|
homepage: http://github.com/ohokay/placeholdit
|
49
46
|
licenses: []
|
47
|
+
metadata: {}
|
50
48
|
post_install_message:
|
51
49
|
rdoc_options: []
|
52
50
|
require_paths:
|
53
51
|
- lib
|
54
52
|
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
-
none: false
|
56
53
|
requirements:
|
57
|
-
- -
|
54
|
+
- - ">="
|
58
55
|
- !ruby/object:Gem::Version
|
59
56
|
version: '0'
|
60
57
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
-
none: false
|
62
58
|
requirements:
|
63
|
-
- -
|
59
|
+
- - ">="
|
64
60
|
- !ruby/object:Gem::Version
|
65
61
|
version: '0'
|
66
62
|
requirements: []
|
67
63
|
rubyforge_project:
|
68
|
-
rubygems_version:
|
64
|
+
rubygems_version: 2.4.2
|
69
65
|
signing_key:
|
70
|
-
specification_version:
|
66
|
+
specification_version: 4
|
71
67
|
summary: A Rails view helper for placeholder images via http://placehold.it
|
72
68
|
test_files:
|
73
69
|
- spec/placeholdit_spec.rb
|