responsive_images 0.1.0 → 0.1.1
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 +8 -8
- data/README.md +5 -3
- data/lib/responsive_images/version.rb +1 -1
- data/lib/responsive_images/view_helpers.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjY5MjkwZmFhNTVlYjk2ZGIzZDFiMjYxNWU3NzI2MmViZDE2M2NmZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTJmOTM3ZWNiNjE2OGVkNzk4YTA3MTQ3ZjJlOWI2NTA4ZjMyNWYzMA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTRlNGRiNGUzOTk1OGY5OTFlNzMwMDg2ZTY1ZjliMzQ2NzdlNWJjMmU0ZDli
|
10
|
+
YWY5Y2YzNDAwMmEwZmNlZTdmYjFiM2IwYjM3ZDkwYzZkZWViYTUzNzg2NGM1
|
11
|
+
OTQ5YWEzNjE2MTdlNzE4MjJmZmQxZjVjYjRmYjFjNDM0YzQ1MTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2Y5ZGYwNzUyNWFkZjU5NDNmMTJmMWMzNmY2MTZhMWMzZDAzMTIzMjhiYzUx
|
14
|
+
ZTExYjdjNjllN2Y4MmYyOTZkOWFhMjk3YTc3MGVjNjczNTRhODBmMzI3MDRl
|
15
|
+
OWRmYzc4NzAwYjY0ZWI2YmY5ODQ2ZmE5M2NiYjIzNThiNTc5Njg=
|
data/README.md
CHANGED
@@ -76,11 +76,13 @@ ResponsiveImages is incredibly easy to use. There are currently two primary help
|
|
76
76
|
The `responsive_image_tag` is meant replace the `image_tag`. You can pass any arguments, just like you would with an `image_tag`. Here is a basic exmpale:
|
77
77
|
|
78
78
|
# basic usage
|
79
|
-
= responsive_image_tag @post.image
|
79
|
+
= responsive_image_tag @post.image.url
|
80
80
|
# => <img src="path/to/image.jpg", data-desktop-src="path/to/desktop_image.jpg" data-tablet-src="path/to/tablet_image.jpg" data-mobile-src="path/to/mobile_image.jpg" />
|
81
81
|
|
82
82
|
The helper method will determine what size is most appropriate for the `src` attribute. Rather than load a default size and then swap them out, the ResponsiveImage gem actually detects the user device and uses the appropriate image for the `src` attribute.
|
83
83
|
|
84
|
+
__Note that as of version 0.1.0 you'll need to pass the appropriate column where carrierwave is mounted, i.e. url, attachment, file, etc. In previous verions, this defaulted to `.url`__
|
85
|
+
|
84
86
|
You can also pass custom sizes to the helper method. If you have a specific model or page that use's different image, then pass those Carrierwave versions through the :sizes parameter:
|
85
87
|
|
86
88
|
# custom versions
|
@@ -95,7 +97,7 @@ These custom versions will overwrite the default versions from our configuration
|
|
95
97
|
ResponsiveImages also includes a helper for background images. You can easily call this with:
|
96
98
|
|
97
99
|
# basic usage
|
98
|
-
= responsive_background_image @post.image
|
100
|
+
= responsive_background_image @post.image.url
|
99
101
|
# => style="url(path/to/image.jpg)" data-desktop-src="path/to/image.jpg" data-tablet-src="path/to/tablet_image.jpg" data-mobile-src="path/to/mobile_image.jpg"
|
100
102
|
|
101
103
|
This will automatically create the attributes for your `<div/>` or whatever tag you add a background image too.
|
@@ -103,7 +105,7 @@ This will automatically create the attributes for your `<div/>` or whatever tag
|
|
103
105
|
You can also pass custom version to the helper method with:
|
104
106
|
|
105
107
|
# custom versions
|
106
|
-
= responsive_background_image @post.image, :sizes => { :'mobile' => :post_small, :tablet => :post_tablet }
|
108
|
+
= responsive_background_image @post.image.url, :sizes => { :'mobile' => :post_small, :tablet => :post_tablet }
|
107
109
|
# => style="url(path/to/image.jpg)" data-desktop-src="path/to/image.jpg" data-tablet-src="path/to/post_tablet_image.jpg" data-mobile-src="path/to/post_mobile_image.jpg"
|
108
110
|
|
109
111
|
|
@@ -17,7 +17,7 @@ module ResponsiveImages
|
|
17
17
|
# Get the image source
|
18
18
|
image_src = src_path(image, sizes)
|
19
19
|
# Return the image tag with our responsive data attributes
|
20
|
-
return image_tag image_src, data_sizes
|
20
|
+
return image_tag image_src, data_sizes.merge(options)
|
21
21
|
end
|
22
22
|
|
23
23
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: responsive_images
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Koht
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|