imgix-rails 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ff201b22420f58f76b491e504d1083d4a9e4a9e
4
- data.tar.gz: 864720aae29c42f4c4ee6e8688d91fa56054719a
3
+ metadata.gz: d1fdaf6a0a8278327492dd878bb5af599feccd9f
4
+ data.tar.gz: c93a4e96de9c38cccf4bd0de9af952ac90e67d64
5
5
  SHA512:
6
- metadata.gz: 42f487b6fea7199dbde37347a4ef397d0d9de1749ac28ad14ad2603f9cde2c683e6b6780a159fcfa66c617b346b302853eba0a56ae01ab0c4b273b0d3201c699
7
- data.tar.gz: 992ed719ddcf3bc0d92c0aa7feb81a0ad7dfc1f0cf93ece69daf9c7da471a97e56bcdc511f126de43abcd07b620c6153532a62353a306465e6d44b7d4265dc99
6
+ metadata.gz: d4d34cb75e5e39867179c6ca213cb47fd208d7b9cf980a15753ec5e1e52c9fa4a0a607f91370254567a46b62211498cae3317577aee4e18f53818fc7cbd986e6
7
+ data.tar.gz: 47761da1fe44af0ad2b9181b75221cbbe4225d625550fa0fd9a47c9b648a3007f8cb013670fdf4683ec2e8f4c55093faf618315e5f6fa53a362406f45f49af20
data/README.md CHANGED
@@ -14,6 +14,7 @@ We recommend using something like [Paperclip](https://github.com/thoughtbot/pape
14
14
  * [ix_image_tag](#ix_image_tag)
15
15
  * [ix_picture_tag](#ix_picture_tag)
16
16
  * [ix_image_url](#ix_image_url)
17
+ * [Usage in Sprockets](#usage-in-sprockets)
17
18
  * [Hostname Removal](#hostname-removal)
18
19
  * [Using With Image Uploading Libraries](#using-with-image-uploading-libraries)
19
20
  * [Paperclip and CarrierWave](#paperclip-and-carrierwave)
@@ -173,6 +174,17 @@ puts ix_image_url('/users/1/avatar.png', { w: 400, h: 300 })
173
174
  # => https://assets.imgix.net/users/1/avatar.png?w=400&h=300
174
175
  ```
175
176
 
177
+ <a name="usage-in-sprockets"></a>
178
+ #### Usage in Sprockets
179
+
180
+ `ix_image_url` is also pulled in as a Sprockets helper, so you can generate imgix URLs in your asset pipline files. For example, here's how it would work inside an `.scss.erb` file:
181
+
182
+ ```scss
183
+ .something {
184
+ background-image: url(<%= ix_image_url('a-background.png', { w: 400, h: 300 }) %>);
185
+ }
186
+ ```
187
+
176
188
  ### Hostname Removal
177
189
 
178
190
  You can also configure imgix-rails to disregard given hostnames and only use the path component from given URLs. This is useful if you have [a Web Folder or an Amazon S3 imgix Source configured](https://www.imgix.com/docs/tutorials/creating-sources) but store the fully-qualified URLs for those resources in your database.
@@ -1,5 +1,5 @@
1
1
  module Imgix
2
2
  module Rails
3
- VERSION = '2.1.2'
3
+ VERSION = '2.1.3'
4
4
  end
5
5
  end
@@ -1,6 +1,7 @@
1
1
  require "rails"
2
2
  require "rails/railtie"
3
3
  require "imgix/rails"
4
+ require "imgix/rails/url_helper"
4
5
  require "imgix/rails/view_helper"
5
6
 
6
7
  module Imgix
@@ -14,6 +15,10 @@ module Imgix
14
15
  end
15
16
 
16
17
  ActionView::Base.send :include, ViewHelper
18
+
19
+ if defined? Sprockets
20
+ Sprockets::Context.send :include, UrlHelper
21
+ end
17
22
  end
18
23
  end
19
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imgix-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Sutton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-09-27 00:00:00.000000000 Z
12
+ date: 2016-10-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: imgix
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  requirements: []
138
138
  rubyforge_project:
139
- rubygems_version: 2.4.5.1
139
+ rubygems_version: 2.5.1
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: Makes integrating imgix into your Rails app easier. It builds on imgix-rb