ruby-oembed 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,8 +24,8 @@ describe OEmbed::ProviderDiscovery do
24
24
  :json,
25
25
  ],
26
26
  'vimeo' => [
27
- 'http://vimeo.com/27953845',
28
- {:json=>'http://vimeo.com/api/oembed.json', :xml=>'http://vimeo.com/api/oembed.xml'},
27
+ 'https://vimeo.com/27953845',
28
+ {:json=>'https://vimeo.com/api/oembed.json', :xml=>'https://vimeo.com/api/oembed.xml'},
29
29
  :json,
30
30
  ],
31
31
  'facebook-photo' => [
@@ -38,11 +38,6 @@ describe OEmbed::ProviderDiscovery do
38
38
  'https://www.tumblr.com/oembed/1.0',
39
39
  :json
40
40
  ],
41
- 'noteflight' => [
42
- 'http://www.noteflight.com/scores/view/09665392c94475f65dfaf5f30aadb6ed0921939d',
43
- {:json=>'http://www.noteflight.com/services/oembed', :xml=>'http://www.noteflight.com/services/oembed'},
44
- :json,
45
- ],
46
41
  # TODO: Enhance ProviderDiscovery to support arbitrary query parameters. See https://github.com/ruby-oembed/ruby-oembed/issues/15
47
42
  #'wordpress' => [
48
43
  # 'http://sweetandweak.wordpress.com/2011/09/23/nothing-starts-the-morning-like-a-good-dose-of-panic/',
@@ -267,37 +267,30 @@ describe OEmbed::Provider do
267
267
  @vimeo_ssl << "http://*.vimeo.com/*"
268
268
  @vimeo_ssl << "https://*.vimeo.com/*"
269
269
 
270
- expect {
271
- res = @vimeo_ssl.send(:raw, example_url(:vimeo_ssl))
272
- expect(res).to eq(example_body(:vimeo_ssl))
273
- }.not_to raise_error
270
+ res = @vimeo_ssl.send(:raw, example_url(:vimeo_ssl))
271
+ expect(res).to eq(example_body(:vimeo_ssl).strip)
274
272
  end
275
273
 
276
274
  it "should raise an UnknownFormat error on 501" do
277
- # Note: This test relies on a custom-written VCR response in the
278
- # cassettes/OEmbed_Provider.yml file.
275
+ stub_request(:get, /flickr/).to_return(status: 501)
279
276
 
280
277
  expect {
281
- @flickr.send(:raw, File.join(example_url(:flickr), '501'))
278
+ result = @flickr.send(:raw, File.join(example_url(:flickr), '501'))
282
279
  }.to raise_error(OEmbed::UnknownFormat)
283
280
  end
284
281
 
285
282
  it "should raise a NotFound error on 404" do
286
- # Note: This test relies on a custom-written VCR response in the
287
- # cassettes/OEmbed_Provider.yml file.
283
+ stub_request(:get, /flickr/).to_return(status: 404)
288
284
 
289
285
  expect {
290
286
  @flickr.send(:raw, File.join(example_url(:flickr), '404'))
291
287
  }.to raise_error(OEmbed::NotFound)
292
288
  end
293
289
 
294
- it "should raise an UnknownResponse error on other responses" do
295
- # Note: This test relies on a custom-written VCR response in the
296
- # cassettes/OEmbed_Provider.yml file.
297
-
298
- statuses_to_check = ['405', '500']
290
+ ['405', '500'].each do |status|
291
+ it "should raise an UnknownResponse error on other responses (#{status})" do
292
+ stub_request(:get, /flickr/).to_return(status: status)
299
293
 
300
- statuses_to_check.each do |status|
301
294
  expect {
302
295
  @flickr.send(:raw, File.join(example_url(:flickr), status))
303
296
  }.to raise_error(OEmbed::UnknownResponse)
@@ -364,7 +357,7 @@ describe OEmbed::Provider do
364
357
  @viddler.get(example_url(:viddler))
365
358
  end
366
359
 
