imgix 0.3.2 → 0.3.3

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: 4d47d95ae9a8393382dad40adde1d7334d0ec6b0
4
- data.tar.gz: d9d9468847c4794d1df05d1a518bfe734467fe64
3
+ metadata.gz: 588ae10e0524aac623bad42329e59ab645891c9d
4
+ data.tar.gz: 836a1ed328300c1d74ae6919d720acfef0aa373f
5
5
  SHA512:
6
- metadata.gz: 3bc7a9a75834d9bc26cb3f9433122cf4149d175e634c248e75dd345c393f04ffecdbd5a7506cf2133a15c68f84f9ca837133a5f83b940b0d80f195c1f5a18f9a
7
- data.tar.gz: cc809d26b35e0362bcc95153171a9d34ab5fc92b4d69df20f1911961133a861bb4bac4d3a5ae16a42c1a7c59b3b5ed2d03c3eb460bd11d122977d3d15533c724
6
+ metadata.gz: 20e0097bd2e1671598a26c3b70c85aac692ce4edef1615a33e888154d8011b394aac06d39e750abe4ffc58f9c818543dc10213a01e0334a623d0abf9ccead82a
7
+ data.tar.gz: 3aab4814449a24f6b2aeca5ac07158dbccd286114563e11a1a52b4f139e477fd2ab14382c509485412da99641125cbe7510427e5954f34dd3ad3f22280bbdd73
@@ -2,7 +2,7 @@ language: ruby
2
2
  bundler_args: --without development
3
3
  before_install: gem install bundler
4
4
  rvm:
5
- - 2.2.1
5
+ - 2.2.2
6
6
  - 1.9.2
7
7
  - jruby-1.7.19
8
8
  - rbx-2.2.7
@@ -0,0 +1,12 @@
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
+ ## [0.3.3] - May 14, 2015
7
+ ### Fixed
8
+ - Fixed a bug where URLs as the path component for Web Proxy sources would not be encoded would generate URLs that would result in a 400 Bad Request. [#8](https://github.com/imgix/imgix-rb/pull/8)
9
+
10
+ ## [0.3.2] - May 11, 2015
11
+ ### Fixed
12
+ - Fixed a bug where the library would not work if tokens were not present.
data/Rakefile CHANGED
@@ -6,3 +6,11 @@ Rake::TestTask.new(:test) do |t|
6
6
  t.pattern = 'test/**/*_test.rb'
7
7
  end
8
8
  task :default => :test
9
+
10
+ task :console do
11
+ require 'irb'
12
+ require 'irb/completion'
13
+ require 'imgix'
14
+ ARGV.clear
15
+ IRB.start
16
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Unofficial Ruby Gem for signing [imgix](http://imgix.com) URLs. Tested under 1.9.2, 2.2.1, JRuby 1.7.19, and Rubinius 2.2.7.
4
4
 
5
- [![Build Status](https://travis-ci.org/soffes/imgix-rb.png?branch=master)](https://travis-ci.org/soffes/imgix-rb)
5
+ [![Build Status](https://travis-ci.org/imgix/imgix-rb.png?branch=master)](https://travis-ci.org/imgix/imgix-rb)
6
6
 
7
7
 
8
8
  ## Installation
@@ -33,6 +33,7 @@ module Imgix
33
33
  @path = path
34
34
  @options = {}
35
35
 
36
+ @path = CGI.escape(@path) if /^https?/ =~ @path
36
37
  @path = "/#{@path}" if @path[0] != '/'
37
38
  end
38
39
 
@@ -1,3 +1,3 @@
1
1
  module Imgix
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
@@ -37,7 +37,6 @@ class DomainsTest < Imgix::Test
37
37
 
38
38
  path = client.path('/bridge.png')
39
39
  assert_equal 'http://demos-1.imgix.net/bridge.png?&s=13e68f249172e5f790344e85e7cdb14b', path.to_url
40
-
41
40
  end
42
41
 
43
42
  def test_strips_out_protocol
@@ -47,7 +46,18 @@ class DomainsTest < Imgix::Test
47
46
 
48
47
  path = client.path('/bridge.png')
49
48
  assert_equal 'http://demos-1.imgix.net/bridge.png?&s=13e68f249172e5f790344e85e7cdb14b', path.to_url
50
-
51
49
  end
52
50
 
51
+ def test_with_full_paths
52
+ client = Imgix::Client.new(:hosts => [
53
+ "demos-1.imgix.net",
54
+ "demos-2.imgix.net",
55
+ "demos-3.imgix.net",
56
+ ],
57
+ :token => '10adc394',
58
+ :shard_strategy => :cycle)
59
+
60
+ path = 'https://google.com/cats.gif'
61
+ assert_equal "http://demos-1.imgix.net/#{CGI.escape(path)}?&s=4c3ff935011f0d2251800e6a2bb68ee5", client.path(path).to_url
62
+ end
53
63
  end
@@ -60,7 +60,18 @@ class PathTest < Imgix::Test
60
60
  assert_equal url, path.to_url
61
61
  end
62
62
 
63
- private
63
+ def test_full_url
64
+ path = 'https://google.com/cats.gif'
65
+
66
+ assert_equal "http://demo.imgix.net/#{CGI.escape(path)}?&s=4c3ff935011f0d2251800e6a2bb68ee5", client.path(path).to_url
67
+ end
68
+
69
+ def test_full_url_with_a_space
70
+ path = 'https://my-demo-site.com/files/133467012/avatar icon.png'
71
+ assert_equal "http://demo.imgix.net/#{CGI.escape(path)}?&s=8943817bed50811f6ceedd8f4b84169d", client.path(path).to_url
72
+ end
73
+
74
+ private
64
75
 
65
76
  def client
66
77
  @client ||= Imgix::Client.new(:host => 'demo.imgix.net', :token => '10adc394')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imgix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Soffes
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-05-11 00:00:00.000000000 Z
13
+ date: 2015-05-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable
@@ -37,6 +37,7 @@ extra_rdoc_files: []
37
37
  files:
38
38
  - ".gitignore"
39
39
  - ".travis.yml"
40
+ - CHANGELOG.md
40
41
  - Contributing.markdown
41
42
  - Gemfile
42
43
  - LICENSE