oh-my-embed 1.1.1 → 1.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 613b3cac83fde7c4e89725145298d507bb810238
4
- data.tar.gz: 37465d9327a1ed097882f394038229cc104f3b7c
3
+ metadata.gz: ef02d0fbce362fff167ba19d1b45c72160e4b16d
4
+ data.tar.gz: 3b7d47c493798f383a3e755d3b9cac2b79cd7291
5
5
  SHA512:
6
- metadata.gz: e04acef29250987c6a27d7beba05977b7f088385183edc75289dc3c84e11d24727261a09d18977d7a3ac7b4a7de0e6be638a099917fbfb8986c3b5d00f93d5e5
7
- data.tar.gz: f9bb41f052fa700ed88a661c36ac8caaf829c71c6f1994dafd09f8c3f1542d5a4836c5c738f893d323b0a0e4676f5eff6d9f2db435b0126cc4ddcea444541384
6
+ metadata.gz: 50a2eeae2938af6c2c8bab6f52b6bb1a2203b736c9dfaaa92a3a0b9f6af40a685dbd3678c6a200dd24f1a5d15581ddd0f44e2eb83fa2dff77c88636984d88b9e
7
+ data.tar.gz: 49a25748b9daae8dff640bb7854ce2c9ee4a0b523f0b31927deaaae8883bbeb31f3a6841c910d7c613c9d21972f0870521a1aee50943312b14be86f24221b1b0
data/README.md CHANGED
@@ -24,7 +24,7 @@ Or install it yourself as:
24
24
 
25
25
  $ gem install oh-my-embed
26
26
 
27
- ## Build in providers
27
+ ## Built-in providers
28
28
 
29
29
  - Youtube
30
30
  - Slideshare
@@ -44,10 +44,10 @@ See the custom provider section for more informations.
44
44
 
45
45
  ### Basics
46
46
  First of all you have to create a `OhMyEmbed::Crawler` object and register your desired providers.
47
- You can use all build-in providers, select only a few or mix them up with your custom providers.
47
+ You can use all built-in providers, select only a few or mix them up with your custom providers.
48
48
 
49
49
  ```ruby
50
- # Crawler with all build-in providers (includes all classes you added to the OhMyEmbed::Providers module)
50
+ # Crawler with all built-in providers (includes all classes you added to the OhMyEmbed::Providers module)
51
51
  crawler = OhMyEmbed::Crawler.new(all: true)
52
52
 
53
53
  # Crawler with specific providers
@@ -56,7 +56,7 @@ crawler = OhMyEmbed::Crawler.new(:youtube, :slideshare)
56
56
  # Crawler with custom providers
57
57
  crawler = OhMyEmbed::Crawler.new(:youtube, MyProvider)
58
58
 
59
- # Crawler with all build-in and a custom provider
59
+ # Crawler with all built-in and a custom provider
60
60
  crawler = OhMyEmbed::Crawler.new(MyProvider, all: true)
61
61
  ```
62
62
 
data/lib/oh_my_embed.rb CHANGED
@@ -1,9 +1,18 @@
1
1
  require 'active_support/all'
2
2
 
3
- Dir.glob(File.join(__dir__, 'oh_my_embed', '*.rb'), &method(:require))
4
- Dir.glob(File.join(__dir__, 'oh_my_embed', 'providers', '*.rb'), &method(:require))
3
+ require 'oh_my_embed/crawler'
4
+ require 'oh_my_embed/provider'
5
+ require 'oh_my_embed/version'
5
6
 
6
7
  module OhMyEmbed
8
+
9
+ module Providers
10
+ # Setup autoloading for every provider in oh_my_embed/providers
11
+ Dir.glob(File.join(__dir__, 'oh_my_embed', 'providers', '*.rb')).each do |provider_path|
12
+ autoload File.basename(provider_path, '.rb').camelize, provider_path
13
+ end
14
+ end
15
+
7
16
  # All OhMyEmbed errors inherits from a generic OhMyEmbed::Error class
8
17
  #
9
18
  # - OhMyEmbed::UnknownProvider
@@ -10,7 +10,7 @@ module OhMyEmbed
10
10
 
11
11
  options = providers.extract_options!
12
12
 
13
- register_all_build_in_providers if options[:all]
13
+ register_all_built_in_providers if options[:all]
14
14
  providers.each do |provider|
15
15
  register provider
16
16
  end
@@ -32,10 +32,10 @@ module OhMyEmbed
32
32
  @providers.add provider
33
33
  end
34
34
 
35
- # Register all build in providers for this crawler
35
+ # Register all built-in providers for this crawler
36
36
  #
37
- def register_all_build_in_providers
38
- build_in_providers.each do |provider|
37
+ def register_all_built_in_providers
38
+ built_in_providers.each do |provider|
39
39
  register provider
40
40
  end
41
41
  end
@@ -69,7 +69,7 @@ module OhMyEmbed
69
69
  # Select all provider constants from the OhMyEmbed::Providers module
70
70
  #
71
71
  # @return [Array<Symbol>]
72
- def build_in_providers
72
+ def built_in_providers
73
73
  OhMyEmbed::Providers.constants
74
74
  .select { |c| OhMyEmbed::Providers.const_get(c) < OhMyEmbed::Provider }
75
75
  end
@@ -1,3 +1,6 @@
1
+ require 'net/http'
2
+ require 'oh_my_embed/response'
3
+
1
4
  module OhMyEmbed
2
5
  ##
3
6
  # Provider
@@ -49,11 +52,9 @@ module OhMyEmbed
49
52
  format: 'json',
50
53
  }))
51
54
 
52
- connection = Net::HTTP.new(uri.host, uri.port)
53
- connection.use_ssl = (uri.port == URI::HTTPS::DEFAULT_PORT)
54
-
55
55
  begin
56
- response = connection.get(uri.request_uri)
56
+ http = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https')
57
+ response = http.request_get(uri, { 'User-Agent' => "Ruby/#{RUBY_VERSION}" })
57
58
  rescue Timeout::Error
58
59
  raise OhMyEmbed::Error.new('Request timed out')
59
60
  end
@@ -1,3 +1,3 @@
1
1
  module OhMyEmbed
2
- VERSION = '1.1.1'
2
+ VERSION = '1.2.0'
3
3
  end
@@ -7,12 +7,14 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
+ User-Agent:
11
+ - Ruby/2.2.3
10
12
  Accept-Encoding:
11
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
14
  Accept:
13
15
  - "*/*"
14
- User-Agent:
15
- - Ruby
16
+ Host:
17
+ - www.facebook.com
16
18
  response:
