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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 587d6a0e31a6958233d0c60029e7b6c7a68d44f5
4
- data.tar.gz: cab00590e4a02643f47b93fc2a01ef113d6b1556
3
+ metadata.gz: e46a3646e53f3419474f543aff459f7f2c4c4b75
4
+ data.tar.gz: baf10d809c943a1ef4ef4629ab45ba69a1379b9e
5
5
  SHA512:
6
- metadata.gz: a558b1ce820de94ba4bde61c9a1c5cd40b2944ce9f9e79295a740b03b02e14224105cb6c1eb7333e8b1fcb9f465e9616b86535ef2d0b021d5a6576832b44f782
7
- data.tar.gz: cf34ae88a37410eb5ff3ec33d94b7e6d7a99ee68b4d3e60460e48bd31c0ff306be6118ef84b34804bb4840a5395017490f2c0d51b645454f9349d3396344be53
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
- # rescue Errno::ECONNREFUSED, Net::HTTPError, MultiJson::LoadError
48
- # @raw = nil
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)
@@ -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
-
@@ -1,3 +1,3 @@
1
1
  module Onebox
2
- VERSION = "1.5.11"
2
+ VERSION = "1.5.12"
3
3
  end
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.11
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-03 00:00:00.000000000 Z
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.1.11
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: