imgix 3.3.1 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.rubocop.yml +2 -0
 - data/.travis.yml +3 -5
 - data/.vscode/tasks.json +29 -0
 - data/CHANGELOG.md +30 -0
 - data/Gemfile +6 -1
 - data/README.md +17 -46
 - data/Rakefile +2 -0
 - data/imgix.gemspec +19 -22
 - data/lib/imgix.rb +5 -4
 - data/lib/imgix/client.rb +65 -51
 - data/lib/imgix/path.rb +130 -86
 - data/lib/imgix/version.rb +1 -1
 - data/script/bench_path.rb +11 -0
 - data/script/bench_to_url.rb +12 -0
 - metadata +14 -58
 - data/.github/CODEOWNERS +0 -2
 - data/.github/ISSUE_TEMPLATE/bug_report.md +0 -28
 - data/.github/ISSUE_TEMPLATE/feature_request.md +0 -27
 - data/.github/ISSUE_TEMPLATE/question.md +0 -17
 - data/.github/pull_request_template.md +0 -73
 - data/lib/imgix/param_helpers.rb +0 -19
 - data/test/test_helper.rb +0 -13
 - data/test/units/domains_test.rb +0 -17
 - data/test/units/param_helpers_test.rb +0 -23
 - data/test/units/path_test.rb +0 -182
 - data/test/units/purge_test.rb +0 -25
 - data/test/units/srcset_test.rb +0 -755
 - data/test/units/url_test.rb +0 -80
 
    
        data/test/units/url_test.rb
    DELETED
    
    | 
         @@ -1,80 +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 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
                assert_output(nil, "Warning: `Path.width=' has been deprecated and " \
         
     | 
| 
       18 
     | 
    
         
            -
                  "will be removed in the next major version (along " \
         
     | 
| 
       19 
     | 
    
         
            -
                  "with all parameter `ALIASES`).\n") {
         
     | 
| 
       20 
     | 
    
         
            -
                    path.width = 200
         
     | 
| 
       21 
     | 
    
         
            -
                }
         
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
                assert_equal 'https://demo.imgix.net/images/demo.png?w=200&s=da421114ca238d1f4a927b889f67c34e', path.to_url
         
     | 
| 
       24 
     | 
    
         
            -
              end
         
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
              def test_signing_with_multiple_params
         
     | 
| 
       27 
     | 
    
         
            -
                path = client.path(DEMO_IMAGE_PATH)
         
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
                assert_output(nil, "Warning: `Path.height=' has been deprecated and " \
         
     | 
| 
       30 
     | 
    
         
            -
                  "will be removed in the next major version (along " \
         
     | 
| 
       31 
     | 
    
         
            -
                  "with all parameter `ALIASES`).\n") {
         
     | 
| 
       32 
     | 
    
         
            -
                    path.height = 200
         
     | 
| 
       33 
     | 
    
         
            -
                }
         
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
                assert_output(nil, "Warning: `Path.width=' has been deprecated and " \
         
     | 
| 
       36 
     | 
    
         
            -
                  "will be removed in the next major version (along " \
         
     | 
| 
       37 
     | 
    
         
            -
                  "with all parameter `ALIASES`).\n") {
         
     | 
| 
       38 
     | 
    
         
            -
                    path.width = 200
         
     | 
| 
       39 
     | 
    
         
            -
                }
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
     | 
    
         
            -
                assert_equal 'https://demo.imgix.net/images/demo.png?h=200&w=200&s=d570a1ecd765470f7b34a69b56718a7a', path.to_url
         
     | 
| 
       42 
     | 
    
         
            -
             
     | 
| 
       43 
     | 
    
         
            -
                path = client.path(DEMO_IMAGE_PATH)
         
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
                assert_output(nil, "Warning: `Path.width=' has been deprecated and " \
         
     | 
| 
       46 
     | 
    
         
            -
                  "will be removed in the next major version (along " \
         
     | 
| 
       47 
     | 
    
         
            -
                  "with all parameter `ALIASES`).\n") {
         
     | 
| 
       48 
     | 
    
         
            -
                    path.width = 200
         
     | 
| 
       49 
     | 
    
         
            -
                }
         
     | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
       51 
     | 
    
         
            -
                assert_output(nil, "Warning: `Path.height=' has been deprecated and " \
         
     | 
| 
       52 
     | 
    
         
            -
                  "will be removed in the next major version (along " \
         
     | 
| 
       53 
     | 
    
         
            -
                  "with all parameter `ALIASES`).\n") {
         
     | 
| 
       54 
     | 
    
         
            -
                    path.height = 200
         
     | 
| 
       55 
     | 
    
         
            -
                }
         
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
     | 
    
         
            -
                assert_equal 'https://demo.imgix.net/images/demo.png?w=200&h=200&s=00b5cde5c7b8bca8618cb911da4ac379', path.to_url
         
     | 
| 
       58 
     | 
    
         
            -
              end
         
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
       60 
     | 
    
         
            -
              def test_domain_resolves_host_warn
         
     | 
| 
       61 
     | 
    
         
            -
                assert_output(nil, "Warning: The identifier `host' has been deprecated and " \
         
     | 
| 
       62 
     | 
    
         
            -
                  "will\nappear as `domain' in the next major version, e.g. " \
         
     | 
| 
       63 
     | 
    
         
            -
                  "`@host'\nbecomes `@domain', `options[:host]' becomes " \
         
     | 
| 
       64 
     | 
    
         
            -
                  "`options[:domain]'.\n") {
         
     | 
| 
       65 
     | 
    
         
            -
                    Imgix::Client.new(host: 'demo.imgix.net', include_library_param: false)
         
     | 
| 
       66 
     | 
    
         
            -
                }
         
     | 
| 
       67 
     | 
    
         
            -
             
     | 
| 
       68 
     | 
    
         
            -
             
     | 
| 
       69 
     | 
    
         
            -
                # Assert the output of this call (to both stdout and stderr) is nil.
         
     | 
| 
       70 
     | 
    
         
            -
                assert_output(nil, nil) {
         
     | 
| 
       71 
     | 
    
         
            -
                  Imgix::Client.new(domain: 'demo.imgix.net', include_library_param: false)
         
     | 
| 
       72 
     | 
    
         
            -
                }
         
     | 
| 
       73 
     | 
    
         
            -
              end
         
     | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
       75 
     | 
    
         
            -
            private
         
     | 
| 
       76 
     | 
    
         
            -
             
     | 
| 
       77 
     | 
    
         
            -
              def client
         
     | 
| 
       78 
     | 
    
         
            -
                @client ||= Imgix::Client.new(host: 'demo.imgix.net', secure_url_token: '10adc394', include_library_param: false)
         
     | 
| 
       79 
     | 
    
         
            -
              end
         
     | 
| 
       80 
     | 
    
         
            -
            end
         
     |