video_info 2.3.0 → 2.3.1

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: 2fd291c67498dd89547251a472b9e458f7ac3277
4
- data.tar.gz: 6a4bab53f9e27cdac0dccca1df65f7be4a9823c8
3
+ metadata.gz: b23b675eabd2f73c4be3749f313889419cee3f2b
4
+ data.tar.gz: 3401047502c7d50ae27238de005b3e9bb6200e64
5
5
  SHA512:
6
- metadata.gz: eb12467cb8f6244bc9ff5a968ac3f844a10944412d30bb00e4ba10410019f2d8a276cfa6b96098cb244f350d77fa00fb73af9fc66f146f2f66010ec6397c8a62
7
- data.tar.gz: d3a72a5fd3b05cd20a13d8e16345635a9ab3f8390ed51b6dada347d92363bab66712907c851a62b6b2f1ebc14c1ad92c6b83b43bb8b87e063b789afa451b6de7
6
+ metadata.gz: 03cff744f33c2f4bd479342aa1b49d95776b1a8644052c8fc77050255531e915e0dbcb810ea4d269d3744405a9c0fa053ecda7634c8ef49cb447b0ed0db8f33b
7
+ data.tar.gz: 7ec2496b8484342aa9a766d97487ed93eb9125acf32fade34878157311b9c2c07e91129b088df4014acb7ef213fe4cf19531bcf7e0f1000814c5050aab2343eb
data/README.md CHANGED
@@ -29,7 +29,7 @@ video = VideoInfo.new("http://www.dailymotion.com/video/x7lni3")
29
29
  # video.thumbnail_medium => "http://s2.dmcdn.net/BgWxI/x240-b83.jpg"
30
30
  # video.thumbnail_large => "http://s2.dmcdn.net/BgWxI/x720-YcV.jpg"
31
31
  # video.embed_url => "http://www.dailymotion.com/embed/video/x7lni3"
32
- # video.embed_code => "'<iframe src="http://www.dailymotion.com/embed/video/x7lni3" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'"
32
+ # video.embed_code => "'<iframe src="//www.dailymotion.com/embed/video/x7lni3" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'"
33
33
 
34
34
  video = VideoInfo.new("http://vimeo.com/898029")
35
35
  # video.available? => true
@@ -46,7 +46,7 @@ video = VideoInfo.new("http://vimeo.com/898029")
46
46
  # video.thumbnail_medium => "http://b.vimeocdn.com/ts/343/731/34373130_200.jpg"
47
47
  # video.thumbnail_large => "http://b.vimeocdn.com/ts/343/731/34373130_640.jpg"
48
48
  # video.embed_url => "http://player.vimeo.com/video/898029"
49
- # video.embed_code => "'<iframe src="http://player.vimeo.com/video/898029?title=0&amp;byline=0&amp;portrait=0&amp;autoplay=0" frameborder="0"></iframe>'"
49
+ # video.embed_code => "'<iframe src="//player.vimeo.com/video/898029?title=0&amp;byline=0&amp;portrait=0&amp;autoplay=0" frameborder="0"></iframe>'"
50
50
 
51
51
  video = VideoInfo.new("http://www.youtube.com/watch?v=mZqGqE0D0n4")
52
52
  # video.available? => true
@@ -60,7 +60,7 @@ video = VideoInfo.new("http://www.youtube.com/watch?v=mZqGqE0D0n4")
60
60
  # video.thumbnail_medium => "http://i.ytimg.com/vi/mZqGqE0D0n4/mqdefault.jpg"
61
61
  # video.thumbnail_large => "http://i.ytimg.com/vi/mZqGqE0D0n4/hqdefault.jpg"
62
62
  # video.embed_url => "http://www.youtube.com/embed/mZqGqE0D0n4"
63
- # video.embed_code => "'<iframe src="http://www.youtube.com/embed/mZqGqE0D0n4" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'"
63
+ # video.embed_code => "'<iframe src="//www.youtube.com/embed/mZqGqE0D0n4" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'"
64
64
 
65
65
  playlist = VideoInfo.new("http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr")
66
66
  # playlist.available? => true
