video_thumb 0.1.1 → 0.1.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 +4 -4
- data/README.md +3 -0
- data/lib/video_thumb.rb +6 -7
- data/lib/video_thumb/version.rb +1 -1
- data/test/video_thumb_test.rb +3 -0
- metadata +4 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 3d310daef1433d8f960231e038f0f3a62258218b
         | 
| 4 | 
            +
              data.tar.gz: c6ae920d6209b12a370bf1220d6c9a5362c27651
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 148b558e9220474e38cf83e256e4b37185346579bdf6eda42ac418a83207a4fabbe24b5980da43c8318cafae10dd6749e35d601705a1d1b46d0eb8f773846909
         | 
| 7 | 
            +
              data.tar.gz: 1d94e15b5fb5ad303004c5edb14168fb9d0fa8bf86a63347290bd83ec610ba73ba3f690ae7c7cee3af7bf2a181e40889970896ef342be5015a00e7beef11c887
         | 
    
        data/README.md
    CHANGED
    
    | @@ -80,3 +80,6 @@ VideoThumb::get("http://www.izlesene.com/video/feder-goodbye-feat-lyse/7886121") | |
| 80 80 | 
             
            3. Commit your changes (`git commit -am 'Add some feature'`)
         | 
| 81 81 | 
             
            4. Push to the branch (`git push origin my-new-feature`)
         | 
| 82 82 | 
             
            5. Create a new Pull Request
         | 
| 83 | 
            +
             | 
| 84 | 
            +
            **Thanks**
         | 
| 85 | 
            +
            [deegz](https://github.com/deegz)
         | 
    
        data/lib/video_thumb.rb
    CHANGED
    
    | @@ -20,16 +20,17 @@ module VideoThumb | |
| 20 20 | 
             
                #   thumbnail_medium: 200x150
         | 
| 21 21 | 
             
                #   thumbnail_large: 640xauto
         | 
| 22 22 |  | 
| 23 | 
            -
                 | 
| 23 | 
            +
                case size
         | 
| 24 | 
            +
                when "small"
         | 
| 24 25 | 
             
                  youtube_size  = 'default'
         | 
| 25 26 | 
             
                  vimeo_size    = 'thumbnail_small'
         | 
| 26 | 
            -
                 | 
| 27 | 
            +
                when "medium"
         | 
| 27 28 | 
             
                  youtube_size  = 'mqdefault'
         | 
| 28 29 | 
             
                  vimeo_size    = 'thumbnail_medium'
         | 
| 29 | 
            -
                 | 
| 30 | 
            +
                when "large"
         | 
| 30 31 | 
             
                  youtube_size  = 'sddefault'
         | 
| 31 32 | 
             
                  vimeo_size    = 'thumbnail_large'
         | 
| 32 | 
            -
                 | 
| 33 | 
            +
                when "max"
         | 
| 33 34 | 
             
                  youtube_size  = 'maxresdefault'
         | 
| 34 35 | 
             
                  vimeo_size    = 'thumbnail_large'
         | 
| 35 36 | 
             
                else
         | 
| @@ -45,7 +46,7 @@ module VideoThumb | |
| 45 46 | 
             
                    return image
         | 
| 46 47 | 
             
                  end
         | 
| 47 48 | 
             
                elsif url.include? 'vimeo'
         | 
| 48 | 
            -
                  regex = /^ | 
| 49 | 
            +
                  regex = /^https?:\/\/(?:.*?)\.?(vimeo)\.com\/(\d+).*$/
         | 
| 49 50 | 
             
                  url.gsub(regex) do
         | 
| 50 51 | 
             
                    vimeo_video_id = $2
         | 
| 51 52 | 
             
                    vimeo_video_json_url = 'http://vimeo.com/api/v2/video/%s.json' % vimeo_video_id
         | 
| @@ -58,7 +59,5 @@ module VideoThumb | |
| 58 59 | 
             
                else
         | 
| 59 60 | 
             
                  return false
         | 
| 60 61 | 
             
                end
         | 
| 61 | 
            -
                # http://www.youtube.com/watch?v=tjExIGFO6Zo
         | 
| 62 | 
            -
                # http://www.izlesene.com/video/iyi-gelecek/7842972
         | 
| 63 62 | 
             
              end
         | 
| 64 63 | 
             
            end
         | 
    
        data/lib/video_thumb/version.rb
    CHANGED
    
    
    
        data/test/video_thumb_test.rb
    CHANGED
    
    | @@ -8,4 +8,7 @@ class VideoThumbTest < Minitest::Test | |
| 8 8 | 
             
              def test_vimeo_video
         | 
| 9 9 | 
             
                assert_equal "http://i.vimeocdn.com/video/483188148_640.jpg", VideoThumb::get("http://vimeo.com/101419884")
         | 
| 10 10 | 
             
              end
         | 
| 11 | 
            +
              def test_secure_vimeo_video
         | 
| 12 | 
            +
                assert_equal "http://i.vimeocdn.com/video/483188148_640.jpg", VideoThumb::get("https://vimeo.com/101419884")
         | 
| 13 | 
            +
              end
         | 
| 11 14 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: video_thumb
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Tolga Gezginiş
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2016-02-24 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: json
         | 
| @@ -116,9 +116,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 116 116 | 
             
                  version: '0'
         | 
| 117 117 | 
             
            requirements: []
         | 
| 118 118 | 
             
            rubyforge_project: 
         | 
| 119 | 
            -
            rubygems_version: 2.4. | 
| 119 | 
            +
            rubygems_version: 2.4.8
         | 
| 120 120 | 
             
            signing_key: 
         | 
| 121 121 | 
             
            specification_version: 4
         | 
| 122 122 | 
             
            summary: Youtube, Vimeo and İzlesene thumbnails
         | 
| 123 123 | 
             
            test_files:
         | 
| 124 124 | 
             
            - test/video_thumb_test.rb
         | 
| 125 | 
            +
            has_rdoc: 
         |