link_thumbnailer 2.0.1 → 2.0.2
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 +13 -5
 - data/CHANGELOG.md +7 -0
 - data/lib/link_thumbnailer/processor.rb +3 -2
 - data/lib/link_thumbnailer/scrapers/default/images.rb +4 -4
 - data/lib/link_thumbnailer/version.rb +1 -1
 - data/spec/processor_spec.rb +5 -0
 - metadata +10 -10
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
      
 2 
     | 
    
         
            +
            !binary "U0hBMQ==":
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: !binary |-
         
     | 
| 
      
 4 
     | 
    
         
            +
                NjAzY2Q3NzU4MWZkOTZlYzUxN2I3NjlhZjY4YmFjNTZhZmNiYWZjZg==
         
     | 
| 
      
 5 
     | 
    
         
            +
              data.tar.gz: !binary |-
         
     | 
| 
      
 6 
     | 
    
         
            +
                ODhlZGRhZjYyZDc3MzMyZjk5MzdmZTdhY2ZlMzBlZWM2Mjc4NjVjZQ==
         
     | 
| 
       5 
7 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
      
 8 
     | 
    
         
            +
              metadata.gz: !binary |-
         
     | 
| 
      
 9 
     | 
    
         
            +
                OTM3YzUzN2EwYjQzYzU0NTBlN2MwMjcwMjcwZWIzYzgzOGY4YWJiNzZhNmRh
         
     | 
| 
      
 10 
     | 
    
         
            +
                ZjQ0OTcxNWRmZWRiNWQ0ZTJhNGNhMTUzMjBlMzI1M2Y3YTQ3YWY3MzRjNzc5
         
     | 
| 
      
 11 
     | 
    
         
            +
                ZGQyYWM4N2ViZTM4ODE3NzY5ZTc4YTQ4YmU4ODMwZmRhMGRlOWI=
         
     | 
| 
      
 12 
     | 
    
         
            +
              data.tar.gz: !binary |-
         
     | 
| 
      
 13 
     | 
    
         
            +
                ZmQ4ODgwNmIzMzJiN2U5MmY0OTM4YjAyMDM5YmM3MGFhOTIxOGY0YzY1NDgw
         
     | 
| 
      
 14 
     | 
    
         
            +
                YTJlMDA3MTUyNzQ2Mjg4MTI4NDNmYmVlZjU2NTZiZmQ3NjZkNmM1OWJjODUx
         
     | 
| 
      
 15 
     | 
    
         
            +
                YjMyNzE4NDA3ZDQ3ODFjMmViMmM4MmQ5ODBkZjQ0NDUwYmVlZDQ=
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,3 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # 2.0.2
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            - Fix couple of issues with `URI` class namespace
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
       1 
5 
     | 
    
         
             
            # 2.0.1
         
     | 
| 
       2 
6 
     | 
    
         | 
| 
       3 
7 
     | 
    
         
             
            - Fix issue with image parser (fastimage) when given an URI instance instead of a string
         
     | 
| 
         @@ -15,6 +19,9 @@ 
     | 
|
| 
       15 
19 
     | 
    
         
             
            - More specs
         
     | 
| 
       16 
20 
     | 
    
         
             
            - Removed `PreviewsController` since it does not add much value. Simply create your own and use the `to_json` method.
         
     | 
| 
       17 
21 
     | 
    
         | 
| 
      
 22 
     | 
    
         
            +
            To update from `1.x.x` to `2.x.x` you need to run `rails g link_thumbnailer:install` to get the new configuration file.
         
     | 
| 
      
 23 
     | 
    
         
            +
            If you used the `PreviewsController` feature, you need to build it yourself since it is not supported anymore.
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
       18 
25 
     | 
    
         
             
            # 1.1.2
         
     | 
| 
       19 
26 
     | 
    
         | 
| 
       20 
27 
     | 
    
         
             
            - Fix issue with FastImage URLs [https://github.com/gottfrois/link_thumbnailer/pull/31](https://github.com/gottfrois/link_thumbnailer/pull/31)
         
     | 
| 
         @@ -1,4 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'delegate'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'uri'
         
     | 
| 
       2 
3 
     | 
    
         
             
            require 'net/http/persistent'
         
     | 
| 
       3 
4 
     | 
    
         | 
| 
       4 
5 
     | 
    
         
             
            module LinkThumbnailer
         
     | 
| 
         @@ -83,11 +84,11 @@ module LinkThumbnailer 
     | 
|
| 
       83 
84 
     | 
    
         
             
                end
         
     | 
| 
       84 
85 
     | 
    
         | 
| 
       85 
86 
     | 
    
         
             
                def valid_url_format?
         
     | 
| 
       86 
     | 
    
         
            -
                  url.is_a?(URI::HTTP)
         
     | 
| 
      
 87 
     | 
    
         
            +
                  url.is_a?(::URI::HTTP)
         
     | 
| 
       87 
88 
     | 
    
         
             
                end
         
     | 
| 
       88 
89 
     | 
    
         | 
| 
       89 
90 
     | 
    
         
             
                def url=(url)
         
     | 
| 
       90 
     | 
    
         
            -
                  @url = URI(url)
         
     | 
| 
      
 91 
     | 
    
         
            +
                  @url = ::URI.parse(url.to_s)
         
     | 
| 
       91 
92 
     | 
    
         
             
                end
         
     | 
| 
       92 
93 
     | 
    
         | 
| 
       93 
94 
     | 
    
         
             
              end
         
     | 
| 
         @@ -28,17 +28,17 @@ module LinkThumbnailer 
     | 
|
| 
       28 
28 
     | 
    
         
             
                    end
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
30 
     | 
    
         
             
                    def validate_url(url)
         
     | 
| 
       31 
     | 
    
         
            -
                      URI(url)
         
     | 
| 
       32 
     | 
    
         
            -
                    rescue URI::InvalidURIError
         
     | 
| 
      
 31 
     | 
    
         
            +
                      ::URI.parse(url.to_s)
         
     | 
| 
      
 32 
     | 
    
         
            +
                    rescue ::URI::InvalidURIError
         
     | 
| 
       33 
33 
     | 
    
         
             
                      nil
         
     | 
| 
       34 
34 
     | 
    
         
             
                    end
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
                    def needs_prefix?(uri)
         
     | 
| 
       37 
     | 
    
         
            -
                      !uri.is_a?(URI::HTTP)
         
     | 
| 
      
 37 
     | 
    
         
            +
                      !uri.is_a?(::URI::HTTP)
         
     | 
| 
       38 
38 
     | 
    
         
             
                    end
         
     | 
| 
       39 
39 
     | 
    
         | 
| 
       40 
40 
     | 
    
         
             
                    def prefix_uri(uri)
         
     | 
| 
       41 
     | 
    
         
            -
                      URI.join(prefix_url, uri)
         
     | 
| 
      
 41 
     | 
    
         
            +
                      ::URI.join(prefix_url, uri)
         
     | 
| 
       42 
42 
     | 
    
         
             
                    end
         
     | 
| 
       43 
43 
     | 
    
         | 
| 
       44 
44 
     | 
    
         
             
                    def prefix_url
         
     | 
    
        data/spec/processor_spec.rb
    CHANGED
    
    | 
         @@ -2,9 +2,14 @@ require 'spec_helper' 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            describe LinkThumbnailer::Processor do
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
      
 5 
     | 
    
         
            +
              let(:page)      { ::LinkThumbnailer::Page.new(url, {}) }
         
     | 
| 
       5 
6 
     | 
    
         
             
              let(:instance)  { described_class.new }
         
     | 
| 
       6 
7 
     | 
    
         
             
              let(:url)       { 'http://foo.com' }
         
     | 
| 
       7 
8 
     | 
    
         | 
| 
      
 9 
     | 
    
         
            +
              before do
         
     | 
| 
      
 10 
     | 
    
         
            +
                LinkThumbnailer.stub(:page).and_return(page)
         
     | 
| 
      
 11 
     | 
    
         
            +
              end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
       8 
13 
     | 
    
         
             
              describe '#call' do
         
     | 
| 
       9 
14 
     | 
    
         | 
| 
       10 
15 
     | 
    
         
             
                let(:action) { instance.call(url) }
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,34 +1,34 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: link_thumbnailer
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 2.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.0.2
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Pierre-Louis Gottfrois
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014-05- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-05-24 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: activesupport
         
     | 
| 
       15 
15 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       16 
16 
     | 
    
         
             
                requirements:
         
     | 
| 
       17 
     | 
    
         
            -
                - - '>='
         
     | 
| 
      
 17 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
       18 
18 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       19 
19 
     | 
    
         
             
                    version: '3.0'
         
     | 
| 
       20 
20 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       21 
21 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       22 
22 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       23 
23 
     | 
    
         
             
                requirements:
         
     | 
| 
       24 
     | 
    
         
            -
                - - '>='
         
     | 
| 
      
 24 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
       25 
25 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       26 
26 
     | 
    
         
             
                    version: '3.0'
         
     | 
| 
       27 
27 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       28 
28 
     | 
    
         
             
              name: json
         
     | 
| 
       29 
29 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       30 
30 
     | 
    
         
             
                requirements:
         
     | 
| 
       31 
     | 
    
         
            -
                - - '>='
         
     | 
| 
      
 31 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
       32 
32 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       33 
33 
     | 
    
         
             
                    version: 1.7.7
         
     | 
| 
       34 
34 
     | 
    
         
             
                - - ~>
         
     | 
| 
         @@ -38,7 +38,7 @@ dependencies: 
     | 
|
| 
       38 
38 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       39 
39 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       40 
40 
     | 
    
         
             
                requirements:
         
     | 
| 
       41 
     | 
    
         
            -
                - - '>='
         
     | 
| 
      
 41 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
       42 
42 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       43 
43 
     | 
    
         
             
                    version: 1.7.7
         
     | 
| 
       44 
44 
     | 
    
         
             
                - - ~>
         
     | 
| 
         @@ -48,14 +48,14 @@ dependencies: 
     | 
|
| 
       48 
48 
     | 
    
         
             
              name: rake
         
     | 
| 
       49 
49 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       50 
50 
     | 
    
         
             
                requirements:
         
     | 
| 
       51 
     | 
    
         
            -
                - - '>='
         
     | 
| 
      
 51 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
       52 
52 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       53 
53 
     | 
    
         
             
                    version: '0.9'
         
     | 
| 
       54 
54 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       55 
55 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       56 
56 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       57 
57 
     | 
    
         
             
                requirements:
         
     | 
| 
       58 
     | 
    
         
            -
                - - '>='
         
     | 
| 
      
 58 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
       59 
59 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       60 
60 
     | 
    
         
             
                    version: '0.9'
         
     | 
| 
       61 
61 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
         @@ -195,12 +195,12 @@ require_paths: 
     | 
|
| 
       195 
195 
     | 
    
         
             
            - lib
         
     | 
| 
       196 
196 
     | 
    
         
             
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
       197 
197 
     | 
    
         
             
              requirements:
         
     | 
| 
       198 
     | 
    
         
            -
              - - '>='
         
     | 
| 
      
 198 
     | 
    
         
            +
              - - ! '>='
         
     | 
| 
       199 
199 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       200 
200 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       201 
201 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       202 
202 
     | 
    
         
             
              requirements:
         
     | 
| 
       203 
     | 
    
         
            -
              - - '>='
         
     | 
| 
      
 203 
     | 
    
         
            +
              - - ! '>='
         
     | 
| 
       204 
204 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       205 
205 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       206 
206 
     | 
    
         
             
            requirements: []
         
     |