imgix-rails 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +8 -2
- data/lib/imgix/rails/version.rb +1 -1
- data/lib/imgix/rails/view_helper.rb +8 -2
- metadata +2 -5
- data/lib/.DS_Store +0 -0
- data/lib/imgix/.DS_Store +0 -0
- data/lib/imgix/rails/.DS_Store +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b59ca66259f3a3dc2ce4dfe1e08319eaa81686d3
|
4
|
+
data.tar.gz: 50d1153dcc0cb4357a626e5227b4554b1821cc3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c3f392e98b1309c410c41743d8eeba378c354643398abad7eb822f6c9c06bb40dd163a148fcd80f2cfd2d131a9d5dbd02003e52d26a65191ea483ad0aed8032
|
7
|
+
data.tar.gz: 99687dfe26742019b14f742500d189843ca28ebabd09c25f44e589ab96dbedec732db1151100c52d6e752aa66a9f2fdcd3f991d91260f46bac9bb5761162e86f
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -31,12 +31,18 @@ Before you get started, you will need to define your imgix configuration in your
|
|
31
31
|
```ruby
|
32
32
|
Rails.application.configure do
|
33
33
|
config.imgix = {
|
34
|
-
source: "Name of your source, e.g. assets.imgix.net"
|
35
|
-
secure_url_token: "optional secure URL token found in your dashboard (https://webapp.imgix.com)"
|
34
|
+
source: "Name of your source, e.g. assets.imgix.net"
|
36
35
|
}
|
37
36
|
end
|
38
37
|
```
|
39
38
|
|
39
|
+
The following configuration flags will be respected:
|
40
|
+
|
41
|
+
- `:secure:` toggles the use of HTTPS. Deafults to `true`
|
42
|
+
- `:source` a String or Array that specifies the imgix Source address. Should be in the form of `"assets.imgix.net"`.
|
43
|
+
- `:secure_url_token` a optional secure URL token found in your dashboard (https://webapp.imgix.com) used for signing requests
|
44
|
+
- `:hostnames_to_remove` an Array of hostnames to replace with the value(s) specified by `:source`. This is useful if you store full-qualified S3 URLs in your database, but want to serve images through imgix.
|
45
|
+
|
40
46
|
### ix_image_tag
|
41
47
|
|
42
48
|
The simplest way of working with imgix-rails is to use the `ix_image_tag`, this allows you to pass parameters to imgix to handle things like resizing, cropping, etc.
|
data/lib/imgix/rails/version.rb
CHANGED
@@ -5,13 +5,19 @@ module Imgix
|
|
5
5
|
class ConfigurationError < StandardError; end
|
6
6
|
|
7
7
|
module ViewHelper
|
8
|
-
def
|
8
|
+
def ix_image_url(source, options={})
|
9
9
|
validate_configuration!
|
10
10
|
|
11
|
+
source = replace_hostname(source)
|
12
|
+
|
13
|
+
client.path(source).to_url(options).html_safe
|
14
|
+
end
|
15
|
+
|
16
|
+
def ix_image_tag(source, options={})
|
11
17
|
source = replace_hostname(source)
|
12
18
|
normal_opts = options.slice!(*available_parameters)
|
13
19
|
|
14
|
-
image_tag(
|
20
|
+
image_tag(ix_image_url(source, options), normal_opts)
|
15
21
|
end
|
16
22
|
|
17
23
|
def ix_responsive_image_tag(source, options={})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imgix-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelly Sutton
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: imgix
|
@@ -104,10 +104,7 @@ files:
|
|
104
104
|
- bin/console
|
105
105
|
- bin/setup
|
106
106
|
- imgix-rails.gemspec
|
107
|
-
- lib/.DS_Store
|
108
|
-
- lib/imgix/.DS_Store
|
109
107
|
- lib/imgix/rails.rb
|
110
|
-
- lib/imgix/rails/.DS_Store
|
111
108
|
- lib/imgix/rails/version.rb
|
112
109
|
- lib/imgix/rails/view_helper.rb
|
113
110
|
- lib/imgix/railtie.rb
|
data/lib/.DS_Store
DELETED
Binary file
|
data/lib/imgix/.DS_Store
DELETED
Binary file
|
data/lib/imgix/rails/.DS_Store
DELETED
Binary file
|