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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d6368a63259f9b90026ec4c6bc2c746f7255ceff
4
- data.tar.gz: ed8f3e587ba83d81b8dd051bb8564e280e93fd11
3
+ metadata.gz: b59ca66259f3a3dc2ce4dfe1e08319eaa81686d3
4
+ data.tar.gz: 50d1153dcc0cb4357a626e5227b4554b1821cc3e
5
5
  SHA512:
6
- metadata.gz: 5e6010428c6dc3826689aa3f3cdd4ad66d31e55953ba280a973002eb00e2c23a0ec7725a8eba3c954fbbe3fbda7b855c631a63b672dddffc46bcf6092ddfc7f1
7
- data.tar.gz: 2266b84e7e98ddba03c67a9165bc328b183d5ab110f46abdbe7b8a17b0a99e3a0b8113ad307dbe66c48dc89abb2e25fc40d76060527a0672ef76d0682295d65a
6
+ metadata.gz: 2c3f392e98b1309c410c41743d8eeba378c354643398abad7eb822f6c9c06bb40dd163a148fcd80f2cfd2d131a9d5dbd02003e52d26a65191ea483ad0aed8032
7
+ data.tar.gz: 99687dfe26742019b14f742500d189843ca28ebabd09c25f44e589ab96dbedec732db1151100c52d6e752aa66a9f2fdcd3f991d91260f46bac9bb5761162e86f
data/.gitignore CHANGED
@@ -7,3 +7,5 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
11
+ .DS_Store
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.
@@ -1,5 +1,5 @@
1
1
  module Imgix
2
2
  module Rails
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
@@ -5,13 +5,19 @@ module Imgix
5
5
  class ConfigurationError < StandardError; end
6
6
 
7
7
  module ViewHelper
8
- def ix_image_tag(source, options={})
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(client.path(source).to_url(options).html_safe, normal_opts)
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.2.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-02 00:00:00.000000000 Z
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
Binary file