video_info 1.6.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +0 -3
  3. data/Gemfile +1 -1
  4. data/README.md +11 -11
  5. data/Rakefile +1 -1
  6. data/lib/video_info.rb +30 -7
  7. data/lib/video_info/provider.rb +15 -8
  8. data/lib/video_info/providers/vimeo.rb +7 -11
  9. data/lib/video_info/providers/vkontakte.rb +30 -49
  10. data/lib/video_info/providers/youtube.rb +5 -5
  11. data/lib/video_info/version.rb +2 -2
  12. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/date/.yml +14 -14
  13. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/description/.yml +16 -14
  14. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/duration/.yml +17 -15
  15. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/height/.yml +16 -14
  16. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/keywords/.yml +17 -15
  17. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/thumbnail_large/.yml +15 -13
  18. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/thumbnail_medium/.yml +16 -14
  19. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/thumbnail_small/.yml +15 -13
  20. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/title/.yml +16 -14
  21. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/view_count/.yml +17 -15
  22. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/width/.yml +16 -14
  23. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/description/.yml +1024 -1336
  24. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/duration/.yml +1024 -1336
  25. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/embed_code/.yml +1036 -1348
  26. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/embed_url/.yml +1036 -1348
  27. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/height/.yml +1024 -1336
  28. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/keywords/.yml +1098 -0
  29. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/title/.yml +1036 -1348
  30. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/view_count/.yml +1024 -1336
  31. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/width/.yml +1024 -1336
  32. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/date/.yml +14 -13
  33. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/description/.yml +14 -13
  34. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/duration/.yml +14 -13
  35. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/keywords/.yml +14 -13
  36. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/thumbnail_large/.yml +14 -13
  37. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/thumbnail_medium/.yml +14 -13
  38. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/thumbnail_small/.yml +14 -13
  39. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/title/.yml +16 -15
  40. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/view_count/.yml +14 -13
  41. data/spec/lib/video_info/provider_spec.rb +29 -9
  42. data/spec/lib/video_info/providers/vimeo_spec.rb +11 -11
  43. data/spec/lib/video_info/providers/vkontakte_spec.rb +4 -3
  44. data/spec/lib/video_info/providers/youtube_spec.rb +19 -19
  45. data/spec/lib/video_info_spec.rb +23 -23
  46. data/spec/spec_helper.rb +8 -2
  47. data/video_info.gemspec +5 -2
  48. metadata +6 -104
  49. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/embed_code/.yml +0 -69
  50. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/embed_url/.yml +0 -69
  51. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/provider/.yml +0 -69
  52. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/url/.yml +0 -69
  53. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/video_id/.yml +0 -69
  54. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029_and_iframe_attributes/.yml +0 -69
  55. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029_and_url_attributes/.yml +0 -69
  56. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029_in_/group/_url/provider/.yml +0 -69
  57. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029_in_/group/_url/video_id/.yml +0 -69
  58. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029_in_text/provider/.yml +0 -69
  59. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029_in_text/video_id/.yml +0 -69
  60. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/date/.yml +0 -1410
  61. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/provider/.yml +0 -1410
  62. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/url/.yml +0 -1410
  63. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/video_id/.yml +0 -1410
  64. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/video_owner/.yml +0 -1369
  65. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_arbitrary_iframe_attributes/.yml +0 -62
  66. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_arbitrary_iframe_attributes/provider/.yml +0 -62
  67. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_iframe_attributes/.yml +0 -62
  68. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_iframe_attributes/provider/.yml +0 -62
  69. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_JM9NgvjjVng_in_youtu_be_url/provider/.yml +0 -65
  70. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_JM9NgvjjVng_in_youtu_be_url/video_id/.yml +0 -65
  71. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_VeasFckfMHY_after_params/provider/.yml +0 -66
  72. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_VeasFckfMHY_after_params/url/.yml +0 -66
  73. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_VeasFckfMHY_after_params/video_id/.yml +0 -66
  74. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_VeasFckfMHY_in_e_path/provider/.yml +0 -66
  75. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_VeasFckfMHY_in_e_path/video_id/.yml +0 -66
  76. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_VeasFckfMHY_in_embed_path/provider/.yml +0 -66
  77. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_VeasFckfMHY_in_embed_path/video_id/.yml +0 -66
  78. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_VeasFckfMHY_in_path/provider/.yml +0 -66
  79. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_VeasFckfMHY_in_path/video_id/.yml +0 -66
  80. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_VeasFckfMHY_in_user_url/provider/.yml +0 -66
  81. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_VeasFckfMHY_in_user_url/url/.yml +0 -66
  82. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_VeasFckfMHY_in_user_url/video_id/.yml +0 -66
  83. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_Xp6CXF-Cesg/provider/.yml +0 -62
  84. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_Xp6CXF-Cesg/video_id/.yml +0 -62
  85. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/embed_code/.yml +0 -62
  86. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/embed_url/.yml +0 -62
  87. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/height/.yml +0 -62
  88. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/provider/.yml +0 -62
  89. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/url/.yml +0 -62
  90. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/video_id/.yml +0 -62
  91. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/width/.yml +0 -62
  92. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_oQ49W_xKzKA/.yml +0 -62
  93. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_oQ49W_xKzKA/provider/.yml +0 -62
  94. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_oQ49W_xKzKA/video_id/.yml +0 -62
  95. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_url_in_text/provider/.yml +0 -62
  96. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_url_in_text/video_id/.yml +0 -62
  97. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/without_http_or_www/provider/.yml +0 -65
  98. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/without_http_or_www/video_id/.yml +0 -65