@@ -71,7 +71,7 @@ playlist = VideoInfo.new("http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RI
71
71
  # playlist.thumbnail_medium => "http://i.ytimg.com/vi/8b0aEoxqqC0/mqdefault.jpg"
72
72
  # playlist.thumbnail_large => "http://i.ytimg.com/vi/8b0aEoxqqC0/hqdefault.jpg"
73
73
  # playlist.embed_url => "http://www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr"
74
- # playlist.embed_code => "<iframe src="http://www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" frameborder="0" allowfullscreen="allowfullscreen"></iframe>"
74
+ # playlist.embed_code => "<iframe src="//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" frameborder="0" allowfullscreen="allowfullscreen"></iframe>"
75
75
  # playlist.videos => [VideoInfo.new('http://www.youtube.com/watch?v=_Bt3-WsHfB0'), VideoInfo.new('http://www.youtube.com/watch?v=9g2U12SsRns'), VideoInfo.new('http://www.youtube.com/watch?v=8b0aEoxqqC0'), VideoInfo.new('http://www.youtube.com/watch?v=6c3mHikRz0I'), VideoInfo.new('http://www.youtube.com/watch?v=OQVHWsTHcoc')]
76
76
 
77
77
  playlist = VideoInfo.new("http://vimeo.com/album/2755718")
@@ -83,7 +83,7 @@ playlist = VideoInfo.new("http://vimeo.com/album/2755718")
83
83
  # playlist.thumbnail_medium => "http://b.vimeocdn.com/ts/443/595/443595474_200.jpg"
84
84
  # playlist.thumbnail_large => "http://b.vimeocdn.com/ts/443/595/443595474_640.jpg"
85
85
  # playlist.embed_url => "player.vimeo.com/hubnut/album/2755718"
86
- # playlist.embed_code => "<iframe src="http://player.vimeo.com/hubnut/album/2755718?autoplay=0&byline=0&portrait=0&title=0" frameborder="0"></iframe>"
86
+ # playlist.embed_code => "<iframe src="//player.vimeo.com/hubnut/album/2755718?autoplay=0&byline=0&portrait=0&title=0" frameborder="0"></iframe>"
87
87
  # playlist.videos => [VideoInfo.new('http://vimeo.com/67977038'), VideoInfo.new('http://vimeo.com/68843810'), VideoInfo.new('http://vimeo.com/69949597'), VideoInfo.new('http://vimeo.com/70388245')]
88
88
  ```
89
89
 
@@ -111,10 +111,10 @@ You can also include an `iframe_attributes` or `url_attributes` hash to the `emb
111
111
 
112
112
  ``` ruby
113
113
  VideoInfo.new("http://www.youtube.com/watch?v=mZqGqE0D0n4").embed_code(iframe_attributes: { width: 800, height: 600, "data-key" => "value" })
114
- => '<iframe src="http://www.youtube.com/embed/mZqGqE0D0n4" frameborder="0" allowfullscreen="allowfullscreen" width="800" height="600" data-key="value"></iframe>
114
+ => '<iframe src="//www.youtube.com/embed/mZqGqE0D0n4" frameborder="0" allowfullscreen="allowfullscreen" width="800" height="600" data-key="value"></iframe>
115
115
 
116
116
  'VideoInfo.new("http://www.youtube.com/watch?v=mZqGqE0D0n4").embed_code(url_attributes: { autoplay: 1 })
117
- => '<iframe src="http://www.youtube.com/embed/mZqGqE0D0n4?autoplay=1" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'
117
+ => '<iframe src="//www.youtube.com/embed/mZqGqE0D0n4?autoplay=1" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'
118
118
  ```
119
119
 
120
120
  Author
@@ -87,11 +87,10 @@ class VideoInfo
87
87
  end
88
88
 
89
89
  def _embed_url(options)
90
- url_scheme = options.fetch(:url_scheme, 'http')
91
90
  url_attrs = options.fetch(:url_attributes, {})
92
91
  url_attrs = _default_url_attributes.merge(url_attrs)
93
92
 
94
- url = "#{url_scheme}://#{embed_url}"
93
+ url = embed_url
95
94
  url += "?#{_hash_to_params(url_attrs)}" unless url_attrs.empty?
96
95
  url
97
96
  end
@@ -23,7 +23,7 @@ class VideoInfo
23
23
  end
24
24
 
25
25
  def embed_url
26
- "www.dailymotion.com/embed/video/#{video_id}"
26
+ "//www.dailymotion.com/embed/video/#{video_id}"
27
27
  end
28
28
 
29
29
  def date
@@ -23,7 +23,7 @@ class VideoInfo
23
23
  end
24
24
 
25
25
  def embed_url
26
- "player.vimeo.com/video/#{video_id}"
26
+ "//player.vimeo.com/video/#{video_id}"
27
27
  end
28
28
 
29
29
  def date
@@ -15,7 +15,7 @@ class VideoInfo
15
15
  end
16
16
 
17
17
  def embed_url
18
- "player.vimeo.com/hubnut/album/#{playlist_id}"
18
+ "//player.vimeo.com/hubnut/album/#{playlist_id}"
19
19
  end
20
20
 
21
21
  %w[width height date keywords duration view_count].each do |method|
@@ -42,7 +42,7 @@ class VideoInfo
42
42
  end
43
43
 
44
44
  def embed_url
45
- "vk.com/video_ext.php?oid=#{video_owner}&id=#{video_id}&hash=#{_data_hash}"
45
+ "//vk.com/video_ext.php?oid=#{video_owner}&id=#{video_id}&hash=#{_data_hash}"
46
46
  end
47
47
 
48
48
  def duration
@@ -27,7 +27,7 @@ class VideoInfo
27
27
  end
28
28
 
29
29
  def embed_url
30
- "www.youtube.com/embed/#{video_id}"
30
+ "//www.youtube.com/embed/#{video_id}"
31
31
  end
32
32
 
33
33
  def date
@@ -15,7 +15,7 @@ class VideoInfo
15
15
  end
16
16
 
17
17
  def embed_url
18
- "www.youtube.com/embed/videoseries?list=#{playlist_id}"
18
+ "//www.youtube.com/embed/videoseries?list=#{playlist_id}"
19
19
  end
20
20
 
21
21
  def description
@@ -1,3 +1,3 @@
1
1
  class VideoInfo
2
- VERSION = '2.3.0'
2
+ VERSION = '2.3.1'
3
3
  end
@@ -7,7 +7,7 @@ describe VideoInfo::Provider do
7
7
  end
8
8
 
9
9
  def embed_url
10
- "foo.com"
10
+ "//foo.com"
11
11
  end
12
12
 
13
13
  def _default_url_attributes; {} end
@@ -44,16 +44,12 @@ describe VideoInfo::Provider do
44
44
  end
45
45
 
46
46
  describe "embed_code" do
47
- it "supports url_scheme option" do
48
- expect(provider.embed_code(url_scheme: 'https')).to eq '<iframe src="https://foo.com" frameborder="0"></iframe>'
49
- end
50
-
51
47
  it "supports url_attributes option" do
52
- expect(provider.embed_code(url_attributes: { foo: 'bar' })).to eq '<iframe src="http://foo.com?foo=bar" frameborder="0"></iframe>'
48
+ expect(provider.embed_code(url_attributes: { foo: 'bar' })).to eq '<iframe src="//foo.com?foo=bar" frameborder="0"></iframe>'
53
49
  end
54
50
 
55
51
  it "supports url_attributes option" do
56
- expect(provider.embed_code(iframe_attributes: { foo: 'bar' })).to eq '<iframe src="http://foo.com" frameborder="0" foo="bar"></iframe>'
52
+ expect(provider.embed_code(iframe_attributes: { foo: 'bar' })).to eq '<iframe src="//foo.com" frameborder="0" foo="bar"></iframe>'
57
53
  end
58
54
  end
59
55
 
@@ -40,8 +40,8 @@ describe VideoInfo::Providers::Dailymotion do
40
40
  its(:provider) { should eq 'Dailymotion' }
41
41
  its(:video_id) { should eq 'x7lni3' }
42
42
  its(:url) { should eq 'http://www.dailymotion.com/video/x7lni3' }
43
- its(:embed_url) { should eq 'www.dailymotion.com/embed/video/x7lni3' }
44
- its(:embed_code) { should eq '<iframe src="http://www.dailymotion.com/embed/video/x7lni3?autoplay=0" frameborder="0"></iframe>' }
43
+ its(:embed_url) { should eq '//www.dailymotion.com/embed/video/x7lni3' }
44
+ its(:embed_code) { should eq '<iframe src="//www.dailymotion.com/embed/video/x7lni3?autoplay=0" frameborder="0"></iframe>' }
45
45
  its(:title) { should eq 'Mario Kart (Rémi Gaillard)' }
46
46
  its(:description) { should eq 'Super Rémi Kart est un jeu vidéo de course développé et édité par N\'Importe Quoi TV. Sa principale originalité vient de sa réalité...<br />L\'aventure continue sur www.nimportequi.com' }
47
47
  its(:keywords) { should eq ["rémi","remi","gaillard","imposteur","imposture","mario","bros","kart","nintendo","jeux"] }
@@ -53,8 +53,8 @@ describe VideoInfo::Providers::VimeoPlaylist do
53
53
  its(:provider) { should eq 'Vimeo' }
54
54
  its(:playlist_id) { should eq '2755718' }
55
55
  its(:url) { should eq 'http://vimeo.com/album/2755718' }
56
- its(:embed_url) { should eq 'player.vimeo.com/hubnut/album/2755718' }
57
- its(:embed_code) { should eq '<iframe src="http://player.vimeo.com/hubnut/album/2755718?autoplay=0&byline=0&portrait=0&title=0" frameborder="0"></iframe>' }
56
+ its(:embed_url) { should eq '//player.vimeo.com/hubnut/album/2755718' }
57
+ its(:embed_code) { should eq '<iframe src="//player.vimeo.com/hubnut/album/2755718?autoplay=0&byline=0&portrait=0&title=0" frameborder="0"></iframe>' }
58
58
  its(:title) { should eq 'The Century Of Self' }
59
59
  its(:description) { should eq 'The Century of the Self is an award-winning British television documentary series by Adam Curtis, released in 2002.' }
60
60
  its(:keywords) { should be_nil }
@@ -49,8 +49,8 @@ describe VideoInfo::Providers::Vimeo do
49
49
  its(:provider) { should eq 'Vimeo' }
50
50
  its(:video_id) { should eq '898029' }
51
51
  its(:url) { should eq 'http://www.vimeo.com/898029' }
52
- its(:embed_url) { should eq 'player.vimeo.com/video/898029' }
53
- its(:embed_code) { should eq '<iframe src="http://player.vimeo.com/video/898029?autoplay=0&byline=0&portrait=0&title=0" frameborder="0"></iframe>' }
52
+ its(:embed_url) { should eq '//player.vimeo.com/video/898029' }
53
+ its(:embed_code) { should eq '<iframe src="//player.vimeo.com/video/898029?autoplay=0&byline=0&portrait=0&title=0" frameborder="0"></iframe>' }
54
54
  its(:title) { should eq 'Cherry Bloom - King Of The Knife' }
55
55
  its(:description) { should eq 'The first video from the upcoming album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net' }
56
56
  its(:keywords) { should eq 'cherry bloom, secret sounds, king of the knife, rock, alternative' }
@@ -37,8 +37,8 @@ describe VideoInfo::Providers::Vkontakte do
37
37
  its(:video_owner) { should eq '39576223' }
38
38
  its(:video_id) { should eq '108370515' }
39
39
  its(:url) { should eq 'http://vk.com/video39576223_108370515' }
40
- its(:embed_url) { should eq 'vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af' }
41
- its(:embed_code) { should eq '<iframe src="http://vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
40
+ its(:embed_url) { should eq '//vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af' }
41
+ its(:embed_code) { should eq '<iframe src="//vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
42
42
  its(:title) { should eq 'Я уточка))))) | VK' }
43
43
  its(:description) { should eq 'это ВЗРЫВ МОЗГА!!! Просто отвал башки...' }
44
44
  its(:keywords) { should eq 'это ВЗРЫВ МОЗГА!!! Просто отвал башки...' }
@@ -48,8 +48,8 @@ describe VideoInfo::Providers::YoutubePlaylist do
48
48
  its(:provider) { should eq 'YouTube' }
49
49
  its(:playlist_id) { should eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
50
50
  its(:url) { should eq 'http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
51
- its(:embed_url) { should eq 'www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
52
- its(:embed_code) { should eq '<iframe src="http://www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
51
+ its(:embed_url) { should eq '//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
52
+ its(:embed_code) { should eq '<iframe src="//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
53
53
  its(:title) { should eq 'YouTube Policy and Copyright' }
54
54
  its(:description) { should eq 'Learn more about copyright basics, flagging, and the YouTube community.' }
55
55
  its(:keywords) { should be_nil }
@@ -49,8 +49,8 @@ describe VideoInfo::Providers::Youtube do
49
49
  its(:provider) { should eq 'YouTube' }
50
50
  its(:video_id) { should eq 'mZqGqE0D0n4' }
51
51
  its(:url) { should eq 'http://www.youtube.com/watch?v=mZqGqE0D0n4' }
52
- its(:embed_url) { should eq 'www.youtube.com/embed/mZqGqE0D0n4' }
53
- its(:embed_code) { should eq '<iframe src="http://www.youtube.com/embed/mZqGqE0D0n4" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
52
+ its(:embed_url) { should eq '//www.youtube.com/embed/mZqGqE0D0n4' }
53
+ its(:embed_code) { should eq '<iframe src="//www.youtube.com/embed/mZqGqE0D0n4" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
54
54
  its(:title) { should eq 'Cherry Bloom - King Of The Knife' }
55
55
  its(:description) { should eq 'The first video from the upcoming album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net' }
56
56
  its(:keywords) { should be_nil }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: video_info
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibaud Guillaume-Gentil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-01 00:00:00.000000000 Z
11
+ date: 2014-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable