imgix 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/imgix.gemspec +3 -3
- data/lib/imgix/client.rb +3 -1
- data/lib/imgix/version.rb +1 -1
- data/test/units/path_test.rb +9 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79cf096d23e38b34516352b6d161e9f3991b3c44
|
4
|
+
data.tar.gz: 30ad381cd316adb07a58bda15228b4e89ce9221e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ef40e955e3a043eeafdfacab5ae11a12bff09135caf24aa402925d69e3260f6743f9d26369c9bbbe667e81ab12efdc76adb9468710d4440bf9d4472501093bd
|
7
|
+
data.tar.gz: 018c2e788a1fc6d3f88c7b84d2231a630d193de2ee3f85a0f0f3e96169f4f3262273864243579fe39e24e3a2692e055eb8d0d6f39387727646c26f73c37c1126
|
data/README.md
CHANGED
@@ -4,7 +4,6 @@ Official Ruby Gem for signing [imgix](http://imgix.com) URLs. Tested under 1.9.2
|
|
4
4
|
|
5
5
|
[![Build Status](https://travis-ci.org/imgix/imgix-rb.png?branch=master)](https://travis-ci.org/imgix/imgix-rb)
|
6
6
|
|
7
|
-
|
8
7
|
## Installation
|
9
8
|
|
10
9
|
Add this line to your application's Gemfile:
|
@@ -90,7 +89,7 @@ Some important third parties (like Facebook) apply URL escaping to query string
|
|
90
89
|
|
91
90
|
For security and diagnostic purposes, we sign all requests with the language and version of library used to generate the URL.
|
92
91
|
|
93
|
-
This can be disabled by including
|
92
|
+
This can be disabled by including `include_library_param: false` in the instantiation Hash parameter for `Imgix::Client`:
|
94
93
|
|
95
94
|
```ruby
|
96
95
|
client = Imgix::Client.new({ include_library_param: false })
|
data/imgix.gemspec
CHANGED
@@ -6,11 +6,11 @@ require 'imgix/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'imgix'
|
8
8
|
spec.version = Imgix::VERSION
|
9
|
-
spec.authors = ['Sam Soffes', 'Ryan LeFevre', 'Antony Denyer']
|
10
|
-
spec.email = ['sam@soff.es', 'ryan@layervault.com', 'email@antonydenyer.co.uk']
|
9
|
+
spec.authors = ['Kelly Sutton', 'Sam Soffes', 'Ryan LeFevre', 'Antony Denyer']
|
10
|
+
spec.email = ['kelly@imgix.com', 'sam@soff.es', 'ryan@layervault.com', 'email@antonydenyer.co.uk']
|
11
11
|
spec.description = 'Easily sign imgix URLs.'
|
12
12
|
spec.summary = 'Unofficial Ruby Gem for easily signing imgix URLs.'
|
13
|
-
spec.homepage = 'https://github.com/
|
13
|
+
spec.homepage = 'https://github.com/imgix/imgix-rb'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
data/lib/imgix/client.rb
CHANGED
@@ -14,11 +14,13 @@ module Imgix
|
|
14
14
|
@secure = options[:secure]
|
15
15
|
@shard_strategy = options[:shard_strategy] and validate_strategy!
|
16
16
|
@include_library_param = options.fetch(:include_library_param, true)
|
17
|
+
@library = options.fetch(:library_param, "rb")
|
18
|
+
@version = options.fetch(:library_version, Imgix::VERSION)
|
17
19
|
end
|
18
20
|
|
19
21
|
def path(path)
|
20
22
|
p = Path.new(prefix(path), @token, path)
|
21
|
-
p.ixlib("
|
23
|
+
p.ixlib("#{@library}-#{@version}") if @include_library_param
|
22
24
|
p
|
23
25
|
end
|
24
26
|
|
data/lib/imgix/version.rb
CHANGED
data/test/units/path_test.rb
CHANGED
@@ -78,6 +78,15 @@ class PathTest < Imgix::Test
|
|
78
78
|
assert_equal "ixlib=rb-#{Imgix::VERSION}", URI(url).query
|
79
79
|
end
|
80
80
|
|
81
|
+
def test_configure_library_param
|
82
|
+
library = "sinatra"
|
83
|
+
version = "1.0.0"
|
84
|
+
client = Imgix::Client.new(host: 'demo.imgix.net', library_param: library, library_version: version) # enabled by default
|
85
|
+
url = client.path('/images/demo.png').to_url
|
86
|
+
|
87
|
+
assert_equal "ixlib=#{library}-#{version}", URI(url).query
|
88
|
+
end
|
89
|
+
|
81
90
|
private
|
82
91
|
|
83
92
|
def client
|
metadata
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imgix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Kelly Sutton
|
7
8
|
- Sam Soffes
|
8
9
|
- Ryan LeFevre
|
9
10
|
- Antony Denyer
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
13
|
-
date: 2015-
|
14
|
+
date: 2015-08-20 00:00:00.000000000 Z
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: addressable
|
@@ -28,6 +29,7 @@ dependencies:
|
|
28
29
|
version: '0'
|
29
30
|
description: Easily sign imgix URLs.
|
30
31
|
email:
|
32
|
+
- kelly@imgix.com
|
31
33
|
- sam@soff.es
|
32
34
|
- ryan@layervault.com
|
33
35
|
- email@antonydenyer.co.uk
|
@@ -53,7 +55,7 @@ files:
|
|
53
55
|
- test/units/domains_test.rb
|
54
56
|
- test/units/path_test.rb
|
55
57
|
- test/units/url_test.rb
|
56
|
-
homepage: https://github.com/
|
58
|
+
homepage: https://github.com/imgix/imgix-rb
|
57
59
|
licenses:
|
58
60
|
- MIT
|
59
61
|
metadata: {}
|
@@ -73,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
75
|
version: '0'
|
74
76
|
requirements: []
|
75
77
|
rubyforge_project:
|
76
|
-
rubygems_version: 2.4.
|
78
|
+
rubygems_version: 2.4.6
|
77
79
|
signing_key:
|
78
80
|
specification_version: 4
|
79
81
|
summary: Unofficial Ruby Gem for easily signing imgix URLs.
|