@@ -8,7 +8,7 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - VideoInfo/1.5.0
11
+ - VideoInfo/2.0.0
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
@@ -25,9 +25,9 @@ http_interactions:
25
25
  Access-Control-Allow-Origin:
26
26
  - '*'
27
27
  Expires:
28
- - Mon, 07 Oct 2013 19:53:17 GMT
28
+ - Fri, 25 Oct 2013 20:34:01 GMT
29
29
  Date:
30
- - Mon, 07 Oct 2013 19:53:17 GMT
30
+ - Fri, 25 Oct 2013 20:34:01 GMT
31
31
  Cache-Control:
32
32
  - private, max-age=300, no-transform
33
33
  Vary:
@@ -35,9 +35,9 @@ http_interactions:
35
35
  Gdata-Version:
36
36
  - '2.1'
37
37
  Etag:
38
- - W/"D0AFQH47eCp7I2A9WhBXE0g."
38
+ - W/"CkAMQ347eCp7I2A9Wh5SE08."
39
39
  Last-Modified:
40
- - Wed, 27 Mar 2013 03:41:51 GMT
40
+ - Wed, 09 Oct 2013 12:13:02 GMT
41
41
  X-Content-Type-Options:
42
42
  - nosniff
43
43
  X-Frame-Options:
@@ -45,18 +45,19 @@ http_interactions:
45
45
  X-Xss-Protection:
46
46
  - 1; mode=block
47
47
  Content-Length:
48
- - '4658'
48
+ - '4652'
49
49
  Server:
50
50
  - GSE
51
51
  Alternate-Protocol:
52
52
  - 80:quic
53
53
  body:
54
54
  encoding: UTF-8
