imgix-rails 3.0.2 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -3
- data/CHANGELOG.md +11 -0
- data/README.md +42 -1
- data/imgix-rails.gemspec +1 -1
- data/lib/imgix/rails/tag.rb +4 -0
- data/lib/imgix/rails/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d8e16e7584531189f3ccab88b74ff078b40acc6
|
4
|
+
data.tar.gz: c5702cdb0c68c5b56de4d3f38f9c7822d4436560
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d31eb0414ac415ce503ecea0f8d284ddf4c801a118fcfa6043ecbd0a71c6e4e7685730e910ab5f4768a2912854878d699e53177bf7d88e74fce0a2881a8e007f
|
7
|
+
data.tar.gz: 4c64313f1972d5420f7211d9666cc63df0326a52cf09d0462895ffc3b2551357a25c6add079d1934bc5451e7e1c1f4113ddd3bd0b0fc2b29d50cb64102f29912
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
|
+
|
6
|
+
## [3.1.0](https://github.com/imgix/imgix-rb/compare/3.0.2...3.1.0) - October 25, 2019
|
7
|
+
|
8
|
+
* Update bundler dev dependency to include new major version 2.x ([#71](https://github.com/imgix/imgix-rb/pull/71))
|
9
|
+
* README: Fix typo ([#73](https://github.com/imgix/imgix-rb/pull/73))
|
10
|
+
* docs: add ActiveStorage instructions to README ([#74](https://github.com/imgix/imgix-rb/pull/74))
|
11
|
+
* chore(deprecate): emit warning when generating srcsets ([ccc906b](https://github.com/imgix/imgix-rails/commit/ccc906be749945f6f843b5eeb04ab03a292ccbfb)) ([e2ffc2b](https://github.com/imgix/imgix-rails/commit/e2ffc2b4f847c15ea73fa161b673885e704e4cf2))
|
data/README.md
CHANGED
@@ -18,6 +18,7 @@ We recommend using something like [Paperclip](https://github.com/thoughtbot/pape
|
|
18
18
|
* [Using With Image Uploading Libraries](#using-with-image-uploading-libraries)
|
19
19
|
* [Paperclip and CarrierWave](#paperclip-and-carrierwave)
|
20
20
|
* [Refile](#refile)
|
21
|
+
* [Active Storage](#activestorage)
|
21
22
|
* [Development](#development)
|
22
23
|
* [Contributing](#contributing)
|
23
24
|
|
@@ -248,7 +249,7 @@ puts ix_image_url('/users/1/avatar.png', { w: 400, h: 300 })
|
|
248
249
|
<a name="usage-in-sprockets"></a>
|
249
250
|
#### Usage in Sprockets
|
250
251
|
|
251
|
-
`ix_image_url` is also pulled in as a Sprockets helper, so you can generate imgix URLs in your asset
|
252
|
+
`ix_image_url` is also pulled in as a Sprockets helper, so you can generate imgix URLs in your asset pipeline files. For example, here's how it would work inside an `.scss.erb` file:
|
252
253
|
|
253
254
|
```scss
|
254
255
|
.something {
|
@@ -303,6 +304,46 @@ end
|
|
303
304
|
<%= ix_refile_image_tag(@blog_post, :hero_photo, {auto: 'format', fit: 'crop', w: 500}) %>
|
304
305
|
```
|
305
306
|
|
307
|
+
<a name="activestorage"></a>
|
308
|
+
### Active Storage
|
309
|
+
|
310
|
+
To set up imgix with ActiveStorage, first ensure that the remote source your ActiveStorage service is pointing to is the same as your imgix source — such as an s3 bucket.
|
311
|
+
|
312
|
+
#### config/storage.yml
|
313
|
+
```yml
|
314
|
+
service: S3
|
315
|
+
access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
|
316
|
+
secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
|
317
|
+
region: us-east-1
|
318
|
+
bucket: your_own_bucket
|
319
|
+
```
|
320
|
+
|
321
|
+
Modify your active_storage.service setting depending on what environment you are using. For example, to use Amazon s3 in production, make the following change:
|
322
|
+
|
323
|
+
#### config/environments/production.rb
|
324
|
+
```ruby
|
325
|
+
config.active_storage.service = :amazon
|
326
|
+
```
|
327
|
+
|
328
|
+
As you would normally with imgix-rails, configure your application to point to your imgix source:
|
329
|
+
|
330
|
+
#### config/application.rb
|
331
|
+
```ruby
|
332
|
+
Rails.application.configure do
|
333
|
+
config.imgix = {
|
334
|
+
source: your_domain,
|
335
|
+
use_https: true,
|
336
|
+
include_library_param: true
|
337
|
+
}
|
338
|
+
end
|
339
|
+
```
|
340
|
+
|
341
|
+
Finally, the two can be used together by passing in the filename of the ActiveStorage blob into the imgix-rails helper function:
|
342
|
+
|
343
|
+
#### show.html.erb
|
344
|
+
```erb
|
345
|
+
<%= ix_image_tag(@your_model.image.key) %>
|
346
|
+
```
|
306
347
|
|
307
348
|
<a name="development"></a>
|
308
349
|
## Development
|
data/imgix-rails.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_runtime_dependency "imgix", "~> 1.1", ">= 1.1.0"
|
31
31
|
|
32
|
-
spec.add_development_dependency "bundler", "
|
32
|
+
spec.add_development_dependency "bundler", ">=1.9"
|
33
33
|
spec.add_development_dependency "rake", "~> 10.0"
|
34
34
|
spec.add_development_dependency "rspec"
|
35
35
|
spec.add_development_dependency "rspec-rails"
|
data/lib/imgix/rails/tag.rb
CHANGED
@@ -15,6 +15,10 @@ class Imgix::Rails::Tag
|
|
15
15
|
protected
|
16
16
|
|
17
17
|
def srcset(url_params: @url_params, widths: @widths)
|
18
|
+
if url_params[:w].present?
|
19
|
+
warn "Warning: srcset generation will be refactored in the next major release. "\
|
20
|
+
"Please consult this project\'s documentation when upgrading to better understand the expected behavior."
|
21
|
+
end
|
18
22
|
widths = widths || target_widths
|
19
23
|
|
20
24
|
srcset_url_params = url_params.clone
|
data/lib/imgix/rails/version.rb
CHANGED
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: 3.0
|
4
|
+
version: 3.1.0
|
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:
|
12
|
+
date: 2019-10-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: imgix
|
@@ -35,14 +35,14 @@ dependencies:
|
|
35
35
|
name: bundler
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.9'
|
41
41
|
type: :development
|
42
42
|
prerelease: false
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.9'
|
48
48
|
- !ruby/object:Gem::Dependency
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- ".gitignore"
|
101
101
|
- ".rspec"
|
102
102
|
- ".travis.yml"
|
103
|
+
- CHANGELOG.md
|
103
104
|
- Gemfile
|
104
105
|
- LICENSE
|
105
106
|
- README.md
|
@@ -136,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
137
|
version: '0'
|
137
138
|
requirements: []
|
138
139
|
rubyforge_project:
|
139
|
-
rubygems_version: 2.
|
140
|
+
rubygems_version: 2.6.13
|
140
141
|
signing_key:
|
141
142
|
specification_version: 4
|
142
143
|
summary: Makes integrating imgix into your Rails app easier. It builds on imgix-rb
|