imgix 3.2.1 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +2 -0
- data/.travis.yml +16 -2
- data/CHANGELOG.md +29 -0
- data/Gemfile +3 -1
- data/README.md +48 -45
- data/Rakefile +2 -0
- data/imgix.gemspec +19 -22
- data/lib/imgix.rb +12 -10
- data/lib/imgix/client.rb +72 -26
- data/lib/imgix/path.rb +117 -91
- data/lib/imgix/version.rb +1 -1
- metadata +12 -53
- data/lib/imgix/param_helpers.rb +0 -18
- data/test/test_helper.rb +0 -13
- data/test/units/domains_test.rb +0 -17
- data/test/units/path_test.rb +0 -132
- data/test/units/purge_test.rb +0 -25
- data/test/units/srcset_test.rb +0 -716
- data/test/units/url_test.rb +0 -38
data/test/units/url_test.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
class UrlTest < Imgix::Test
|
6
|
-
DEMO_IMAGE_PATH = '/images/demo.png'
|
7
|
-
|
8
|
-
def test_signing_with_no_params
|
9
|
-
path = client.path(DEMO_IMAGE_PATH)
|
10
|
-
|
11
|
-
assert_equal 'https://demo.imgix.net/images/demo.png?s=2c7c157eaf23b06a0deb2f60b81938c4', path.to_url
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_signing_with_one
|
15
|
-
path = client.path(DEMO_IMAGE_PATH)
|
16
|
-
path.width = 200
|
17
|
-
|
18
|
-
assert_equal 'https://demo.imgix.net/images/demo.png?w=200&s=da421114ca238d1f4a927b889f67c34e', path.to_url
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_signing_with_multiple_params
|
22
|
-
path = client.path(DEMO_IMAGE_PATH)
|
23
|
-
path.height = 200
|
24
|
-
path.width = 200
|
25
|
-
assert_equal 'https://demo.imgix.net/images/demo.png?h=200&w=200&s=d570a1ecd765470f7b34a69b56718a7a', path.to_url
|
26
|
-
|
27
|
-
path = client.path(DEMO_IMAGE_PATH)
|
28
|
-
path.width = 200
|
29
|
-
path.height = 200
|
30
|
-
assert_equal 'https://demo.imgix.net/images/demo.png?w=200&h=200&s=00b5cde5c7b8bca8618cb911da4ac379', path.to_url
|
31
|
-
end
|
32
|
-
|
33
|
-
private
|
34
|
-
|
35
|
-
def client
|
36
|
-
@client ||= Imgix::Client.new(host: 'demo.imgix.net', secure_url_token: '10adc394', include_library_param: false)
|
37
|
-
end
|
38
|
-
end
|