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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54d696fed267d139643d66d0feec9639b5c71b10
4
- data.tar.gz: 909c82a553d42a2b257ca3b80a08e2109868dc9a
3
+ metadata.gz: 79cf096d23e38b34516352b6d161e9f3991b3c44
4
+ data.tar.gz: 30ad381cd316adb07a58bda15228b4e89ce9221e
5
5
  SHA512:
6
- metadata.gz: d17c57373d186ca4309b4f446c107ed3f3bf773d97901999f6fe21d6540affea4f6a19e572f3625a998df3efd6999a602cc1300bedfbe7991706f903eae798cd
7
- data.tar.gz: b7505c7519afd3b3ee52bf55c27bba6d8f19f58a70f654d0a19895547aeac35b0365dca686ab5d39f687025f082347b357276c6f2124ccb7a0995d3959256459
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 `:`include_library_param: false` in the instantiation Hash parameter for `Imgix::Client`:
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 })
@@ -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/soffes/imgix-rb'
13
+ spec.homepage = 'https://github.com/imgix/imgix-rb'
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -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("rb-#{Imgix::VERSION}") if @include_library_param
23
+ p.ixlib("#{@library}-#{@version}") if @include_library_param
22
24
  p
23
25
  end
24
26
 
@@ -1,3 +1,3 @@
1
1
  module Imgix
2
- VERSION = '0.3.4'
2
+ VERSION = '0.3.5'
3
3
  end
@@ -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
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-06-04 00:00:00.000000000 Z
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/soffes/imgix-rb
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.7
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.