lorempixel_helper 0.0.1 → 1.0.0
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/lib/lorempixel_helper.rb +1 -1
- data/lib/lorempixel_helper/version.rb +1 -1
- data/lorempixel_helper.gemspec +1 -1
- data/spec/lorempixel_spec.rb +7 -7
- metadata +3 -3
data/lib/lorempixel_helper.rb
CHANGED
@@ -38,7 +38,7 @@ module LorempixelHelper
|
|
38
38
|
|
39
39
|
image_tag = "<img src='#{src}' alt='#{config[:alt]}' height='#{config[:height]}' width='#{config[:width]}'"
|
40
40
|
image_tag += " title='#{config[:title]}'"
|
41
|
-
image_tag += " />"
|
41
|
+
image_tag += " class='lorempixel' />"
|
42
42
|
return image_tag.html_safe if defined?(Rails)
|
43
43
|
image_tag
|
44
44
|
end
|
data/lorempixel_helper.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["prabud@spritle.com"]
|
11
11
|
spec.description = %q{A Rails view images via http://lorempixel.com}
|
12
12
|
spec.summary = %q{A Rails view helper place an images via http://lorempixel.com}
|
13
|
-
spec.homepage = "https://github.com/spritlesoftware/
|
13
|
+
spec.homepage = "https://github.com/spritlesoftware/lorempixel_helper"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
data/spec/lorempixel_spec.rb
CHANGED
@@ -8,30 +8,30 @@ describe LorempixelHelper::ViewHelpers do
|
|
8
8
|
let(:myview) { LorempixelHelperView.new }
|
9
9
|
|
10
10
|
it "should accept a string" do
|
11
|
-
myview.lorempixel_image_tag("400").should == "<img src='http://lorempixel.com/400/400' alt='A lorempixel image' height='400' width='400' title='A lorempixel image' />"
|
11
|
+
myview.lorempixel_image_tag("400").should == "<img src='http://lorempixel.com/400/400' alt='A lorempixel image' height='400' width='400' title='A lorempixel image' class='lorempixel' />"
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should accept a integer" do
|
15
|
-
myview.lorempixel_image_tag(400).should == "<img src='http://lorempixel.com/400/400' alt='A lorempixel image' height='400' width='400' title='A lorempixel image' />"
|
15
|
+
myview.lorempixel_image_tag(400).should == "<img src='http://lorempixel.com/400/400' alt='A lorempixel image' height='400' width='400' title='A lorempixel image' class='lorempixel' />"
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should accept a componded WxH" do
|
19
|
-
myview.lorempixel_image_tag("400x200").should == "<img src='http://lorempixel.com/400/200' alt='A lorempixel image' height='200' width='400' title='A lorempixel image' />"
|
19
|
+
myview.lorempixel_image_tag("400x200").should == "<img src='http://lorempixel.com/400/200' alt='A lorempixel image' height='200' width='400' title='A lorempixel image' class='lorempixel' />"
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should accept category" do
|
23
|
-
myview.lorempixel_image_tag("400", :category=> "sports").should == "<img src='http://lorempixel.com/400/400/sports/' alt='A lorempixel image' height='400' width='400' title='A lorempixel image' />"
|
23
|
+
myview.lorempixel_image_tag("400", :category=> "sports").should == "<img src='http://lorempixel.com/400/400/sports/' alt='A lorempixel image' height='400' width='400' title='A lorempixel image' class='lorempixel' />"
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should accept category with custom text" do
|
27
|
-
myview.lorempixel_image_tag("400x200", :text=> 'Dummy-Text', :category=> "sports").should == "<img src='http://lorempixel.com/400/200/sports/Dummy-Text' alt='Dummy-Text' height='200' width='400' title='Dummy-Text' />"
|
27
|
+
myview.lorempixel_image_tag("400x200", :text=> 'Dummy-Text', :category=> "sports").should == "<img src='http://lorempixel.com/400/200/sports/Dummy-Text' alt='Dummy-Text' height='200' width='400' title='Dummy-Text' class='lorempixel' />"
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should accept selected picture in category" do
|
31
|
-
myview.lorempixel_image_tag("400", :category=> "sports", :item => 2).should == "<img src='http://lorempixel.com/400/400/sports/2/' alt='A lorempixel image' height='400' width='400' title='A lorempixel image' />"
|
31
|
+
myview.lorempixel_image_tag("400", :category=> "sports", :item => 2).should == "<img src='http://lorempixel.com/400/400/sports/2/' alt='A lorempixel image' height='400' width='400' title='A lorempixel image' class='lorempixel' />"
|
32
32
|
end
|
33
33
|
|
34
34
|
it "should accept selected picture in category with custom text" do
|
35
|
-
myview.lorempixel_image_tag("400", :text=> 'Dummy-Text', :category=> "sports", :item => 1).should == "<img src='http://lorempixel.com/400/400/sports/1/Dummy-Text' alt='Dummy-Text' height='400' width='400' title='Dummy-Text' />"
|
35
|
+
myview.lorempixel_image_tag("400", :text=> 'Dummy-Text', :category=> "sports", :item => 1).should == "<img src='http://lorempixel.com/400/400/sports/1/Dummy-Text' alt='Dummy-Text' height='400' width='400' title='Dummy-Text' class='lorempixel' />"
|
36
36
|
end
|
37
37
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lorempixel_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -78,7 +78,7 @@ files:
|
|
78
78
|
- lorempixel_helper.gemspec
|
79
79
|
- spec/lorempixel_spec.rb
|
80
80
|
- spec/spec_helper.rb
|
81
|
-
homepage: https://github.com/spritlesoftware/
|
81
|
+
homepage: https://github.com/spritlesoftware/lorempixel_helper
|
82
82
|
licenses:
|
83
83
|
- MIT
|
84
84
|
post_install_message:
|