367
- it "handles the :timeout option" do
360
+ it "handles the :timeout option", pending: true do
368
361
  expect_any_instance_of(Net::HTTP).to receive(:open_timeout=).with(5)
369
362
  expect_any_instance_of(Net::HTTP).to receive(:read_timeout=).with(5)
370
363
  @flickr.get(example_url(:flickr), :timeout => 5)
@@ -4,9 +4,10 @@ require 'vcr'
4
4
  VCR.config do |c|
5
5
  c.default_cassette_options = { :record => :new_episodes }
6
6
  c.cassette_library_dir = 'spec/cassettes'
7
- c.stub_with :fakeweb
7
+ c.hook_into :webmock
8
8
  end
9
9
 
10
+ require 'webmock/rspec'
10
11
  require 'coveralls'
11
12
  Coveralls.wear!
12
13
 
@@ -16,6 +17,7 @@ RSpec.configure do |config|
16
17
  config.raise_errors_for_deprecations!
17
18
  config.tty = true
18
19
  config.color = true
20
+ config.example_status_persistence_file_path = '.rspec-status'
19
21
  end
20
22
 
21
23
  module OEmbedSpecHelper
@@ -1,11 +1,9 @@
1
1
  ---
2
2
  :flickr:
3
3
  :url: "http://flickr.com/photos/bees/2362225867/"
4
- :body: !
5
- '{"version":"1.0","type":"photo","author_url":"http:\/\/www.flickr.com\/photos\/bees\/","cache_age":3600,"provider_name":"Flickr","provider_url":"http:\/\/www.flickr.com\/","title":"Bacon
6
- Lollys","author_name":"\u202e\u202d\u202cbees\u202c","width":"500","height":"375","url":"http:\/\/farm4.staticflickr.com\/3040\/2362225867_4a87ab8baf.jpg"}
4
+ :body: |
5
+ {"type":"photo","flickr_type":"photo","title":"Bacon Lollys","author_name":"\u202e\u202d\u202cbees\u202c","author_url":"https:\/\/www.flickr.com\/photos\/bees\/","width":1024,"height":768,"url":"https:\/\/live.staticflickr.com\/3040\/2362225867_4a87ab8baf_b.jpg","web_page":"https:\/\/www.flickr.com\/photos\/bees\/2362225867\/","thumbnail_url":"https:\/\/live.staticflickr.com\/3040\/2362225867_4a87ab8baf_q.jpg","thumbnail_width":150,"thumbnail_height":150,"web_page_short_url":"https:\/\/flic.kr\/p\/4AK2sc","license":"All Rights Reserved","license_id":0,"html":"<a data-flickr-embed=\"true\" href=\"https:\/\/www.flickr.com\/photos\/bees\/2362225867\/\" title=\"Bacon Lollys by \u202e\u202d\u202cbees\u202c, on Flickr\"><img src=\"https:\/\/live.staticflickr.com\/3040\/2362225867_4a87ab8baf_b.jpg\" width=\"1024\" height=\"768\" alt=\"Bacon Lollys\"><\/a><script async src=\"https:\/\/embedr.flickr.com\/assets\/client-code.js\" charset=\"utf-8\"><\/script>","version":"1.0","cache_age":3600,"provider_name":"Flickr","provider_url":"https:\/\/www.flickr.com\/"}
7
6
 
8
- '
9
7
  :skitch:
10
8
  :url: "http://skitch.com/sethferreira/nmbr8/the-kings-new-toy"
11
9
  :body: ! '{"type":"photo","version":"1.0","author_name":"sethferreira","author_url":"http:\/\/skitch.com\/sethferreira\/","provider_name":"Skitch.com","provider_url":"http:\/\/skitch.com\/","width":804,"height":804,"url":"https:\/\/img.skitch.com\/20091210-m9cq9r2e6cy1j1sn23acn38kx.jpg","thumbnail_width":337,"thumbnail_height":337,"thumbnail_url":"https:\/\/img.skitch.com\/20091210-m9cq9r2e6cy1j1sn23acn38kx.preview.jpg","cache_age":86400}'