17
19
  status:
18
20
  code: 200
@@ -40,9 +42,9 @@ http_interactions:
40
42
  Vary:
41
43
  - Accept-Encoding
42
44
  X-Fb-Debug:
43
- - G6RjLdrqPe8/KAKzPR9FA3Ayv4EfoebAqPUlmmAmM/JTFIvgxfqLk8oSwSQefQRM6yq0XpTkFREf1Qlb87cuWQ==
45
+ - Tzox8b6mgFPotc6d4sFiHi9lhAMhulnc2A/G+3LVu3XlLLeL8Jb1LjmfBueNtoavcP06sTrN1GDwUAPwGa8DPg==
44
46
  Date:
45
- - Sun, 08 May 2016 11:18:20 GMT
47
+ - Tue, 10 May 2016 17:27:30 GMT
46
48
  Transfer-Encoding:
47
49
  - chunked
48
50
  Connection:
@@ -61,5 +63,5 @@ http_interactions:
61
63
  on&nbsp;\u003Ca href=\"https://www.facebook.com/FacebookDeutschland/posts/10153796066380932\">Donnerstag,
62
64
  25. Februar 2016\u003C/a>\u003C/blockquote>\u003C/div>\u003C/div>","type":"rich","version":"1.0","url":"https://www.facebook.com/FacebookDeutschland/posts/10153796066380932","width":552}'
63
65
  http_version:
64
- recorded_at: Sun, 08 May 2016 11:18:20 GMT
66
+ recorded_at: Tue, 10 May 2016 17:27:30 GMT
65
67
  recorded_with: VCR 3.0.1
@@ -7,12 +7,14 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
+ User-Agent:
11
+ - Ruby/2.2.3
10
12
  Accept-Encoding:
11
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
14
  Accept:
13
15
  - "*/*"
14
- User-Agent:
15
- - Ruby
16
+ Host:
17
+ - www.facebook.com
16
18
  response:
17
19
  status:
18
20
  code: 200
@@ -40,9 +42,9 @@ http_interactions:
40
42
  Vary:
41
43
  - Accept-Encoding
42
44
  X-Fb-Debug:
43
- - sqneNfNoRj99NDzfQJs+vX1mX2QPA0jjhfQAguxmp9odFp5V7BWDchtpb09ZLBBZyUkIQm3t7VPbCLSYeUS0aw==
45
+ - NwSlTuHrh1bfJY/Gssu2NEka0qtxrgdfuRkIf+X2A8yoqfaPszYN24nBRZLntIb/Fdw60QHtBIk9mSgFrHk3bw==
44
46
  Date:
45
- - Sun, 08 May 2016 11:18:20 GMT
47
+ - Tue, 10 May 2016 17:27:30 GMT
46
48
  Transfer-Encoding:
47
49
  - chunked
48
50
  Connection:
@@ -61,5 +63,5 @@ http_interactions:
61
63
  by \u003Ca href=\"https://www.facebook.com/facebook/\">Facebook\u003C/a> on
62
64
  Freitag, 5. Dezember 2014\u003C/blockquote>\u003C/div>\u003C/div>","type":"video","version":"1.0","url":"https://www.facebook.com/facebook/videos/10153231379946729/","width":500}'
63
65
  http_version:
64
- recorded_at: Sun, 08 May 2016 11:18:20 GMT
66
+ recorded_at: Tue, 10 May 2016 17:27:30 GMT
65
67
  recorded_with: VCR 3.0.1
@@ -7,19 +7,21 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
+ User-Agent:
11
+ - Ruby/2.2.3
10
12
  Accept-Encoding:
11
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
14
  Accept:
13
15
  - "*/*"
14
- User-Agent:
15
- - Ruby
16
+ Host:
17
+ - www.flickr.com
16
18
  response:
17
19
  status:
18
20
  code: 200
19
21
  message: OK
20
22
  headers:
21
23
  Date:
22
- - Sun, 08 May 2016 11:40:25 GMT
24
+ - Tue, 10 May 2016 17:27:30 GMT
23
25
  Content-Type:
24
26
  - application/json
25
27
  Content-Length:
@@ -29,62 +31,62 @@ http_interactions:
29
31
  DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND
30
32
  PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
31
33
  Set-Cookie:
32
- - flrb=38; expires=Sun, 08-May-2016 12:40:25 GMT; path=/; domain=.flickr.com;
34
+ - flrb=49; expires=Tue, 10-May-2016 18:27:30 GMT; path=/; domain=.flickr.com;
33
35
  httponly
34
- - flrbcr=1462707625-b67a3d9b0854c842ce53753e27d64234075acae7; expires=Fri, 04-Nov-2016
35
- 11:40:25 GMT; path=/; domain=.flickr.com; httponly
36
- - flrbgdrp=1462707625-4bef76fc70128fe2d5e12762eef9e22e79aa7c17; expires=Fri,
37
- 04-Nov-2016 11:40:25 GMT; path=/; domain=.flickr.com; httponly
38
- - flrbgmrp=1462707625-ec8251e42ce735707df484b5897653b576bc89e0; expires=Fri,
39
- 04-Nov-2016 11:40:25 GMT; path=/; domain=.flickr.com; httponly
40
- - flrbgrp=1462707625-6ae545335b071762e4b82d69e93fad7e8b1dee32; expires=Fri,
41
- 04-Nov-2016 11:40:25 GMT; path=/; domain=.flickr.com; httponly
42
- - flrbp=1462707625-e00b0e2b6460b7887d36e964b61257e6be46813a; expires=Fri, 04-Nov-2016
43
- 11:40:25 GMT; path=/; domain=.flickr.com; httponly
44
- - flrbra=1462707625-efffcc30db4701886336e10e336e43e83ecf6213; expires=Fri, 04-Nov-2016
45
- 11:40:25 GMT; path=/; domain=.flickr.com; httponly
46
- - flrbras=1462707625-52a1f0b599c56a17d6892637eed1ae7d3cae8a03; expires=Fri,
47
- 04-Nov-2016 11:40:25 GMT; path=/; domain=.flickr.com; httponly
48
- - flrbre=1462707625-11de9df7ec4a347965b44c5fb975ecf049c7a4c5; expires=Fri, 04-Nov-2016
49
- 11:40:25 GMT; path=/; domain=.flickr.com; httponly
50
- - flrbrf=1462707625-53f18346c2fb15d0c5a996e0815e3d3a98cab359; expires=Fri, 04-Nov-2016
51
- 11:40:25 GMT; path=/; domain=.flickr.com; httponly
52
- - flrbrgs=1462707625-9edf83e5ae95e7661cccdee2b2d4a0dd2b1c412b; expires=Fri,
53
- 04-Nov-2016 11:40:25 GMT; path=/; domain=.flickr.com; httponly
54
- - flrbrp=1462707625-f132f53f1bbbb806053439cd8ea0eb8edfecf1e1; expires=Fri, 04-Nov-2016
55
- 11:40:25 GMT; path=/; domain=.flickr.com; httponly
56
- - flrbrps=1462707625-ecffa6ee671eb9c904dfe1b6c7fbcfea32c1136f; expires=Fri,
57
- 04-Nov-2016 11:40:25 GMT; path=/; domain=.flickr.com; httponly
58
- - flrbrst=1462707625-626662e8137b6b90d32fd96b0ee9616468974c06; expires=Fri,
59
- 04-Nov-2016 11:40:25 GMT; path=/; domain=.flickr.com; httponly
60
- - flrbs=1462707625-ebc58ed661a0b3f0b6060d18521809fcb596116d; expires=Fri, 04-Nov-2016
61
- 11:40:25 GMT; path=/; domain=.flickr.com; httponly
62
- - flrtags=1462707625-c3553fd8df0f152d5ee19d383a2f970731d937e8; expires=Fri,
63
- 04-Nov-2016 11:40:25 GMT; path=/; domain=.flickr.com; httponly
64
- - localization=en-us%3Bde%3Bde; expires=Sun, 06-May-2018 11:40:25 GMT; path=/;
36
+ - flrbcr=1462901250-16eec3513dd43eec5de0fe266948b49367670733; expires=Sun, 06-Nov-2016
37
+ 17:27:30 GMT; path=/; domain=.flickr.com; httponly
38
+ - flrbgdrp=1462901250-1406eb8bfcac14b53dfb323926be52b9dfa08679; expires=Sun,
39
+ 06-Nov-2016 17:27:30 GMT; path=/; domain=.flickr.com; httponly
40
+ - flrbgmrp=1462901250-d000e80da56261c68caa64e637c06169334f8cfe; expires=Sun,
41
+ 06-Nov-2016 17:27:30 GMT; path=/; domain=.flickr.com; httponly
42
+ - flrbgrp=1462901250-871a974f9430ecc4a1db4f6e767694fa45839b59; expires=Sun,
43
+ 06-Nov-2016 17:27:30 GMT; path=/; domain=.flickr.com; httponly
44
+ - flrbp=1462901250-b89dca47140505ec7a3c0eb6d53f068c4eb31686; expires=Sun, 06-Nov-2016
45
+ 17:27:30 GMT; path=/; domain=.flickr.com; httponly
46
+ - flrbra=1462901250-883d45fe5a187b7fea8308629a5d5363bd348931; expires=Sun, 06-Nov-2016
47
+ 17:27:30 GMT; path=/; domain=.flickr.com; httponly
48
+ - flrbras=1462901250-3ddd9e8a185a751f54331803f5a4786b80532aa6; expires=Sun,
49
+ 06-Nov-2016 17:27:30 GMT; path=/; domain=.flickr.com; httponly
50
+ - flrbre=1462901250-601cbbf50396b251c97edd5b40250bed905be376; expires=Sun, 06-Nov-2016
51
+ 17:27:30 GMT; path=/; domain=.flickr.com; httponly
52
+ - flrbrf=1462901250-3d8b9f8d006210db47536cb3ea5b4ad2785e403c; expires=Sun, 06-Nov-2016
53
+ 17:27:30 GMT; path=/; domain=.flickr.com; httponly
54
+ - flrbrgs=1462901250-1dd1efa1340b689b9f10f77a422d9a57a8a6a602; expires=Sun,
55
+ 06-Nov-2016 17:27:30 GMT; path=/; domain=.flickr.com; httponly
56
+ - flrbrp=1462901250-2e071b0370054678e31d3bfa1438db8bad0364fa; expires=Sun, 06-Nov-2016
57
+ 17:27:30 GMT; path=/; domain=.flickr.com; httponly
58
+ - flrbrps=1462901250-bc5dd2aec071f9d7404ac317272dadbae5a707ba; expires=Sun,
59
+ 06-Nov-2016 17:27:30 GMT; path=/; domain=.flickr.com; httponly
60
+ - flrbrst=1462901250-1c332e978ef4f22ec0e7bdc455cf3bacd726a09b; expires=Sun,
61
+ 06-Nov-2016 17:27:30 GMT; path=/; domain=.flickr.com; httponly
62
+ - flrbs=1462901250-3e83c8866ed725eed4900f0967fedd5807c798bb; expires=Sun, 06-Nov-2016
63
+ 17:27:30 GMT; path=/; domain=.flickr.com; httponly
64
+ - flrtags=1462901250-cc337a217432bd77847e867e3b3296ffa4719367; expires=Sun,
65
+ 06-Nov-2016 17:27:30 GMT; path=/; domain=.flickr.com; httponly
66
+ - localization=en-us%3Bde%3Bde; expires=Tue, 08-May-2018 17:27:30 GMT; path=/;
65
67
  domain=.flickr.com
66
- - xb=062622; expires=Wed, 09-May-2018 11:40:25 GMT; path=/; domain=.flickr.com
68
+ - xb=171599; expires=Fri, 11-May-2018 17:27:30 GMT; path=/; domain=.flickr.com
67
69
  Cache-Control:
68
70
  - private
69
71
  X-Served-By:
70
- - www251.flickr.bf1.yahoo.com
72
+ - www291.flickr.bf1.yahoo.com
71
73
  Vary:
72
74
  - Accept-Encoding
73
75
  Age:
74
- - '3'
76
+ - '0'
75
77
  Via:
76
- - http/1.1 fts109.flickr.bf1.yahoo.com (ApacheTrafficServer [cMsSf ]), http/1.1
77
- r05.ycpi.dea.yahoo.net (ApacheTrafficServer [cMsSf ])
78
+ - http/1.1 fts124.flickr.bf1.yahoo.com (ApacheTrafficServer [cMsSf ]), http/1.1
79
+ r10.ycpi.loa.yahoo.net (ApacheTrafficServer [cMsSf ])
78
80
  Server:
79
81
  - ATS
80
82
  Connection:
81
83
  - keep-alive
82
84
  Y-Trace:
83
- - BAEAQAAAAAAchDpGnO0DPwAAAAAAAAAA.W.ofeoVHYkAAAAAAAAAAAAFMlMoc1MpAAUyUyh1zva5cLpGAAAAAA--
85
+ - BAEAQAAAAACohNTsiiS5yQAAAAAAAAAAM2z3Uq_gF90AAAAAAAAAAAAFMoA9ZHkoAAUygD1n1O3eEmEuAAAAAA--
84
86
  body:
85
87
  encoding: ASCII-8BIT
86
88
  string: |
87
89
  {"type":"photo","flickr_type":"photo","title":"T-21","author_name":"BeyondBrickz","author_url":"https:\/\/www.flickr.com\/photos\/66038491@N06\/","width":"1024","height":"629","url":"https:\/\/farm8.staticflickr.com\/7231\/26861401435_c1dbfe8703_b.jpg","web_page":"https:\/\/www.flickr.com\/photos\/66038491@N06\/26861401435\/","thumbnail_url":"https:\/\/farm8.staticflickr.com\/7231\/26861401435_c1dbfe8703_q.jpg","thumbnail_width":150,"thumbnail_height":150,"web_page_short_url":"https:\/\/flic.kr\/p\/GVDGNX","license":"All Rights Reserved","license_id":0,"html":"<a data-flickr-embed=\"true\" href=\"https:\/\/www.flickr.com\/photos\/66038491@N06\/26861401435\/\" title=\"T-21 by BeyondBrickz, on Flickr\"><img src=\"https:\/\/farm8.staticflickr.com\/7231\/26861401435_c1dbfe8703_b.jpg\" width=\"1024\" height=\"629\" alt=\"T-21\"><\/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\/"}
88
90
  http_version:
89
- recorded_at: Sun, 08 May 2016 11:40:26 GMT
91
+ recorded_at: Tue, 10 May 2016 17:27:30 GMT
90
92
  recorded_with: VCR 3.0.1
@@ -7,12 +7,14 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
+ User-Agent:
11
+ - Ruby/2.2.3
10
12
  Accept-Encoding:
11
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
14
  Accept:
13
15
  - "*/*"
14
- User-Agent:
15
- - Ruby
16
+ Host:
17
+ - api.instagram.com
16
18
  response:
17
19
  status:
18
20
  code: 200
@@ -29,25 +31,25 @@ http_interactions:
29
31
  Cache-Control:
30
32
  - private, no-cache, no-store, must-revalidate
31
33
  Date:
32
- - Sun, 08 May 2016 10:22:56 GMT
34
+ - Tue, 10 May 2016 17:27:31 GMT
33
35
  Content-Type:
34
36
  - application/json
35
37
  Set-Cookie:
36
- - csrftoken=5b8bafe22a2d41248b3be8426b4f1170; expires=Sun, 07-May-2017 10:22:56
38
+ - csrftoken=8f4dacd4a68f2934b4de8db475c1e6cb; expires=Tue, 09-May-2017 17:27:31
37
39
  GMT; Max-Age=31449600; Path=/
38
- - mid=Vy8TgAAEAAHr9e0EiKy1oiFOtj6E; expires=Sat, 03-May-2036 10:22:56 GMT; Max-Age=630720000;
40
+ - mid=VzIaAwAEAAE3nyLm3C-s_zAajIeH; expires=Mon, 05-May-2036 17:27:31 GMT; Max-Age=630720000;
39
41
  Path=/
40
- - s_network=; expires=Sun, 08-May-2016 11:22:56 GMT; Max-Age=3600; Path=/
41
- - sessionid=IGSCf4e12422bb040f780b62a76f51d81658f436f18061debf80dcf2eefa20332090%3AQ4gZtzAIRGkrIW93eddUvjGtZa6jgSUk%3A%7B%22asns%22%3A%7B%2237.201.168.72%22%3A6830%2C%22time%22%3A1462702976%7D%7D;
42
- expires=Sat, 06-Aug-2016 10:22:56 GMT; httponly; Max-Age=7776000; Path=/
42
+ - s_network=; expires=Tue, 10-May-2016 18:27:31 GMT; Max-Age=3600; Path=/
43
+ - sessionid=IGSC172cb5dc8a3a464594e13968285068a25f697470da7f859efea1505ee7f6513e%3A5JABAA5qawnpjtBgRwf7r0dq39cMUpF1%3A%7B%22asns%22%3A%7B%2294.79.132.90%22%3A6830%2C%22time%22%3A1462901251%7D%7D;
44
+ expires=Mon, 08-Aug-2016 17:27:31 GMT; httponly; Max-Age=7776000; Path=/
43
45
  Connection:
44
46
  - keep-alive
45
47
  Content-Length:
46
- - '1402'
48
+ - '1403'
47
49
  body:
48
50
  encoding: ASCII-8BIT
49
51
  string: '{"provider_url": "https://www.instagram.com", "media_id": "558717847597368461_9538472",
50
- "author_name": "diegoquinteiro", "height": null, "thumbnail_url": "https://scontent-fra3-1.cdninstagram.com/t51.2885-15/e15/11358196_1472850273007829_614249870_n.jpg?ig_cache_key=NTU4NzE3ODQ3NTk3MzY4NDYx.2",
52
+ "author_name": "diegoquinteiro", "height": null, "thumbnail_url": "https://scontent-ams3-1.cdninstagram.com/t51.2885-15/e15/11358196_1472850273007829_614249870_n.jpg?ig_cache_key=NTU4NzE3ODQ3NTk3MzY4NDYx.2",
51
53
  "thumbnail_width": 640, "thumbnail_height": 640, "provider_name": "Instagram",
52
54
  "title": "Wii Gato (Lipe Sleep)", "html": "\u003cblockquote class=\"instagram-media\"
53
55
  data-instgrm-captioned data-instgrm-version=\"6\" style=\" background:#FFF;
@@ -71,5 +73,5 @@ http_interactions:
71
73
  "width": 658, "version": "1.0", "author_url": "https://www.instagram.com/diegoquinteiro",
72
74
  "author_id": 9538472, "type": "rich"}'
73
75
  http_version:
74
- recorded_at: Sun, 08 May 2016 10:22:56 GMT
76
+ recorded_at: Tue, 10 May 2016 17:27:31 GMT
75
77
  recorded_with: VCR 3.0.1
@@ -7,12 +7,14 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
+ User-Agent:
11
+ - Ruby/2.2.3
10
12
  Accept-Encoding:
11
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
14
  Accept:
13
15
  - "*/*"
14
- User-Agent:
15
- - Ruby
16
+ Host:
17
+ - www.kickstarter.com
16
18
  response:
17
19
  status:
18
20
  code: 200
@@ -35,15 +37,15 @@ http_interactions:
35
37
  Cache-Control:
36
38
  - max-age=0, private, must-revalidate
