responsive_image_tag 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +28 -34
- data/VERSION +1 -1
- data/lib/generators/responsive_image_tag/padrino_rit.rb +33 -0
- data/lib/generators/responsive_image_tag/templates/responsive-image-tag-jquery.js +7 -7
- data/lib/generators/responsive_image_tag/templates/responsive-image-tag-prototype.js +9 -9
- data/lib/responsive_image_tag.rb +18 -8
- data/responsive_image_tag.gemspec +9 -8
- data/test/test_responsive_image_tag.rb +36 -18
- metadata +75 -110
data/README.rdoc
CHANGED
@@ -2,12 +2,22 @@
|
|
2
2
|
|
3
3
|
== Creating responsive images
|
4
4
|
|
5
|
-
|
6
|
-
the current device. The @screen.width@ is detected by javascript and then an
|
7
|
-
image element is inserted in the page with a dynamically created @src@
|
8
|
-
attribute.
|
5
|
+
It's quite common today for web sites to be viewed on a wide range of devices, from powerful desktop workstations with huge screen resolutions and plenty of bandwidth, to tiny resource-constrained mobile devices. Serving images to this wide range of clients becomes an issue: if you make your images large, you'll severely degrade performance on mobile phones, but if you make your images small, they'll look terrible to desktop users.
|
9
6
|
|
10
|
-
|
7
|
+
Wouldn't it be nice if you could serve small images to mobile clients, and large images to desktop clients? The HTML spec doesn't really allow for device-specific asset serving, but it can be done with a little dash of cleverness. The technique used here allows you to serve device-specific images, and not make two server requests (saving bandwidth and server load).
|
8
|
+
|
9
|
+
We've packaged it up as a rubygem.
|
10
|
+
|
11
|
+
responsive_image_tag is a Rails helper which selects an image depending on the width of the current device. The <tt>screen.width</tt> is detected by javascript and then an image element is inserted in the page with a dynamically created <tt>src</tt> attribute.
|
12
|
+
|
13
|
+
It works with Rails 2 and Rails 3, and there are javascript adapters for both jQuery and Prototype. Pick your poison.
|
14
|
+
|
15
|
+
== Motivation and approach
|
16
|
+
|
17
|
+
You can find out what problems we're trying to solve with this code by reading
|
18
|
+
the blog post about it here[http://headlondon.com/our-thoughts/technology/posts/creating-responsive-images-using-the-noscript-tag].
|
19
|
+
|
20
|
+
Although this is packaged as a ruby gem, the approach is generally valid across platforms, and as a bonus, it is accessible - screenreaders and web crawlers will see the content of the <noscript> tag, and parse the content quite happily.
|
11
21
|
|
12
22
|
== HTML structure
|
13
23
|
|
@@ -18,33 +28,17 @@ Here's the HTML which the helper inserts into the page:
|
|
18
28
|
<img src="big.jpg">
|
19
29
|
</noscript>
|
20
30
|
|
21
|
-
The responsive images have to appear for non-javascript users as well as
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
DOM, so deleting the <noscript> prevents an HTTP request being made to the
|
33
|
-
server. This way only the image being requested by the dynamically inserted image tag is making a request.
|
34
|
-
|
35
|
-
To insert the dynamically created image element into the page you need a
|
36
|
-
parent element in the DOM to append to. The rails helper also creates a
|
37
|
-
<span> tag with a class of "img-placeholder" to house the new image.
|
38
|
-
|
39
|
-
When the DOM is ready the javascript object responsiveImageTag detects
|
40
|
-
all <noscript> elements on the page with a class of "responsivize".
|
41
|
-
|
42
|
-
It retrieves the HTML5 data attributes (@data-mobilesrc@, @data-fullsrc@, and
|
43
|
-
@data-alttext@) and then creates an image tag with the correct source
|
44
|
-
depending on the available screen width of the users device. Any device
|
45
|
-
smaller than 768px is considered to be a mobile device. The library
|
46
|
-
inserts the new element into the page and the <noscript> tags are then hidden
|
47
|
-
from view.
|
31
|
+
The responsive images have to appear for non-javascript users as well as those with javascript turned on.
|
32
|
+
|
33
|
+
To achieve this the helper places the default image inside a <noscript> tag which is then deleted by the javascript library. The image attributes such as full size, mobile size and alt text are also stored as HTML5 data attributes on the <noscript> tag so they are available in the DOM for the javascript to access.
|
34
|
+
|
35
|
+
The library relies on a trick which has all the elegance of a greasy late-night kebab: child elements of the <noscript> tag are not added to the DOM, so deleting the <noscript> prevents an HTTP request being made to the server. This way only the image being requested by the dynamically inserted image tag is making a request.
|
36
|
+
|
37
|
+
To insert the dynamically created image element into the page you need a parent element in the DOM to append to. The rails helper also creates a <span> tag with a class of "img-placeholder" to house the new image.
|
38
|
+
|
39
|
+
When the DOM is ready the javascript object responsiveImageTag detects all <noscript> elements on the page with a class of "responsivize".
|
40
|
+
|
41
|
+
It retrieves the HTML5 data attributes (<tt>data-mobilesrc</tt>, <tt>data-fullsrc</tt>, and <tt>data-alttext</tt>) and then creates an image tag with the correct source depending on the available screen width of the users device. Any device smaller than 768px is considered to be a mobile device. The library inserts the new element into the page and the <noscript> tags are then hidden from view.
|
48
42
|
|
49
43
|
== Installation
|
50
44
|
|
@@ -56,7 +50,7 @@ Then install it:
|
|
56
50
|
|
57
51
|
bundle install
|
58
52
|
|
59
|
-
There's a generator which copies a JavaScript file into place in
|
53
|
+
There's a generator which copies a JavaScript file into place in <tt>public/javascripts</tt>.
|
60
54
|
|
61
55
|
You can run it like this:
|
62
56
|
|
@@ -67,7 +61,7 @@ You can run it like this:
|
|
67
61
|
|
68
62
|
or
|
69
63
|
|
70
|
-
rails g responsive_image_tag:prototype
|
64
|
+
rails g responsive_image_tag:prototype
|
71
65
|
|
72
66
|
=== Rails 2
|
73
67
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.6
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Padrino
|
2
|
+
module Generators
|
3
|
+
##
|
4
|
+
# Defines the generator for installing the Jquery Responsive Image Tag script.
|
5
|
+
#
|
6
|
+
class Rit < Thor::Group
|
7
|
+
|
8
|
+
# Add this generator to our padrino-gen
|
9
|
+
Padrino::Generators.add_generator(:rit, self)
|
10
|
+
|
11
|
+
# Define the source template root and themes.
|
12
|
+
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
|
13
|
+
# Defines the "banner" text for the CLI.
|
14
|
+
def self.banner; "padrino g rit"; end
|
15
|
+
|
16
|
+
# Include related modules
|
17
|
+
include Thor::Actions
|
18
|
+
include Padrino::Generators::Actions
|
19
|
+
include Padrino::Generators::Admin::Actions
|
20
|
+
|
21
|
+
desc "Description:\n\n\tpadrino g rit - Creates a JavaScript file which takes care of responsive images for you"
|
22
|
+
|
23
|
+
class_option :js_destination, :aliases => "-d", :desc => "The destination path to copy the Javascript file too", :default => 'public/javascripts', :type => :string
|
24
|
+
class_option :js_type, :aliases => "-t", :desc => "The type of Javascript file to use [jquery or prototype]", :default => 'jquery', :type => :string
|
25
|
+
|
26
|
+
def create_javascript_file
|
27
|
+
template "templates/responsive-image-tag-#{options[:js_type]}.js",
|
28
|
+
destination_root(options[:js_destination] + "/responsive-image-tag-#{options[:js_type]}.js")
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -7,20 +7,20 @@
|
|
7
7
|
// It retrieves both HTML5 data attributes and then creates an image tag with
|
8
8
|
// the correct source destination depending on the available screen width of
|
9
9
|
// the user's device. This way smaller images are sent to mobile devices or
|
10
|
-
// any device smaller than 768px.
|
10
|
+
// any device smaller than 768px.
|
11
11
|
|
12
12
|
// The <noscript> tags are then removed from the page.
|
13
13
|
var responsiveImageTag = {
|
14
|
-
|
14
|
+
|
15
15
|
replaceInitialImages:function() {
|
16
16
|
var platform = "desktop";
|
17
17
|
var responsiveImages = $(".responsivize");
|
18
|
-
var i,
|
18
|
+
var i,
|
19
19
|
noOfresponsiveImages = responsiveImages.length;
|
20
20
|
|
21
21
|
// Test for available width in current browser window
|
22
22
|
// 767px, anything smaller than an ipad is considered mobile
|
23
|
-
if(screen.width <= 767){
|
23
|
+
if(screen.width <= 767){
|
24
24
|
platform = "mobile";
|
25
25
|
}
|
26
26
|
|
@@ -30,6 +30,7 @@ var responsiveImageTag = {
|
|
30
30
|
var img = window.document.createElement("img");
|
31
31
|
|
32
32
|
img.alt = noScriptElem.attr("data-alttext");
|
33
|
+
img.className = noScriptElem.attr("data-cssclass");
|
33
34
|
|
34
35
|
if(platform === "mobile"){
|
35
36
|
img.src = noScriptElem.attr("data-mobilesrc");
|
@@ -37,8 +38,7 @@ var responsiveImageTag = {
|
|
37
38
|
img.src = noScriptElem.attr("data-fullsrc");
|
38
39
|
}
|
39
40
|
|
40
|
-
img
|
41
|
-
noScriptElem.prev().append(img);
|
41
|
+
noScriptElem.prev().append(img);
|
42
42
|
noScriptElem.hide();
|
43
43
|
}
|
44
44
|
}
|
@@ -47,4 +47,4 @@ var responsiveImageTag = {
|
|
47
47
|
$(function() {
|
48
48
|
responsiveImageTag.replaceInitialImages();
|
49
49
|
});
|
50
|
-
|
50
|
+
|
@@ -1,26 +1,26 @@
|
|
1
1
|
/*jslint browser:true */
|
2
2
|
/*global $, $$*/
|
3
3
|
|
4
|
-
// responsiveImageTag detects all noscript elements on the page with a class
|
4
|
+
// responsiveImageTag detects all noscript elements on the page with a class
|
5
5
|
// of 'responsivize'.
|
6
6
|
|
7
7
|
// It retrieves both HTML5 data attributes and then creates an image tag with
|
8
|
-
// the correct source destination depending on the available screen width of
|
8
|
+
// the correct source destination depending on the available screen width of
|
9
9
|
// the user'ss device. This way smaller images are sent to mobile devices or
|
10
|
-
// any device smaller than 768px.
|
10
|
+
// any device smaller than 768px.
|
11
11
|
|
12
12
|
// The <noscript> tags are then removed from the page.
|
13
13
|
var responsiveImageTag = {
|
14
|
-
|
14
|
+
|
15
15
|
replaceInitialImages:function() {
|
16
16
|
var platform = "desktop";
|
17
17
|
var responsiveImages = $$(".responsivize");
|
18
|
-
var i,
|
18
|
+
var i,
|
19
19
|
noOfresponsiveImages = responsiveImages.length;
|
20
20
|
|
21
21
|
// Test for available width in current browser window
|
22
|
-
// 767px, anything smaller than an ipad is considered mobile
|
23
|
-
if(screen.width <= 767){
|
22
|
+
// 767px, anything smaller than an ipad is considered mobile
|
23
|
+
if(screen.width <= 767){
|
24
24
|
platform = "mobile";
|
25
25
|
}
|
26
26
|
|
@@ -30,6 +30,7 @@ var responsiveImageTag = {
|
|
30
30
|
var img = window.document.createElement("img");
|
31
31
|
|
32
32
|
img.alt = noScriptElem.getAttribute("data-alttext");
|
33
|
+
img.className = noScriptElem.getAttribute("data-cssclass");
|
33
34
|
|
34
35
|
if(platform === "mobile"){
|
35
36
|
img.src = noScriptElem.getAttribute("data-mobilesrc");
|
@@ -37,8 +38,7 @@ var responsiveImageTag = {
|
|
37
38
|
img.src = noScriptElem.getAttribute("data-fullsrc");
|
38
39
|
}
|
39
40
|
|
40
|
-
img
|
41
|
-
noScriptElem.previous().appendChild(img);
|
41
|
+
noScriptElem.previous().appendChild(img);
|
42
42
|
noScriptElem.style.display = "none";
|
43
43
|
}
|
44
44
|
}
|
data/lib/responsive_image_tag.rb
CHANGED
@@ -1,5 +1,14 @@
|
|
1
|
+
begin
|
2
|
+
require 'padrino-gen'
|
3
|
+
# debugger
|
4
|
+
Padrino::Generators.load_paths << Dir[File.dirname(__FILE__) + '/generators/responsive_image_tag/padrino_rit.rb']
|
5
|
+
rescue LoadError
|
6
|
+
# Fail silently
|
7
|
+
puts "Error"
|
8
|
+
end
|
9
|
+
|
1
10
|
module ResponsiveImageTag
|
2
|
-
|
11
|
+
|
3
12
|
# Emits the special (and somewhat ugly) markup for our responsive image
|
4
13
|
# tag.
|
5
14
|
#
|
@@ -9,26 +18,27 @@ module ResponsiveImageTag
|
|
9
18
|
def responsive_image_tag(small, big, options = {})
|
10
19
|
output = tag "span", {:class => "img-placeholder"}
|
11
20
|
output += tag "/span", nil, true
|
12
|
-
output += tag "noscript", noscript_attributes(small, big, options), true
|
21
|
+
output += tag "noscript", noscript_attributes(small, big, options), true
|
13
22
|
output += image_tag(big, options)
|
14
23
|
output += tag "/noscript", nil, true
|
15
24
|
output
|
16
25
|
end
|
17
|
-
|
18
|
-
private
|
19
|
-
|
26
|
+
|
27
|
+
private
|
28
|
+
|
20
29
|
def noscript_attributes(small, big, options)
|
21
30
|
attrs = {
|
22
31
|
"data-fullsrc" => image_path(big),
|
23
32
|
"data-mobilesrc" => image_path(small),
|
24
33
|
:class => "responsivize"
|
25
34
|
}
|
26
|
-
unless options.nil? || options == {}
|
27
|
-
attrs.merge!("data-alttext" => options[:alt])
|
35
|
+
unless options.nil? || options == {}
|
36
|
+
attrs.merge!("data-alttext" => options[:alt]) unless options[:alt].nil?
|
37
|
+
attrs.merge!("data-cssclass" => options[:class]) unless options[:class].nil?
|
28
38
|
end
|
29
39
|
attrs
|
30
40
|
end
|
31
|
-
|
41
|
+
|
32
42
|
end
|
33
43
|
|
34
44
|
ActionView::Base.send(:include, ResponsiveImageTag) if defined?(ActionView::Base)
|
@@ -4,14 +4,14 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.2.
|
7
|
+
s.name = "responsive_image_tag"
|
8
|
+
s.version = "0.2.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dave Hrycyszyn"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
12
|
+
s.date = "2012-10-02"
|
13
|
+
s.description = "Allows you to specify two images in a responsive_image_tag, and includes a javascript generator which will rewrite the DOM, requesting the correct image based on the screen size of the current client device."
|
14
|
+
s.email = "dave.hrycyszyn@headlondon.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
17
|
"README.rdoc"
|
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
"generators/responsive_image_tag/prototype_responsive_image_tag_generator.rb",
|
29
29
|
"generators/responsive_image_tag/templates/README",
|
30
30
|
"lib/generators/responsive_image_tag/jquery_generator.rb",
|
31
|
+
"lib/generators/responsive_image_tag/padrino_rit.rb",
|
31
32
|
"lib/generators/responsive_image_tag/prototype_generator.rb",
|
32
33
|
"lib/generators/responsive_image_tag/templates/responsive-image-tag-jquery.js",
|
33
34
|
"lib/generators/responsive_image_tag/templates/responsive-image-tag-prototype.js",
|
@@ -36,11 +37,11 @@ Gem::Specification.new do |s|
|
|
36
37
|
"test/helper.rb",
|
37
38
|
"test/test_responsive_image_tag.rb"
|
38
39
|
]
|
39
|
-
s.homepage =
|
40
|
+
s.homepage = "http://github.com/futurechimp/responsive_image_tag"
|
40
41
|
s.licenses = ["MIT"]
|
41
42
|
s.require_paths = ["lib"]
|
42
|
-
s.rubygems_version =
|
43
|
-
s.summary =
|
43
|
+
s.rubygems_version = "1.8.17"
|
44
|
+
s.summary = "DO NOT USE THIS YET! Helps you insert responsive images into your views"
|
44
45
|
|
45
46
|
if s.respond_to? :specification_version then
|
46
47
|
s.specification_version = 3
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'helper'
|
2
2
|
|
3
3
|
class TestResponsiveImageTag < MiniTest::Unit::TestCase
|
4
|
-
|
4
|
+
|
5
5
|
describe "A responsive_image_tag" do
|
6
6
|
describe "in rails" do
|
7
7
|
before do
|
@@ -11,11 +11,11 @@ class TestResponsiveImageTag < MiniTest::Unit::TestCase
|
|
11
11
|
@tag = view.responsive_image_tag("small.jpg", "big.jpg")
|
12
12
|
@doc = Nokogiri::HTML.fragment(@tag)
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
it "should write in one <span>" do
|
16
16
|
assert_equal 1, @doc.xpath('span').length
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
it "should put a img-placeholder class on the <span>" do
|
20
20
|
span_class = @doc.xpath('span').first.attributes["class"]
|
21
21
|
assert_equal "img-placeholder", span_class.value
|
@@ -40,41 +40,41 @@ class TestResponsiveImageTag < MiniTest::Unit::TestCase
|
|
40
40
|
it "should use big.jpg as the value for full-src" do
|
41
41
|
@tag.must_match "data-fullsrc=\"/images/big.jpg\""
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
describe "the noscript tag" do
|
45
45
|
before do
|
46
46
|
@noscript = @doc.xpath("noscript").first
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
it "should exist, once" do
|
50
50
|
assert_equal(1, @doc.xpath("noscript").length)
|
51
51
|
end
|
52
|
-
|
52
|
+
|
53
53
|
it "should have a data-fullsrc attribute" do
|
54
54
|
assert @noscript.attributes["data-fullsrc"]
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
it "should point data-fullsrc at the big image" do
|
58
58
|
assert_equal "/images/big.jpg",
|
59
59
|
@noscript.attributes["data-fullsrc"].value
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
it "should have a data-mobilesrc attribute" do
|
63
63
|
assert @noscript.attributes["data-mobilesrc"]
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
66
|
it "should point data-mobilesrc at the small image" do
|
67
67
|
assert_equal "/images/small.jpg",
|
68
68
|
@noscript.attributes["data-mobilesrc"].value
|
69
69
|
end
|
70
|
-
|
70
|
+
|
71
71
|
it "should put the 'responsivize' class on the <noscript> tag" do
|
72
72
|
assert @noscript.attributes["class"]
|
73
73
|
assert @noscript.attributes["class"].value = "responsivize"
|
74
74
|
end
|
75
|
-
|
76
|
-
end
|
77
|
-
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
78
|
describe "with an :alt option specified" do
|
79
79
|
before do
|
80
80
|
view = ActionView::Base.new
|
@@ -82,19 +82,37 @@ class TestResponsiveImageTag < MiniTest::Unit::TestCase
|
|
82
82
|
"small.jpg", "big.jpg", :alt => "foo")
|
83
83
|
@doc = Nokogiri::HTML.fragment(@tag)
|
84
84
|
end
|
85
|
-
|
85
|
+
|
86
86
|
it "should put an :alt attribute on the <noscript> tag" do
|
87
87
|
noscript = @doc.xpath("noscript").first
|
88
88
|
assert noscript.attributes["data-alttext"]
|
89
89
|
end
|
90
|
-
|
90
|
+
|
91
91
|
it "should put a value of 'foo' into the :alt" do
|
92
92
|
noscript = @doc.xpath("noscript").first
|
93
93
|
assert_equal "foo", noscript.attributes["data-alttext"].value
|
94
|
-
end
|
95
|
-
|
94
|
+
end
|
96
95
|
end
|
97
|
-
|
96
|
+
|
97
|
+
describe "with an :class option specified" do
|
98
|
+
before do
|
99
|
+
view = ActionView::Base.new
|
100
|
+
@tag = view.responsive_image_tag(
|
101
|
+
"small.jpg", "big.jpg", :class => "foo")
|
102
|
+
@doc = Nokogiri::HTML.fragment(@tag)
|
103
|
+
end
|
104
|
+
|
105
|
+
it "should put an :alt attribute on the <noscript> tag" do
|
106
|
+
noscript = @doc.xpath("noscript").first
|
107
|
+
assert noscript.attributes["data-cssclass"]
|
108
|
+
end
|
109
|
+
|
110
|
+
it "should put a value of 'foo' into the :class" do
|
111
|
+
noscript = @doc.xpath("noscript").first
|
112
|
+
assert_equal "foo", noscript.attributes["data-cssclass"].value
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
98
116
|
end
|
99
117
|
end
|
100
118
|
end
|
metadata
CHANGED
@@ -1,121 +1,92 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: responsive_image_tag
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.6
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 5
|
10
|
-
version: 0.2.5
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Dave Hrycyszyn
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
22
|
-
type: :development
|
23
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
24
|
-
none: false
|
25
|
-
requirements:
|
26
|
-
- - ">="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 3
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
version: "0"
|
32
|
-
requirement: *id001
|
33
|
-
prerelease: false
|
12
|
+
date: 2012-10-02 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
34
15
|
name: minitest
|
35
|
-
|
16
|
+
requirement: &2169114280 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
36
22
|
type: :development
|
37
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2169114280
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: bundler
|
27
|
+
requirement: &2169113760 !ruby/object:Gem::Requirement
|
38
28
|
none: false
|
39
|
-
requirements:
|
29
|
+
requirements:
|
40
30
|
- - ~>
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
hash: 23
|
43
|
-
segments:
|
44
|
-
- 1
|
45
|
-
- 0
|
46
|
-
- 0
|
31
|
+
- !ruby/object:Gem::Version
|
47
32
|
version: 1.0.0
|
48
|
-
requirement: *id002
|
49
|
-
prerelease: false
|
50
|
-
name: bundler
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
33
|
type: :development
|
53
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *2169113760
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: jeweler
|
38
|
+
requirement: &2169113240 !ruby/object:Gem::Requirement
|
54
39
|
none: false
|
55
|
-
requirements:
|
40
|
+
requirements:
|
56
41
|
- - ~>
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
hash: 7
|
59
|
-
segments:
|
60
|
-
- 1
|
61
|
-
- 6
|
62
|
-
- 4
|
42
|
+
- !ruby/object:Gem::Version
|
63
43
|
version: 1.6.4
|
64
|
-
requirement: *id003
|
65
|
-
prerelease: false
|
66
|
-
name: jeweler
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
44
|
type: :development
|
69
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
70
|
-
none: false
|
71
|
-
requirements:
|
72
|
-
- - ">="
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
hash: 3
|
75
|
-
segments:
|
76
|
-
- 0
|
77
|
-
version: "0"
|
78
|
-
requirement: *id004
|
79
45
|
prerelease: false
|
46
|
+
version_requirements: *2169113240
|
47
|
+
- !ruby/object:Gem::Dependency
|
80
48
|
name: rcov
|
81
|
-
|
82
|
-
type: :development
|
83
|
-
version_requirements: &id005 !ruby/object:Gem::Requirement
|
49
|
+
requirement: &2169112420 !ruby/object:Gem::Requirement
|
84
50
|
none: false
|
85
|
-
requirements:
|
86
|
-
- -
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
|
89
|
-
|
90
|
-
- 0
|
91
|
-
version: "0"
|
92
|
-
requirement: *id005
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
93
56
|
prerelease: false
|
57
|
+
version_requirements: *2169112420
|
58
|
+
- !ruby/object:Gem::Dependency
|
94
59
|
name: actionpack
|
95
|
-
|
96
|
-
type: :development
|
97
|
-
version_requirements: &id006 !ruby/object:Gem::Requirement
|
60
|
+
requirement: &2169109680 !ruby/object:Gem::Requirement
|
98
61
|
none: false
|
99
|
-
requirements:
|
100
|
-
- -
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
|
103
|
-
|
104
|
-
- 0
|
105
|
-
version: "0"
|
106
|
-
requirement: *id006
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
107
67
|
prerelease: false
|
68
|
+
version_requirements: *2169109680
|
69
|
+
- !ruby/object:Gem::Dependency
|
108
70
|
name: nokogiri
|
109
|
-
|
71
|
+
requirement: &2169108780 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *2169108780
|
80
|
+
description: Allows you to specify two images in a responsive_image_tag, and includes
|
81
|
+
a javascript generator which will rewrite the DOM, requesting the correct image
|
82
|
+
based on the screen size of the current client device.
|
110
83
|
email: dave.hrycyszyn@headlondon.com
|
111
84
|
executables: []
|
112
|
-
|
113
85
|
extensions: []
|
114
|
-
|
115
|
-
extra_rdoc_files:
|
86
|
+
extra_rdoc_files:
|
116
87
|
- LICENSE.txt
|
117
88
|
- README.rdoc
|
118
|
-
files:
|
89
|
+
files:
|
119
90
|
- .document
|
120
91
|
- Gemfile
|
121
92
|
- Gemfile.lock
|
@@ -127,6 +98,7 @@ files:
|
|
127
98
|
- generators/responsive_image_tag/prototype_responsive_image_tag_generator.rb
|
128
99
|
- generators/responsive_image_tag/templates/README
|
129
100
|
- lib/generators/responsive_image_tag/jquery_generator.rb
|
101
|
+
- lib/generators/responsive_image_tag/padrino_rit.rb
|
130
102
|
- lib/generators/responsive_image_tag/prototype_generator.rb
|
131
103
|
- lib/generators/responsive_image_tag/templates/responsive-image-tag-jquery.js
|
132
104
|
- lib/generators/responsive_image_tag/templates/responsive-image-tag-prototype.js
|
@@ -134,39 +106,32 @@ files:
|
|
134
106
|
- responsive_image_tag.gemspec
|
135
107
|
- test/helper.rb
|
136
108
|
- test/test_responsive_image_tag.rb
|
137
|
-
has_rdoc: true
|
138
109
|
homepage: http://github.com/futurechimp/responsive_image_tag
|
139
|
-
licenses:
|
110
|
+
licenses:
|
140
111
|
- MIT
|
141
112
|
post_install_message:
|
142
113
|
rdoc_options: []
|
143
|
-
|
144
|
-
require_paths:
|
114
|
+
require_paths:
|
145
115
|
- lib
|
146
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
147
117
|
none: false
|
148
|
-
requirements:
|
149
|
-
- -
|
150
|
-
- !ruby/object:Gem::Version
|
151
|
-
|
152
|
-
segments:
|
118
|
+
requirements:
|
119
|
+
- - ! '>='
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
segments:
|
153
123
|
- 0
|
154
|
-
|
155
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
|
+
hash: 1939109034445376453
|
125
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
126
|
none: false
|
157
|
-
requirements:
|
158
|
-
- -
|
159
|
-
- !ruby/object:Gem::Version
|
160
|
-
|
161
|
-
segments:
|
162
|
-
- 0
|
163
|
-
version: "0"
|
127
|
+
requirements:
|
128
|
+
- - ! '>='
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
164
131
|
requirements: []
|
165
|
-
|
166
132
|
rubyforge_project:
|
167
|
-
rubygems_version: 1.
|
133
|
+
rubygems_version: 1.8.17
|
168
134
|
signing_key:
|
169
135
|
specification_version: 3
|
170
136
|
summary: DO NOT USE THIS YET! Helps you insert responsive images into your views
|
171
137
|
test_files: []
|
172
|
-
|