@@ -15,20 +13,12 @@
15
13
  :url: "http://qik.com/video/49565"
16
14
  :vimeo:
17
15
  :url: "http://vimeo.com/3100878"
18
- :body: ! '{"type":"video","version":"1.0","provider_name":"Vimeo","provider_url":"http:\/\/vimeo.com\/","title":"Murmuration","author_name":"Sophie
19
- Windsor Clive","author_url":"http:\/\/vimeo.com\/user3069761","is_plus":"0","html":"<iframe
20
- src=\"https:\/\/player.vimeo.com\/video\/31158841\" width=\"640\" height=\"512\"
21
- frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen><\/iframe>","width":640,"height":512,"duration":120,"description":"A
22
- chance encounter and shared moment with one of natures greatest and most fleeting
23
- phenomena.","thumbnail_url":"https:\/\/secure-b.vimeocdn.com\/ts\/209\/801\/209801744_640.jpg","thumbnail_width":640,"thumbnail_height":512,"video_id":31158841}'
16
+ :body: |
17
+ {"type":"video","version":"1.0","provider_name":"Vimeo","provider_url":"https:\/\/vimeo.com\/","title":"Murmuration","author_name":"Islands & Rivers","author_url":"https:\/\/vimeo.com\/islandsandrivers","is_plus":"0","account_type":"basic","html":"<iframe src=\"https:\/\/player.vimeo.com\/video\/31158841?app_id=122963\" width=\"400\" height=\"320\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen title=\"Murmuration\"><\/iframe>","width":400,"height":320,"duration":123,"description":"A chance encounter and shared moment with one of natures greatest and most fleeting phenomena.\n\nFacebook: Islands And Rivers\nFor licensing information contact Dale Dobson - dale@iconiclinx.com","thumbnail_url":"https:\/\/i.vimeocdn.com\/video\/448600816_295x166.jpg","thumbnail_width":295,"thumbnail_height":221,"thumbnail_url_with_play_button":"https:\/\/i.vimeocdn.com\/filter\/overlay?src0=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F448600816_295x166.jpg&src1=http%3A%2F%2Ff.vimeocdn.com%2Fp%2Fimages%2Fcrawler_play.png","upload_date":"2011-10-26 14:43:13","video_id":31158841,"uri":"\/videos\/31158841"}
24
18
  :vimeo_ssl:
25
19
  :url: "https://vimeo.com/31158841"
26
- :body: ! '{"type":"video","version":"1.0","provider_name":"Vimeo","provider_url":"http:\/\/vimeo.com\/","title":"Murmuration","author_name":"Sophie
27
- Windsor Clive","author_url":"http:\/\/vimeo.com\/user3069761","is_plus":"0","html":"<iframe
28
- src=\"https:\/\/player.vimeo.com\/video\/31158841\" width=\"640\" height=\"512\"
29
- frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen><\/iframe>","width":640,"height":512,"duration":120,"description":"A
30
- chance encounter and shared moment with one of natures greatest and most fleeting
31
- phenomena.","thumbnail_url":"https:\/\/secure-b.vimeocdn.com\/ts\/209\/801\/209801744_640.jpg","thumbnail_width":640,"thumbnail_height":512,"video_id":31158841}'
20
+ :body: |
21
+ {"type":"video","version":"1.0","provider_name":"Vimeo","provider_url":"https:\/\/vimeo.com\/","title":"Murmuration","author_name":"Islands & Rivers","author_url":"https:\/\/vimeo.com\/islandsandrivers","is_plus":"0","account_type":"basic","html":"<iframe src=\"https:\/\/player.vimeo.com\/video\/31158841?app_id=122963\" width=\"400\" height=\"320\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen title=\"Murmuration\"><\/iframe>","width":400,"height":320,"duration":123,"description":"A chance encounter and shared moment with one of natures greatest and most fleeting phenomena.\n\nFacebook: Islands And Rivers\nFor licensing information contact Dale Dobson - dale@iconiclinx.com","thumbnail_url":"https:\/\/i.vimeocdn.com\/video\/448600816_295x166.jpg","thumbnail_width":295,"thumbnail_height":221,"thumbnail_url_with_play_button":"https:\/\/i.vimeocdn.com\/filter\/overlay?src0=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F448600816_295x166.jpg&src1=http%3A%2F%2Ff.vimeocdn.com%2Fp%2Fimages%2Fcrawler_play.png","upload_date":"2011-10-26 14:43:13","video_id":31158841,"uri":"\/videos\/31158841"}
32
22
  :rev3:
33
23
  :url: "http://revision3.com/diggnation/2008-04-17xsanned/"
34
24
  :hulu:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-oembed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus Holm
@@ -11,36 +11,8 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-03-26 00:00:00.000000000 Z
14
+ date: 2020-04-03 00:00:00.000000000 Z
15
15
  dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: rake
18
- requirement: !ruby/object:Gem::Requirement
19
- requirements:
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: '0'
23
- type: :development
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
- - !ruby/object:Gem::Dependency
31
- name: json
32
- requirement: !ruby/object:Gem::Requirement
33
- requirements:
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: '0'
37
- type: :development
38
- prerelease: false
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: '0'
44
16
  - !ruby/object:Gem::Dependency
45
17
  name: xml-simple
46
18
  requirement: !ruby/object:Gem::Requirement
@@ -69,48 +41,6 @@ dependencies:
69
41
  - - ">="
70
42
  - !ruby/object:Gem::Version
71
43
  version: '0'
72
- - !ruby/object:Gem::Dependency
73
- name: rspec
74
- requirement: !ruby/object:Gem::Requirement
75
- requirements:
76
- - - "~>"
77
- - !ruby/object:Gem::Version
78
- version: '3.0'
79
- type: :development
80
- prerelease: false
81
- version_requirements: !ruby/object:Gem::Requirement
82
- requirements:
83
- - - "~>"
84
- - !ruby/object:Gem::Version
85
- version: '3.0'
86
- - !ruby/object:Gem::Dependency
87
- name: vcr
88
- requirement: !ruby/object:Gem::Requirement
89
- requirements:
90
- - - "~>"
91
- - !ruby/object:Gem::Version
92
- version: '1.0'
93
- type: :development
94
- prerelease: false
95
- version_requirements: !ruby/object:Gem::Requirement
96
- requirements:
97
- - - "~>"
98
- - !ruby/object:Gem::Version
99
- version: '1.0'
100
- - !ruby/object:Gem::Dependency
101
- name: fakeweb
102
- requirement: !ruby/object:Gem::Requirement
103
- requirements:
104
- - - ">="
105
- - !ruby/object:Gem::Version
106
- version: '0'
107
- type: :development
108
- prerelease: false
109
- version_requirements: !ruby/object:Gem::Requirement
110
- requirements:
111
- - - ">="
112
- - !ruby/object:Gem::Version
113
- version: '0'
114
44
  description: An oEmbed consumer library written in Ruby, letting you easily get embeddable
115
45
  HTML representations of supported web pages, based on their URLs. See http://oembed.com
116
46
  for more information about the protocol.
@@ -191,7 +121,7 @@ rdoc_options:
191
121
  - "--main"
192
122
  - README.rdoc
193
123
  - "--title"
194
- - ruby-oembed-0.12.0
124
+ - ruby-oembed-0.13.0
195
125
  - "--inline-source"
196
126
  - "--exclude"
197
127
  - tasks
@@ -209,10 +139,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
139
  - !ruby/object:Gem::Version
210
140
  version: '0'
211
141
  requirements: []
212
- rubyforge_project:
213
- rubygems_version: 2.6.11
142
+ rubygems_version: 3.0.3
214
143
  signing_key:
215
- specification_version: 3
144
+ specification_version: 4
216
145
  summary: oEmbed for Ruby
217
146
  test_files:
218
147
  - spec/cassettes/OEmbed_Provider.yml