37
39
  X-Request-Id:
38
- - 38a20eff-15ff-4cd6-a5f6-fd9db97950bc
40
+ - 4a3cf514-c706-4767-988b-5097a6c230b8
39
41
  X-Runtime:
40
- - '0.020571'
42
+ - '0.033783'
41
43
  Transfer-Encoding:
42
44
  - chunked
43
45
  Accept-Ranges:
44
46
  - bytes
45
47
  Date:
46
- - Sun, 08 May 2016 11:58:02 GMT
48
+ - Tue, 10 May 2016 17:27:32 GMT
47
49
  Via:
48
50
  - 1.1 varnish
49
51
  Age:
@@ -51,7 +53,7 @@ http_interactions:
51
53
  Connection:
52
54
  - keep-alive
53
55
  X-Served-By:
54
- - cache-ams4148-AMS
56
+ - cache-ams4134-AMS
55
57
  X-Cache:
56
58
  - MISS
57
59
  X-Cache-Hits:
@@ -61,5 +63,5 @@ http_interactions:
61
63
  string: |
62
64
  {"version":"1.0","type":"rich","provider_name":"Kickstarter","provider_url":"https://www.kickstarter.com/","title":"Professional 3 Stage Knife Sharpener","author_name":"Kongqiang","author_url":"https://www.kickstarter.com/profile/531257408","thumbnail_url":"https://ksr-ugc.imgix.net/projects/2452435/photo-original.jpg?w=560&h=315&fit=fill&bg=FFFFFF&v=1461877181&auto=format&q=92&s=aae8e61c91e611fd27cc2db1c25a8916","thumbnail_width":560,"thumbnail_height":315.0,"width":480,"height":270.0,"html":"<iframe frameborder=\"0\" height=\"270.0\" scrolling=\"no\" src=\"https://www.kickstarter.com/projects/531257408/professional-3-stage-knife-sharpener/widget/video.html\" width=\"480\"></iframe>"}
63
65
  http_version:
64
- recorded_at: Sun, 08 May 2016 11:58:02 GMT
66
+ recorded_at: Tue, 10 May 2016 17:27:32 GMT
65
67
  recorded_with: VCR 3.0.1
@@ -7,12 +7,14 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
+ User-Agent:
11
+ - Ruby/2.2.3
10
12
  Accept-Encoding:
11
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
14
  Accept:
13
15
  - "*/*"
14
- User-Agent:
15
- - Ruby
16
+ Host:
17
+ - www.slideshare.net
16
18
  response:
17
19
  status:
18
20
  code: 200
@@ -21,7 +23,7 @@ http_interactions:
21
23
  Server:
22
24
  - nginx
23
25
  Date:
24
- - Sun, 08 May 2016 10:08:12 GMT
26
+ - Tue, 10 May 2016 17:27:39 GMT
25
27
  Content-Type:
26
28
  - application/json; charset=utf-8
27
29
  Status:
@@ -29,37 +31,37 @@ http_interactions:
29
31
  X-Content-Type-Options:
30
32
  - nosniff
31
33
  - nosniff
32
- X-Runtime:
33
- - '0.029925'
34
- X-Request-Uuid:
35
- - klA26xRYoRi0KQ4PET8oZw==
36
- X-Xss-Protection:
37
- - 1; mode=block
38
- X-Ua-Compatible:
39
- - IE=Edge,chrome=1
40
34
  Cache-Control:
41
35
  - max-age=0, private, must-revalidate
36
+ X-Ua-Compatible:
37
+ - IE=Edge,chrome=1
38
+ X-Xss-Protection:
39
+ - 1; mode=block
40
+ X-Runtime:
41
+ - '0.035600'
42
42
  X-Bench-Route:
43
43
  - oembed/get_oembed_code
44
44
  X-Request-Id:
45
- - 5c5aaef23f32736692a20264b64065c6
45
+ - a609ac1efddfbe20749eb86bc632ce64
46
+ X-Request-Uuid:
47
+ - V7ANU6f31m3Gsj1cnH8UfA==
46
48
  P3p:
47
49
  - CP="OTI DSP COR CUR ADM DEV PSD IVD CONo OUR IND"
48
50
  X-Varnish:
49
- - '401515260'
51
+ - '692146762'
50
52
  Age:
51
53
  - '0'
52
54
  Accept-Ranges:
53
55
  - bytes
54
56
  X-Fs-Uuid:
55
- - 0d60bf8acd8f4c14c085e9fac22a0000
57
+ - 1b83dfddf1444d142062cfe5aa2b0000
56
58
  X-Li-Fabric:
57
59
  - prod-lva1
58
60
  Set-Cookie:
59
- - SERVERID=r88|Vy8QD|Vy8QD; path=/
60
- - _uv_id=1897455083; Path=/; Domain=.slideshare.net
61
- - bcookie="v=2&fa22755a-e691-4093-86f4-fb717cc13105"; domain=.slideshare.net;
62
- Path=/; Expires=Tue, 08-May-2018 21:45:44 GMT
61
+ - SERVERID=r88|VzIaD|VzIaD; path=/
62
+ - _uv_id=1688034539; Path=/; Domain=.slideshare.net
63
+ - bcookie="v=2&771ddf0e-ec90-40c5-825c-89d29f698830"; domain=.slideshare.net;
64
+ Path=/; Expires=Fri, 11-May-2018 05:05:11 GMT
63
65
  Transfer-Encoding:
64
66
  - chunked
65
67
  Connection:
@@ -67,12 +69,10 @@ http_interactions:
67
69
  X-Li-Pop:
68
70
  - prod-tln1
69
71
  X-Li-Uuid:
70
- - DWC/is2PTBTAhen6wioAAA==
72
+ - G4Pf3fFETRQgYs/lqisAAA==
71
73
  body:
72
74
  encoding: ASCII-8BIT
73
- string: '{"slide_image_baseurl_suffix":"-1024.jpg","type":"rich","provider_name":"SlideShare","height":355,"total_slides":75,"title":"Business
74
- Quotes for 2011","provider_url":"http://www.slideshare.net","version":"1.0","slide_image_baseurl":"//image.slidesharecdn.com/110103quotes2010-12-110103073149-phpapp01/95/slide-","conversion_version":2,"width":425,"thumbnail_width":170,"version_no":"1294104671","author_url":"http://www.slideshare.net/haraldf","thumbnail_height":128,"slideshow_id":6435157,"html":"\u003Ciframe
75
- src=\"https://www.slideshare.net/slideshow/embed_code/key/6PCWPGFw9SwsAY\"
75
+ string: '{"html":"\u003Ciframe src=\"https://www.slideshare.net/slideshow/embed_code/key/6PCWPGFw9SwsAY\"
76
76
  width=\"427\" height=\"356\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\"