55
- string: '{"version":"1.0","encoding":"UTF-8","entry":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$media":"http://search.yahoo.com/mrss/","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$yt":"http://gdata.youtube.com/schemas/2007","gd$etag":"W/\"D0AFQH47eCp7I2A9WhBXE0g.\"","id":{"$t":"tag:youtube.com,2008:video:mZqGqE0D0n4"},"published":{"$t":"2008-04-12T22:25:35.000Z"},"updated":{"$t":"2013-03-27T03:41:51.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#video"},{"scheme":"http://gdata.youtube.com/schemas/2007/categories.cat","term":"Music","label":"Music"}],"title":{"$t":"Cherry
56
- Bloom - King Of The Knife"},"content":{"type":"application/x-shockwave-flash","src":"http://www.youtube.com/v/mZqGqE0D0n4?version=3&f=videos&app=youtube_gdata"},"link":[{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=mZqGqE0D0n4&feature=youtube_gdata"},{"rel":"http://gdata.youtube.com/schemas/2007#video.responses","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4/responses?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#video.related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4/related?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#uploader","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/users/zxQk-rZGowoqMBKxGD5jSA?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4?v=2"}],"author":[{"name":{"$t":"cherrybloomband"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/cherrybloomband"},"yt$userId":{"$t":"zxQk-rZGowoqMBKxGD5jSA"}}],"yt$accessControl":[{"action":"comment","permission":"allowed"},{"action":"commentVote","permission":"allowed"},{"action":"videoRespond","permission":"allowed"},{"action":"rate","permission":"allowed"},{"action":"embed","permission":"allowed"},{"action":"list","permission":"allowed"},{"action":"autoPlay","permission":"allowed"},{"action":"syndicate","permission":"allowed"}],"gd$comments":{"gd$feedLink":{"rel":"http://gdata.youtube.com/schemas/2007#comments","href":"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4/comments?v=2","countHint":15}},"media$group":{"media$category":[{"$t":"Music","label":"Music","scheme":"http://gdata.youtube.com/schemas/2007/categories.cat"}],"media$content":[{"url":"http://www.youtube.com/v/mZqGqE0D0n4?version=3&f=videos&app=youtube_gdata","type":"application/x-shockwave-flash","medium":"video","isDefault":"true","expression":"full","duration":175,"yt$format":5},{"url":"rtsp://r5---sn-5hn7su7k.c.youtube.com/CiILENy73wIaGQl-0gNNqIaamRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":175,"yt$format":1},{"url":"rtsp://r5---sn-5hn7su7k.c.youtube.com/CiILENy73wIaGQl-0gNNqIaamRMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":175,"yt$format":6}],"media$credit":[{"$t":"cherrybloomband","role":"uploader","scheme":"urn:youtube","yt$display":"cherrybloomband"}],"media$description":{"$t":"The
57
- first video from the upcoming album Secret Sounds, to download in-stores April
58
- 14. Checkout http://www.cherrybloom.net","type":"plain"},"media$keywords":{},"media$license":{"$t":"youtube","type":"text/html","href":"http://www.youtube.com/t/terms"},"media$player":{"url":"http://www.youtube.com/watch?v=mZqGqE0D0n4&feature=youtube_gdata_player"},"media$thumbnail":[{"url":"http://i1.ytimg.com/vi/mZqGqE0D0n4/default.jpg","height":90,"width":120,"time":"00:01:27.500","yt$name":"default"},{"url":"http://i1.ytimg.com/vi/mZqGqE0D0n4/mqdefault.jpg","height":180,"width":320,"yt$name":"mqdefault"},{"url":"http://i1.ytimg.com/vi/mZqGqE0D0n4/hqdefault.jpg","height":360,"width":480,"yt$name":"hqdefault"},{"url":"http://i1.ytimg.com/vi/mZqGqE0D0n4/1.jpg","height":90,"width":120,"time":"00:00:43.750","yt$name":"start"},{"url":"http://i1.ytimg.com/vi/mZqGqE0D0n4/2.jpg","height":90,"width":120,"time":"00:01:27.500","yt$name":"middle"},{"url":"http://i1.ytimg.com/vi/mZqGqE0D0n4/3.jpg","height":90,"width":120,"time":"00:02:11.250","yt$name":"end"}],"media$title":{"$t":"Cherry
59
- Bloom - King Of The Knife","type":"plain"},"yt$duration":{"seconds":"175"},"yt$uploaded":{"$t":"2008-04-12T22:25:35.000Z"},"yt$uploaderId":{"$t":"UCzxQk-rZGowoqMBKxGD5jSA"},"yt$videoid":{"$t":"mZqGqE0D0n4"}},"gd$rating":{"average":4.822222,"max":5,"min":1,"numRaters":45,"rel":"http://schemas.google.com/g/2005#overall"},"yt$statistics":{"favoriteCount":"0","viewCount":"6243"},"yt$rating":{"numDislikes":"2","numLikes":"43"}}}'
55
+ string: '{"version":"1.0","encoding":"UTF-8","entry":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$media":"http://search.yahoo.com/mrss/","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$yt":"http://gdata.youtube.com/schemas/2007","gd$etag":"W/\"CkAMQ347eCp7I2A9Wh5SE08.\"","id":{"$t":"tag:youtube.com,2008:video:mZqGqE0D0n4"},"published":{"$t":"2008-04-12T22:25:35.000Z"},"updated":{"$t":"2013-10-09T12:13:02.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#video"},{"scheme":"http://gdata.youtube.com/schemas/2007/categories.cat","term":"Music","label":"Music"}],"title":{"$t":"Cherry
56
+ Bloom - King Of The Knife"},"content":{"type":"application/x-shockwave-flash","src":"http://www.youtube.com/v/mZqGqE0D0n4?version=3&f=videos&app=youtube_gdata"},"link":[{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=mZqGqE0D0n4&feature=youtube_gdata"},{"rel":"http://gdata.youtube.com/schemas/2007#video.responses","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4/responses?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#video.related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4/related?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#uploader","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/users/zxQk-rZGowoqMBKxGD5jSA?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4?v=2"}],"author":[{"name":{"$t":"Cherry
57
+ Bloom"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/cherrybloomband"},"yt$userId":{"$t":"zxQk-rZGowoqMBKxGD5jSA"}}],"yt$accessControl":[{"action":"comment","permission":"allowed"},{"action":"commentVote","permission":"allowed"},{"action":"videoRespond","permission":"allowed"},{"action":"rate","permission":"allowed"},{"action":"embed","permission":"allowed"},{"action":"list","permission":"allowed"},{"action":"autoPlay","permission":"allowed"},{"action":"syndicate","permission":"allowed"}],"gd$comments":{"gd$feedLink":{"rel":"http://gdata.youtube.com/schemas/2007#comments","href":"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4/comments?v=2","countHint":15}},"media$group":{"media$category":[{"$t":"Music","label":"Music","scheme":"http://gdata.youtube.com/schemas/2007/categories.cat"}],"media$content":[{"url":"http://www.youtube.com/v/mZqGqE0D0n4?version=3&f=videos&app=youtube_gdata","type":"application/x-shockwave-flash","medium":"video","isDefault":"true","expression":"full","duration":175,"yt$format":5},{"url":"rtsp://r5---sn-4g57kuez.c.youtube.com/CiILENy73wIaGQl-0gNNqIaamRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":175,"yt$format":1},{"url":"rtsp://r5---sn-4g57kuez.c.youtube.com/CiILENy73wIaGQl-0gNNqIaamRMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":175,"yt$format":6}],"media$credit":[{"$t":"cherrybloomband","role":"uploader","scheme":"urn:youtube","yt$display":"Cherry
58
+ Bloom"}],"media$description":{"$t":"The first video from the upcoming album
59
+ Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net","type":"plain"},"media$keywords":{},"media$license":{"$t":"youtube","type":"text/html","href":"http://www.youtube.com/t/terms"},"media$player":{"url":"http://www.youtube.com/watch?v=mZqGqE0D0n4&feature=youtube_gdata_player"},"media$thumbnail":[{"url":"http://i1.ytimg.com/vi/mZqGqE0D0n4/default.jpg","height":90,"width":120,"time":"00:01:27.500","yt$name":"default"},{"url":"http://i1.ytimg.com/vi/mZqGqE0D0n4/mqdefault.jpg","height":180,"width":320,"yt$name":"mqdefault"},{"url":"http://i1.ytimg.com/vi/mZqGqE0D0n4/hqdefault.jpg","height":360,"width":480,"yt$name":"hqdefault"},{"url":"http://i1.ytimg.com/vi/mZqGqE0D0n4/1.jpg","height":90,"width":120,"time":"00:00:43.750","yt$name":"start"},{"url":"http://i1.ytimg.com/vi/mZqGqE0D0n4/2.jpg","height":90,"width":120,"time":"00:01:27.500","yt$name":"middle"},{"url":"http://i1.ytimg.com/vi/mZqGqE0D0n4/3.jpg","height":90,"width":120,"time":"00:02:11.250","yt$name":"end"}],"media$title":{"$t":"Cherry
60
+ Bloom - King Of The Knife","type":"plain"},"yt$duration":{"seconds":"175"},"yt$uploaded":{"$t":"2008-04-12T22:25:35.000Z"},"yt$uploaderId":{"$t":"UCzxQk-rZGowoqMBKxGD5jSA"},"yt$videoid":{"$t":"mZqGqE0D0n4"}},"gd$rating":{"average":4.822222,"max":5,"min":1,"numRaters":45,"rel":"http://schemas.google.com/g/2005#overall"},"yt$statistics":{"favoriteCount":"0","viewCount":"6264"},"yt$rating":{"numDislikes":"2","numLikes":"43"}}}'
60
61
  http_version:
61
- recorded_at: Mon, 07 Oct 2013 19:57:36 GMT
62
- recorded_with: VCR 2.5.0
62
+ recorded_at: Fri, 25 Oct 2013 20:34:02 GMT
63
+ recorded_with: VCR 2.6.0
@@ -1,42 +1,62 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe VideoInfo::Provider do
4
-
5
4
  class ProviderFu < VideoInfo::Provider
6
5
  def _url_regex
7
6
  /foo\/(\d)/
8
7
  end
8
+
9
+ def embed_url
10
+ "foo.com"
11
+ end
12
+
13
+ def _default_url_attributes; {} end
14
+ def _default_iframe_attributes; {} end
9
15
  end
16
+ let(:url) { 'url' }
17
+ let(:options) { { } }
18
+ let(:provider) { ProviderFu.new('foo/1', options) }
10
19
 
11
20
  describe "initialize" do
12
- let(:url) { 'url' }
13
- let(:options) { { } }
14
- let(:provider) { ProviderFu.new(url, options) }
15
21
 
16
22
  it { expect { VideoInfo::Provider.new(url) }.to raise_error(NotImplementedError, 'Provider class must implement #_url_regex private method') }
17
- it { expect { ProviderFu.new('foo/1') }.to raise_error(NotImplementedError, 'Provider class must implement #_api_url private method') }
23
+ it { expect { provider.data }.to raise_error(NotImplementedError, 'Provider class must implement #_api_url private method') }
18
24
 
19
25
  it "sets default user_agent options" do
20
- provider.options.should eq({ 'User-Agent' => "VideoInfo/#{VideoInfo::VERSION}" })
26
+ expect(provider.options).to eq({ 'User-Agent' => "VideoInfo/#{VideoInfo::VERSION}" })
21
27
  end
22
28
 
23
29
  context "with custom User-Agent options" do
24
30
  let(:options) { { 'User-Agent' => 'Test User Agent / 1.0' } }
25
31
 
26
32
  it "sets the option" do
27
- provider.options.should eq({ 'User-Agent' => 'Test User Agent / 1.0' })
33
+ expect(provider.options).to eq({ 'User-Agent' => 'Test User Agent / 1.0' })
28
34
  end
29
35
  end
30
36
 
31
37
  context "with Referer options" do
32
- let(:options) { { :referer => 'http://google.com' } }
38
+ let(:options) { { referer: 'http://google.com' } }
33
39
 
34
40
  it "sets the option" do
35
- provider.options.should include({ 'Referer' => 'http://google.com' })
41
+ expect(provider.options).to include({ 'Referer' => 'http://google.com' })
36
42
  end
37
43
  end
38
44
  end
39
45
 
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
+ 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>'
53
+ end
54
+
55
+ 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>'
57
+ end
58
+ end
59
+
40
60
  describe ".usable?" do
41
61
  it { expect { VideoInfo::Provider.usable?('url') }.to raise_error(NotImplementedError, 'Provider class must implement .usable? public method') }
42
62
  end
@@ -17,12 +17,12 @@ describe VideoInfo::Providers::Vimeo do
17
17
  end
18
18
 
19
19
  context "with video 898029", :vcr do
20
- subject { VideoInfo.get('http://www.vimeo.com/898029') }
20
+ subject { VideoInfo.new('http://www.vimeo.com/898029') }
21
21
 
22
22
  its(:provider) { should eq 'Vimeo' }
23
23
  its(:video_id) { should eq '898029' }
24
- its(:url) { should eq 'http://vimeo.com/898029' }
25
- its(:embed_url) { should eq 'http://player.vimeo.com/video/898029' }
24
+ its(:url) { should eq 'http://www.vimeo.com/898029' }
25
+ its(:embed_url) { should eq 'player.vimeo.com/video/898029' }
26
26
  its(:embed_code) { should eq '<iframe src="http://player.vimeo.com/video/898029?autoplay=0&byline=0&portrait=0&title=0" frameborder="0"></iframe>' }
27
27
  its(:title) { should eq 'Cherry Bloom - King Of The Knife' }
28
28
  its(:description) { should eq 'The first video from the upcoming album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net' }
@@ -38,34 +38,34 @@ describe VideoInfo::Providers::Vimeo do
38
38
  end
39
39
 
40
40
  context "with video 898029 and url_attributes", :vcr do
41
- subject { VideoInfo.get('http://www.vimeo.com/898029') }
41
+ subject { VideoInfo.new('http://www.vimeo.com/898029') }
42
42
 
43
- it { subject.embed_code(:url_attributes => { :autoplay => 1 }).should match(/autoplay=1/) }
43
+ it { expect(subject.embed_code(url_attributes: { autoplay: 1 })).to match(/autoplay=1/) }
44
44
  end
45
45
 
46
46
  context "with video 898029 and iframe_attributes", :vcr do
47
- subject { VideoInfo.get('http://www.vimeo.com/898029') }
47
+ subject { VideoInfo.new('http://www.vimeo.com/898029') }
48
48
 
49
- it { subject.embed_code(:iframe_attributes => { :width => 800, :height => 600 }).should match(/width="800"/) }
50
- it { subject.embed_code(:iframe_attributes => { :width => 800, :height => 600 }).should match(/height="600"/) }
49
+ it { expect(subject.embed_code(iframe_attributes: { width: 800, height: 600 })).to match(/width="800"/) }
50
+ it { expect(subject.embed_code(iframe_attributes: { width: 800, height: 600 })).to match(/height="600"/) }
51
51
  end
52
52
 
53
53
  context "with video 898029 in /group/ url", :vcr do
54
- subject { VideoInfo.get('http://vimeo.com/groups/1234/videos/898029') }
54
+ subject { VideoInfo.new('http://vimeo.com/groups/1234/videos/898029') }
55
55
 
56
56
  its(:provider) { should eq 'Vimeo' }
57
57
  its(:video_id) { should eq '898029' }
58
58
  end
59
59
 
60
60
  context "with video 898029 in /group/ url", :vcr do
61
- subject { VideoInfo.get('http://player.vimeo.com/video/898029') }
61
+ subject { VideoInfo.new('http://player.vimeo.com/video/898029') }
62
62
 
63
63
  its(:provider) { should eq 'Vimeo' }
64
64
  its(:video_id) { should eq '898029' }
65
65
  end
66
66
 
67
67
  context "with video 898029 in text", :vcr do
68
- subject { VideoInfo.get('<a href="http://www.vimeo.com/898029">http://www.vimeo.com/898029</a>') }
68
+ subject { VideoInfo.new('<a href="http://www.vimeo.com/898029">http://www.vimeo.com/898029</a>') }
69
69
 
70
70
  its(:provider) { should eq 'Vimeo' }
71
71
  its(:video_id) { should eq '898029' }
@@ -19,16 +19,17 @@ describe VideoInfo::Providers::Vkontakte do
19
19
  end
20
20
 
21
21
  context "with video 39576223_108370515", :vcr do
22
- subject { VideoInfo.get('http://vk.com/video39576223_108370515') }
22
+ subject { VideoInfo.new('http://vk.com/video39576223_108370515') }
23
23
 
24
24
  its(:provider) { should eq 'Vkontakte' }
25
25
  its(:video_owner) { should eq '39576223' }
26
26
  its(:video_id) { should eq '108370515' }
27
27
  its(:url) { should eq 'http://vk.com/video39576223_108370515' }
28
- its(:embed_url) { should eq 'http://vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af' }
28
+ its(:embed_url) { should eq 'vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af' }
29
29
  its(:embed_code) { should eq '<iframe src="http://vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
30
- its(:title) { should eq 'Я уточка)))))' }
30
+ its(:title) { should eq 'Я уточка))))) | VK' }
31
31
  its(:description) { should eq 'это ВЗРЫВ МОЗГА!!! Просто отвал башки...' }
32
+ its(:keywords) { should eq 'это ВЗРЫВ МОЗГА!!! Просто отвал башки...' }
32
33
  its(:duration) { should eq 183 }
33
34
  its(:width) { should eq 320 }
34
35
  its(:height) { should eq 240 }
@@ -22,12 +22,12 @@ describe VideoInfo::Providers::Youtube do
22
22
  end
23
23
 
24
24
  context "with video mZqGqE0D0n4", :vcr do
25
- subject { VideoInfo.get('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
25
+ subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
26
26
 
27
27
  its(:provider) { should eq 'YouTube' }
28
28
  its(:video_id) { should eq 'mZqGqE0D0n4' }
29
29
  its(:url) { should eq 'http://www.youtube.com/watch?v=mZqGqE0D0n4' }
30
- its(:embed_url) { should eq 'http://www.youtube.com/embed/mZqGqE0D0n4' }
30
+ its(:embed_url) { should eq 'www.youtube.com/embed/mZqGqE0D0n4' }
31
31
  its(:embed_code) { should eq '<iframe src="http://www.youtube.com/embed/mZqGqE0D0n4" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
32
32
  its(:title) { should eq 'Cherry Bloom - King Of The Knife' }
33
33
  its(:description) { should eq 'The first video from the upcoming album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net' }
@@ -43,27 +43,27 @@ describe VideoInfo::Providers::Youtube do
43
43
  end
44
44
 
45
45
  context "with video oQ49W_xKzKA", :vcr do
46
- subject { VideoInfo.get('http://www.youtube.com/watch?v=oQ49W_xKzKA') }
46
+ subject { VideoInfo.new('http://www.youtube.com/watch?v=oQ49W_xKzKA') }
47
47
 
48
- it { subject.embed_code(:url_attributes => { :autoplay => 1 }).should match(/autoplay=1/) }
48
+ it { expect(subject.embed_code(url_attributes: { autoplay: 1 })).to match(/autoplay=1/) }
49
49
  end
50
50
 
51
51
  context "with video oQ49W_xKzKA", :vcr do
52
- subject { VideoInfo.get('http://www.youtube.com/watch?v=oQ49W_xKzKA') }
52
+ subject { VideoInfo.new('http://www.youtube.com/watch?v=oQ49W_xKzKA') }
53
53
 
54
54
  its(:provider) { should eq 'YouTube' }
55
55
  its(:video_id) { should eq 'oQ49W_xKzKA' }
56
56
  end
57
57
 
58
58
  context "with video Xp6CXF-Cesg", :vcr do
59
- subject { VideoInfo.get('http://www.youtube.com/watch?v=Xp6CXF-Cesg') }
59
+ subject { VideoInfo.new('http://www.youtube.com/watch?v=Xp6CXF-Cesg') }
60
60
 
61
61
  its(:provider) { should eq 'YouTube' }
62
62
  its(:video_id) { should eq 'Xp6CXF-Cesg' }
63
63
  end
64
64
 
65
65
  context "with video VeasFckfMHY in user url", :vcr do
66
- subject { VideoInfo.get('http://www.youtube.com/user/EducatorVids3?v=VeasFckfMHY') }
66
+ subject { VideoInfo.new('http://www.youtube.com/user/EducatorVids3?v=VeasFckfMHY') }
67
67
 
68
68
  its(:provider) { should eq 'YouTube' }
69
69
  its(:video_id) { should eq 'VeasFckfMHY' }
@@ -71,7 +71,7 @@ describe VideoInfo::Providers::Youtube do
71
71
  end
72
72
 
73
73
  context "with video VeasFckfMHY after params", :vcr do
74
- subject { VideoInfo.get('http://www.youtube.com/watch?feature=player_profilepage&v=VeasFckfMHY') }
74
+ subject { VideoInfo.new('http://www.youtube.com/watch?feature=player_profilepage&v=VeasFckfMHY') }
75
75
 
76
76
  its(:provider) { should eq 'YouTube' }
77
77
  its(:video_id) { should eq 'VeasFckfMHY' }
@@ -79,60 +79,60 @@ describe VideoInfo::Providers::Youtube do
79
79
  end
80
80
 
81
81
  context "with video VeasFckfMHY in path", :vcr do
82
- subject { VideoInfo.get('http://www.youtube.com/v/VeasFckfMHY') }
82
+ subject { VideoInfo.new('http://www.youtube.com/v/VeasFckfMHY') }
83
83
 
84
84
  its(:provider) { should eq 'YouTube' }
85
85
  its(:video_id) { should eq 'VeasFckfMHY' }
86
86
  end
87
87
 
88
88
  context "with video VeasFckfMHY in e path", :vcr do
89
- subject { VideoInfo.get('http://www.youtube.com/e/VeasFckfMHY') }
89
+ subject { VideoInfo.new('http://www.youtube.com/e/VeasFckfMHY') }
90
90
 
91
91
  its(:provider) { should eq 'YouTube' }
92
92
  its(:video_id) { should eq 'VeasFckfMHY' }
93
93
  end
94
94
 
95
95
  context "with video VeasFckfMHY in embed path", :vcr do
96
- subject { VideoInfo.get('http://www.youtube.com/embed/VeasFckfMHY') }
96
+ subject { VideoInfo.new('http://www.youtube.com/embed/VeasFckfMHY') }
97
97
 
98
98
  its(:provider) { should eq 'YouTube' }
99
99
  its(:video_id) { should eq 'VeasFckfMHY' }
100
100
  end
101
101
 
102
102
  context "with video JM9NgvjjVng in youtu.be url", :vcr do
103
- subject { VideoInfo.get('http://youtu.be/JM9NgvjjVng') }
103
+ subject { VideoInfo.new('http://youtu.be/JM9NgvjjVng') }
104
104
 
105
105
  its(:provider) { should eq 'YouTube' }
106
106
  its(:video_id) { should eq 'JM9NgvjjVng' }
107
107
  end
108
108
 
109
109
  context 'without http or www', :vcr do
110
- subject { VideoInfo.get('youtu.be/JM9NgvjjVng') }
110
+ subject { VideoInfo.new('youtu.be/JM9NgvjjVng') }
111
111
 
112
112
  its(:provider) { should == 'YouTube' }
113
113
  its(:video_id) { should eq 'JM9NgvjjVng' }
114
114
  end
115
115
 
116
116
  context "with video url in text", :vcr do
117
- subject { VideoInfo.get('<a href="http://www.youtube.com/watch?v=mZqGqE0D0n4">http://www.youtube.com/watch?v=mZqGqE0D0n4</a>') }
117
+ subject { VideoInfo.new('<a href="http://www.youtube.com/watch?v=mZqGqE0D0n4">http://www.youtube.com/watch?v=mZqGqE0D0n4</a>') }
118
118
 
119
119
  its(:provider) { should == 'YouTube' }
120
120
  its(:video_id) { should == 'mZqGqE0D0n4' }
121
121
  end
122
122
 
123
123
  context "with iframe attributes", :vcr do
124
- subject { VideoInfo.get('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
124
+ subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
125
125
 
126
126
  its(:provider) { should == 'YouTube' }
127
- it { subject.embed_code(:iframe_attributes => { :width => 800, :height => 600 }).should match(/width="800"/) }
128
- it { subject.embed_code(:iframe_attributes => { :width => 800, :height => 600 }).should match(/height="600"/) }
127
+ it { expect(subject.embed_code(iframe_attributes: { width: 800, height: 600 })).to match(/width="800"/) }
128
+ it { expect(subject.embed_code(iframe_attributes: { width: 800, height: 600 })).to match(/height="600"/) }
129
129
  end
130
130
 
131
131
  context "with arbitrary iframe_attributes", :vcr do
132
- subject { VideoInfo.get('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
132
+ subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
133
133
 
134
134
  its(:provider) { should == 'YouTube' }
135
- it { subject.embed_code(:iframe_attributes => { :'data-colorbox' => true }).should match(/data-colorbox="true"/) }
135
+ it { expect(subject.embed_code(iframe_attributes: { :'data-colorbox' => true })).to match(/data-colorbox="true"/) }
136
136
  end
137
137
 
138
138
  end
@@ -2,48 +2,48 @@ require 'spec_helper'
2
2
 
3
3
  describe VideoInfo do
4
4
 
5
- describe ".get" do
5
+ describe "#initialize" do
6
6
  let(:url) { 'url' }
7
- let(:options) { { :foo => :bar } }
8
- let(:provider) { double('provider') }
7
+ let(:options) { { foo: :bar } }
8
+ let(:provider) { double('provider', provider: 'Provider') }
9
9
 
10
10
  it "uses the first usable provider" do
11
- VideoInfo::Providers::Vimeo.should_receive(:usable?).with(url) { false }
12
- VideoInfo::Providers::Vkontakte.should_receive(:usable?).with(url) { false }
13
- VideoInfo::Providers::Youtube.should_receive(:usable?).with(url) { true }
14
- VideoInfo::Providers::Youtube.should_receive(:new).with(url, options) { provider }
11
+ VideoInfo::Providers::Vimeo.stub(:usable?) { false }
12
+ VideoInfo::Providers::Vkontakte.stub(:usable?) { false }
13
+ VideoInfo::Providers::Youtube.stub(:usable?) { true }
14
+ VideoInfo::Providers::Youtube.stub(:new) { provider }
15
15
 
16
- VideoInfo.get(url, options).should eq provider
16
+ expect(VideoInfo.new(url, options).provider).to eq 'Provider'
17
17
  end
18
18
 
19
- it "returns nil when no providers are usable" do
20
- VideoInfo::Providers::Vimeo.should_receive(:usable?).with(url) { false }
21
- VideoInfo::Providers::Vkontakte.should_receive(:usable?).with(url) { false }
22
- VideoInfo::Providers::Youtube.should_receive(:usable?).with(url) { false }
19
+ it "raise when no providers are usable" do
20
+ VideoInfo::Providers::Vimeo.stub(:usable?) { false }
21
+ VideoInfo::Providers::Vkontakte.stub(:usable?) { false }
22
+ VideoInfo::Providers::Youtube.stub(:usable?) { false }
23
23
 
24
- VideoInfo.get(url, options).should be_nil
24
+ expect { VideoInfo.new(url, options) }.to raise_error(VideoInfo::UrlError)
25
25
  end
26
26
  end
27
27
 
28
28
  describe ".usable?" do
29
29
  let(:url) { 'url' }
30
- let(:options) { { :foo => :bar } }
31
- let(:provider) { double('provider') }
30
+ let(:provider) { double('provider', new: true) }
32
31
 
33
32
  it "returns true when a provider is usable" do
34
- VideoInfo::Providers::Vimeo.should_receive(:usable?).with(url) { false }
35
- VideoInfo::Providers::Vkontakte.should_receive(:usable?).with(url) { false }
36
- VideoInfo::Providers::Youtube.should_receive(:usable?).with(url) { true }
33
+ VideoInfo::Providers::Vimeo.stub(:usable?) { false }
34
+ VideoInfo::Providers::Vkontakte.stub(:usable?) { false }
35
+ VideoInfo::Providers::Youtube.stub(:usable?) { true }
36
+ VideoInfo::Providers::Youtube.stub(:new) { true }
37
37
 
38
- VideoInfo.usable?(url).should be_true
38
+ expect(VideoInfo.usable?(url)).to be_true
39
39
  end
40
40
 
41
41
  it "returns false when no providers are usable" do
42
- VideoInfo::Providers::Vimeo.should_receive(:usable?).with(url) { false }
43
- VideoInfo::Providers::Vkontakte.should_receive(:usable?).with(url) { false }
44
- VideoInfo::Providers::Youtube.should_receive(:usable?).with(url) { false }
42
+ VideoInfo::Providers::Vimeo.stub(:usable?) { false }
43
+ VideoInfo::Providers::Vkontakte.stub(:usable?) { false }
44
+ VideoInfo::Providers::Youtube.stub(:usable?) { false }
45
45
 
46
- VideoInfo.usable?(url).should be_false
46
+ expect(VideoInfo.usable?(url)).to be_false
47
47
  end
48
48
  end
49
49
 
data/spec/spec_helper.rb CHANGED
@@ -9,14 +9,20 @@ end
9
9
 
10
10
  VCR.configure do |config|
11
11
  config.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
12
- config.default_cassette_options = { :record => :new_episodes }
12
+ config.default_cassette_options = {
13
+ record: :new_episodes,
14
+ re_record_interval: 7 * 24 * 60 * 60
15
+ }
13
16
  config.hook_into :webmock
14
17
  config.configure_rspec_metadata!
15
18
  end
16
19
 
17
20
  RSpec.configure do |config|
18
21
  config.color_enabled = true
19
- config.filter_run :focus => true
22
+ config.filter_run focus: true
20
23
  config.run_all_when_everything_filtered = true
21
24
  config.treat_symbols_as_metadata_keys_with_true_values = true
25
+ config.expect_with :rspec do |c|
26
+ c.syntax = :expect
27
+ end
22
28
  end
data/video_info.gemspec CHANGED
@@ -11,16 +11,19 @@ Gem::Specification.new do |s|
11
11
  s.author = 'Thibaud Guillaume-Gentil'
12
12
  s.email = 'thibaud@thibaud.me'
13
13
  s.homepage = 'https://rubygems.org/gems/video_info'
14
- s.summary = 'Vimeo & YouTube parser'
15
- s.description = 'Get video info from YouTube and Vimeo url.'
14
+ s.summary = 'YouTube, Vimeo & VK parser'
15
+ s.description = 'Get video info from YouTube, Vimeo and VK url.'
16
16
 
17
17
  s.files = `git ls-files`.split($/)
18
18
  s.test_files = s.files.grep(%r{^spec/})
19
19
  s.require_path = 'lib'
20
20
 
21
+ s.required_ruby_version = '>= 1.9.2'
22
+
21
23
  s.add_dependency 'addressable'
22
24
  s.add_dependency 'multi_json'
23
25
  s.add_dependency 'htmlentities'
26
+
24
27
  s.add_development_dependency 'bundler', '>= 1.3.5'
25
28
  s.add_development_dependency 'rake'
26
29
  s.add_development_dependency 'rspec'