onebox 1.5.11 → 1.5.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onebox/engine/standard_embed.rb +3 -2
- data/lib/onebox/helpers.rb +1 -2
- data/lib/onebox/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e46a3646e53f3419474f543aff459f7f2c4c4b75
|
4
|
+
data.tar.gz: baf10d809c943a1ef4ef4629ab45ba69a1379b9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce73f343fecff549f1c155b7b614d34118e423326725e45f411eaf6d7107a4c72ab2f308efca65f128597339d5657fbac576438ab3ba4436afbf0516fb2b64ce
|
7
|
+
data.tar.gz: 936dc764425670e1eed82ec79c4f843e08d26b0062381d8692ec02825c2e18da40144c463ae8981dc367fc7f2325439fa8a6c0a607e9e270fba3962047291945
|
@@ -43,9 +43,10 @@ module Onebox
|
|
43
43
|
|
44
44
|
def fetch_oembed_raw(oembed_url)
|
45
45
|
return unless oembed_url
|
46
|
+
oembed_url = oembed_url['href'] unless oembed_url['href'].nil?
|
46
47
|
@raw = Onebox::Helpers.symbolize_keys(::MultiJson.load(Onebox::Helpers.fetch_response(oembed_url).body))
|
47
|
-
|
48
|
-
|
48
|
+
rescue Errno::ECONNREFUSED, Net::HTTPError, MultiJson::LoadError
|
49
|
+
@raw = nil
|
49
50
|
end
|
50
51
|
|
51
52
|
def parse_open_graph(html, og_url)
|
data/lib/onebox/helpers.rb
CHANGED
@@ -21,7 +21,7 @@ module Onebox
|
|
21
21
|
html.gsub(/<[^>]+>/, ' ').gsub(/\n/, '')
|
22
22
|
end
|
23
23
|
|
24
|
-
def self.fetch_response(location, limit = 5, domain = nil,headers=nil)
|
24
|
+
def self.fetch_response(location, limit = 5, domain = nil, headers = nil)
|
25
25
|
raise Net::HTTPError.new('HTTP redirect too deep', location) if limit == 0
|
26
26
|
|
27
27
|
uri = URI(location)
|
@@ -53,4 +53,3 @@ module Onebox
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
56
|
-
|
data/lib/onebox/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onebox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joanna Zeta
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-02-
|
13
|
+
date: 2015-02-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: multi_json
|
@@ -407,7 +407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
407
407
|
version: '0'
|
408
408
|
requirements: []
|
409
409
|
rubyforge_project:
|
410
|
-
rubygems_version: 2.
|
410
|
+
rubygems_version: 2.4.3
|
411
411
|
signing_key:
|
412
412
|
specification_version: 4
|
413
413
|
summary: A gem for turning URLs into previews.
|
@@ -460,4 +460,3 @@ test_files:
|
|
460
460
|
- spec/lib/onebox_spec.rb
|
461
461
|
- spec/spec_helper.rb
|
462
462
|
- spec/support/html_spec_helper.rb
|
463
|
-
has_rdoc:
|