77
77
  scrolling=\"no\" style=\"border:1px solid #CCC; border-width:1px; margin-bottom:5px;
78
78
  max-width: 100%;\" allowfullscreen\u003E \u003C/iframe\u003E \u003Cdiv style=\"margin-bottom:5px\"\u003E
@@ -80,8 +80,9 @@ http_interactions:
80
80
  title=\"Business Quotes for 2011\" target=\"_blank\"\u003EBusiness Quotes
81
81
  for 2011\u003C/a\u003E \u003C/strong\u003E from \u003Cstrong\u003E\u003Ca
82
82
  href=\"http://www.slideshare.net/haraldf\" target=\"_blank\"\u003EHarald Felgner
83
- (PhD)\u003C/a\u003E\u003C/strong\u003E \u003C/div\u003E\n\n","author_name":"Harald
84
- Felgner (PhD)","thumbnail":"//cdn.slidesharecdn.com/ss_thumbnails/110103quotes2010-12-110103073149-phpapp01-thumbnail.jpg?cb=1294104671"}'
83
+ (PhD)\u003C/a\u003E\u003C/strong\u003E \u003C/div\u003E\n\n","slideshow_id":6435157,"author_url":"http://www.slideshare.net/haraldf","version":"1.0","thumbnail_width":170,"version_no":"1294104671","height":355,"title":"Business
84
+ Quotes for 2011","conversion_version":2,"slide_image_baseurl_suffix":"-1024.jpg","thumbnail_height":128,"width":425,"author_name":"Harald
85
+ Felgner (PhD)","type":"rich","provider_name":"SlideShare","provider_url":"http://www.slideshare.net","slide_image_baseurl":"//image.slidesharecdn.com/110103quotes2010-12-110103073149-phpapp01/95/slide-","thumbnail":"//cdn.slidesharecdn.com/ss_thumbnails/110103quotes2010-12-110103073149-phpapp01-thumbnail.jpg?cb=1294104671","total_slides":75}'
85
86
  http_version:
86
- recorded_at: Sun, 08 May 2016 10:08:12 GMT
87
+ recorded_at: Tue, 10 May 2016 17:27:39 GMT
87
88
  recorded_with: VCR 3.0.1
@@ -7,12 +7,14 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
+ User-Agent:
11
+ - Ruby/2.2.3
10
12
  Accept-Encoding:
11
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
14
  Accept:
13
15
  - "*/*"
14
- User-Agent:
15
- - Ruby
16
+ Host:
17
+ - soundcloud.com
16
18
  response:
17
19
  status:
18
20
  code: 200
@@ -31,14 +33,14 @@ http_interactions:
31
33
  Content-Type:
32
34
  - application/json; charset=utf-8
33
35
  Date:
34
- - Sun, 08 May 2016 11:49:57 GMT
36
+ - Tue, 10 May 2016 17:27:39 GMT
35
37
  Etag:
36
38
  - '"2d6b1f97d0ed1cbecef9424944baa728"'
37
39
  Server:
38
40
  - am/2
39
41
  Set-Cookie:
40
- - sc_anonymous_id=126181-468397-422745-556022; path=/; expires=Wed, 06 May 2026
41
- 11:49:57 GMT; domain=.soundcloud.com
42
+ - sc_anonymous_id=868951-405843-685342-731802; path=/; expires=Fri, 08 May 2026
43
+ 17:27:39 GMT; domain=.soundcloud.com
42
44
  Status:
43
45
  - 200 OK
44
46
  X-Frame-Options:
@@ -53,5 +55,5 @@ http_interactions:
53
55
  ","thumbnail_url":"http://i1.sndcdn.com/artworks-000067273316-smsiqx-t500x500.jpg","html":"\u003Ciframe
54
56
  width=\"100%\" height=\"400\" scrolling=\"no\" frameborder=\"no\" src=\"https://w.soundcloud.com/player/?visual=true\u0026url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F293\u0026show_artwork=true\"\u003E\u003C/iframe\u003E","author_name":"Forss","author_url":"http://soundcloud.com/forss"}'
55
57
  http_version:
56
- recorded_at: Sun, 08 May 2016 11:49:57 GMT
58
+ recorded_at: Tue, 10 May 2016 17:27:39 GMT
57
59
  recorded_with: VCR 3.0.1
@@ -7,12 +7,14 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
+ User-Agent:
11
+ - Ruby/2.2.3
10
12
  Accept-Encoding:
11
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
14
  Accept:
13
15
  - "*/*"
14
- User-Agent:
15
- - Ruby
16
+ Host:
17
+ - embed.spotify.com
16
18
  response:
17
19
  status:
18
20
  code: 200
@@ -21,9 +23,9 @@ http_interactions:
21
23
  Server:
22
24
  - nginx
23
25
  Date:
24
- - Sun, 08 May 2016 12:10:20 GMT
26
+ - Tue, 10 May 2016 17:27:40 GMT
25
27
  Content-Type:
26
- - text/html
28
+ - application/json
27
29
  Transfer-Encoding:
28
30
  - chunked
29
31
  Connection:
@@ -32,13 +34,18 @@ http_interactions:
32
34
  - timeout=10
33
35
  Vary:
34
36
  - Accept-Encoding
37
+ P3p:
38
+ - CP="NOI OUR"
35
39
  X-Content-Type-Options:
36
40
  - nosniff
37
41
  Strict-Transport-Security:
38
42
  - max-age=31536000;
39
43
  body:
40
44
  encoding: ASCII-8BIT
41
- string: '{"provider_url":"https:\/\/www.spotify.com","version":"1.0","thumbnail_width":300,"height":380,"thumbnail_height":300,"title":"John De Sohn - Dance Our Tears Away - Radio Edit","width":300,"thumbnail_url":"https:\/\/d3rt1990lpmkn.cloudfront.net\/cover\/35ff8ecde854e7c713dc4ffad2f31441e7bc1207","provider_name":"Spotify","type":"rich","html":"<iframe src=\"https:\/\/embed.spotify.com\/?uri=spotify:track:298gs9ATwr2rD9tGYJKlQR\" width=\"300\" height=\"380\" frameborder=\"0\" allowtransparency=\"true\"><\/iframe>"}'
45
+ string: '{"provider_url":"https:\/\/www.spotify.com","version":"1.0","thumbnail_width":300,"height":380,"thumbnail_height":300,"title":"John
46
+ De Sohn - Dance Our Tears Away - Radio Edit","width":300,"thumbnail_url":"https:\/\/d3rt1990lpmkn.cloudfront.net\/cover\/35ff8ecde854e7c713dc4ffad2f31441e7bc1207","provider_name":"Spotify","type":"rich","html":"<iframe
47
+ src=\"https:\/\/embed.spotify.com\/?uri=spotify:track:298gs9ATwr2rD9tGYJKlQR\"
48
+ width=\"300\" height=\"380\" frameborder=\"0\" allowtransparency=\"true\"><\/iframe>"}'
42
49
  http_version:
43
- recorded_at: Sun, 08 May 2016 12:10:20 GMT
50
+ recorded_at: Tue, 10 May 2016 17:27:40 GMT
44
51
  recorded_with: VCR 3.0.1
@@ -7,12 +7,14 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
+ User-Agent:
11
+ - Ruby/2.2.3
10
12
  Accept-Encoding:
11
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
14
  Accept:
13
15
  - "*/*"
14
- User-Agent:
15
- - Ruby
16
+ Host:
17
+ - publish.twitter.com
16
18
  response:
17
19
  status:
18
20
  code: 200
@@ -27,26 +29,26 @@ http_interactions:
27
29
  Content-Type:
28
30
  - application/json; charset=utf-8
29
31
  Date:
30
- - Sun, 08 May 2016 10:34:44 GMT
32
+ - Tue, 10 May 2016 17:27:40 GMT
31
33
  Expires:
32
- - Tue, 14 Apr 2116 10:34:44 GMT
34
+ - Thu, 16 Apr 2116 17:27:40 GMT
33
35
  Last-Modified:
34
- - Sun, 08 May 2016 10:34:44 GMT
36
+ - Tue, 10 May 2016 17:27:40 GMT
35
37
  Server:
36
- - tsa_o
38
+ - tsa_b
37
39
  Set-Cookie:
38
- - guest_id=v1%3A146270368433227856; Domain=.twitter.com; Path=/; Expires=Tue,
39
- 08-May-2018 10:34:44 UTC
40
+ - guest_id=v1%3A146290126090217547; Domain=.twitter.com; Path=/; Expires=Thu,
41
+ 10-May-2018 17:27:40 UTC
40
42
  Strict-Transport-Security:
41
43
  - max-age=631138519
42
44
  X-Connection-Hash:
43
- - 7cb3ac64bc2efd30d993cea7a81550d7
45
+ - a0e52c894a7cb519d0de0b80f683a258
44
46
  X-Content-Type-Options:
45
47
  - nosniff
46
48
  X-Frame-Options:
47
49
  - SAMEORIGIN
48
50
  X-Response-Time:
49
- - '110'
51
+ - '14'
50
52
  X-Xss-Protection:
51
53
  - 1; mode=block
52
54
  body:
@@ -62,5 +64,5 @@ http_interactions:
62
64
  3, 2014\u003C\/a\u003E\u003C\/blockquote\u003E\n\u003Cscript async src=\"\/\/platform.twitter.com\/widgets.js\"
63
65
  charset=\"utf-8\"\u003E\u003C\/script\u003E","width":550,"type":"rich","cache_age":"3153600000","provider_name":"Twitter","provider_url":"https:\/\/twitter.com","height":null,"version":"1.0"}'
64
66
  http_version:
65
- recorded_at: Sun, 08 May 2016 10:34:44 GMT
67
+ recorded_at: Tue, 10 May 2016 17:27:40 GMT
66
68
  recorded_with: VCR 3.0.1
@@ -7,34 +7,36 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
+ User-Agent:
11
+ - Ruby/2.2.3
10
12
  Accept-Encoding:
11
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
14
  Accept:
13
15
  - "*/*"
14
- User-Agent:
15
- - Ruby
16
+ Host:
17
+ - www.youtube.com
16
18
  response:
17
19
  status:
18
20
  code: 200
19
21
  message: OK
20
22
  headers:
21
- Content-Type:
22
- - application/json
23
- Cache-Control:
24
- - no-cache
25
- X-Content-Type-Options:
26
- - nosniff
27
23
  X-Xss-Protection:
28
24
  - 1; mode=block; report=https://www.google.com/appserve/security-bugs/log/youtube
29
- Strict-Transport-Security:
30
- - max-age=604800
25
+ Expires:
26
+ - Tue, 27 Apr 1971 19:44:06 EST
27
+ X-Content-Type-Options:
28
+ - nosniff
31
29
  P3p:
32
30
  - CP="This is not a P3P policy! See http://support.google.com/accounts/answer/151657?hl=en
33
31
  for more info."
34
- Expires:
35
- - Tue, 27 Apr 1971 19:44:06 EST
32
+ Strict-Transport-Security:
33
+ - max-age=604800
34
+ Content-Type:
35
+ - application/json
36
+ Cache-Control:
37
+ - no-cache
36
38
  Date:
37
- - Sun, 08 May 2016 09:52:44 GMT
39
+ - Tue, 10 May 2016 17:27:41 GMT
38
40
  Server:
39
41
  - Ytfe_Worker
40
42
  Alternate-Protocol:
@@ -45,13 +47,12 @@ http_interactions:
45
47
  - chunked
46
48
  body:
47
49
  encoding: ASCII-8BIT
48
- string: '{"author_name": "NyaAnimeParty", "author_url": "https:\/\/www.youtube.com\/user\/NyaAnimeParty",
49
- "thumbnail_url": "https:\/\/i.ytimg.com\/vi\/EErY75MXYXI\/hqdefault.jpg",
50
- "provider_name": "YouTube", "title": "Nyan Cat - 24 Hour Edition", "type":
51
- "video", "version": "1.0", "height": 344, "thumbnail_height": 360, "width":
52
- 459, "thumbnail_width": 480, "provider_url": "https:\/\/www.youtube.com\/",
53
- "html": "\u003ciframe width=\"459\" height=\"344\" src=\"https:\/\/www.youtube.com\/embed\/EErY75MXYXI?feature=oembed\"
54
- frameborder=\"0\" allowfullscreen\u003e\u003c\/iframe\u003e"}'
50
+ string: '{"provider_name": "YouTube", "width": 459, "thumbnail_url": "https:\/\/i.ytimg.com\/vi\/EErY75MXYXI\/hqdefault.jpg",
51
+ "thumbnail_height": 360, "type": "video", "provider_url": "https:\/\/www.youtube.com\/",
52
+ "height": 344, "thumbnail_width": 480, "author_url": "https:\/\/www.youtube.com\/user\/NyaAnimeParty",
53
+ "version": "1.0", "html": "\u003ciframe width=\"459\" height=\"344\" src=\"https:\/\/www.youtube.com\/embed\/EErY75MXYXI?feature=oembed\"
54
+ frameborder=\"0\" allowfullscreen\u003e\u003c\/iframe\u003e", "author_name":
55
+ "NyaAnimeParty", "title": "Nyan Cat - 24 Hour Edition"}'
55
56
  http_version:
56
- recorded_at: Sun, 08 May 2016 09:52:44 GMT
57
+ recorded_at: Tue, 10 May 2016 17:27:41 GMT
57
58
  recorded_with: VCR 3.0.1
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- class OhMyEmbed::Providers::BuildInDummy < OhMyEmbed::Provider
3
+ class OhMyEmbed::Providers::BuiltInDummy < OhMyEmbed::Provider
4
4
  self.schemes = [
5
5
  '//*.example.com/*'
6
6
  ]
@@ -16,7 +16,7 @@ describe OhMyEmbed::Crawler do
16
16
  end
17
17
 
18
18
  it 'register the default providers with option all: true' do
19
- expect_any_instance_of(OhMyEmbed::Crawler).to receive(:register_all_build_in_providers)
19
+ expect_any_instance_of(OhMyEmbed::Crawler).to receive(:register_all_built_in_providers)
20
20
 
21
21
  OhMyEmbed::Crawler.new all: true
22
22
  end
@@ -31,13 +31,13 @@ describe OhMyEmbed::Crawler do
31
31
 
32
32
  describe '#register' do
33
33
  it 'finds the provider by symbol and add it to the providers list' do
34
- expect{ crawler.register(:build_in_dummy) }.to change{ crawler.providers.count }.from(0).to(1)
35
- expect(crawler.providers.first).to be OhMyEmbed::Providers::BuildInDummy
34
+ expect{ crawler.register(:built_in_dummy) }.to change{ crawler.providers.count }.from(0).to(1)
35
+ expect(crawler.providers.first).to be OhMyEmbed::Providers::BuiltInDummy
36
36
  end
37
37
 
38
38
  it 'it add the provider class to the providers list' do
39
- expect{ crawler.register(OhMyEmbed::Providers::BuildInDummy) }.to change{ crawler.providers.count }.from(0).to(1)
40
- expect(crawler.providers.first).to be OhMyEmbed::Providers::BuildInDummy
39
+ expect{ crawler.register(OhMyEmbed::Providers::BuiltInDummy) }.to change{ crawler.providers.count }.from(0).to(1)
40
+ expect(crawler.providers.first).to be OhMyEmbed::Providers::BuiltInDummy
41
41
  end
42
42
 
43
43
  it 'raises an error if no provider class found' do
@@ -45,30 +45,30 @@ describe OhMyEmbed::Crawler do
45
45
  end
46
46
  end
47
47
 
48
- describe '#register_all_build_in_providers' do
49
- it 'adds all the build-in providers' do
50
- expect{ crawler.register_all_build_in_providers }.to change{ crawler.providers.count }
51
- expect(crawler.providers.include?(OhMyEmbed::Providers::BuildInDummy)).to be true
48
+ describe '#register_all_built_in_providers' do
49
+ it 'adds all the built-in providers' do
50
+ expect{ crawler.register_all_built_in_providers }.to change{ crawler.providers.count }
51
+ expect(crawler.providers.include?(OhMyEmbed::Providers::BuiltInDummy)).to be true
52
52
  end
53
53
  end
54
54
 
55
- describe '#build_in_providers' do
56
- it 'returns a symbols array with all build in providers' do
57
- build_in_providers = crawler.build_in_providers
58
- expect(build_in_providers).to be_a Array
59
- expect(build_in_providers.all?{ |p| p.is_a? Symbol }).to be true
60
- expect(build_in_providers.include?(:BuildInDummy)).to be true
55
+ describe '#built_in_providers' do
56
+ it 'returns a symbols array with all built-in providers' do
57
+ built_in_providers = crawler.built_in_providers
58
+ expect(built_in_providers).to be_a Array
59
+ expect(built_in_providers.all?{ |p| p.is_a? Symbol }).to be true
60
+ expect(built_in_providers.include?(:BuiltInDummy)).to be true
61
61
  end
62
62
  end
63
63
 
64
64
  context 'crawler with a dummy provider' do
65
65
  before do
66
- crawler.register :build_in_dummy
66
+ crawler.register :built_in_dummy
67
67
  end
68
68
 
69
69
  describe '#fetch' do
70
70
  it 'calls fetch on the found provider and return an OhMyEmbed::Response' do
71
- expect(OhMyEmbed::Providers::BuildInDummy).to receive(:fetch).with(url).and_return(OhMyEmbed::Response.new(OhMyEmbed::Providers::BuildInDummy, url))
71
+ expect(OhMyEmbed::Providers::BuiltInDummy).to receive(:fetch).with(url).and_return(OhMyEmbed::Response.new(OhMyEmbed::Providers::BuiltInDummy, url))
72
72
  response = crawler.fetch(url)
73
73
 
74
74
  expect(response).to be_a OhMyEmbed::Response
@@ -82,7 +82,7 @@ describe OhMyEmbed::Crawler do
82
82
 
83
83
  it 'finds and return the matching provider' do
84
84
  provider = crawler.provider_for(url)
85
- expect(provider).to be OhMyEmbed::Providers::BuildInDummy
85
+ expect(provider).to be OhMyEmbed::Providers::BuiltInDummy
86
86
  end
87
87
  end
88
88
 
@@ -29,11 +29,9 @@ describe OhMyEmbed::Providers::Instagram do
29
29
  url: 'https://www.instagram.com/diegoquinteiro',
30
30
  })
31
31
 
32
- expect(response.thumbnail).to eq({
33
- url: 'https://scontent-fra3-1.cdninstagram.com/t51.2885-15/e15/11358196_1472850273007829_614249870_n.jpg?ig_cache_key=NTU4NzE3ODQ3NTk3MzY4NDYx.2',
34
- width: 640,
35
- height: 640,
36
- })
32
+ expect(response.thumbnail[:url]).to be_a String
33
+ expect(response.thumbnail[:width]).to eq 640
34
+ expect(response.thumbnail[:height]).to eq 640
37
35
 
38
36
  expect(response.embed[:html]).to be_a String
39
37
  expect(response.embed[:width]).to eq 658
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oh-my-embed
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Axel Wahlen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-09 00:00:00.000000000 Z
11
+ date: 2016-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport