onebox 1.5.44 → 1.5.45

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: 582db3162e74f04ce27959dbef0e385e27621406
4
- data.tar.gz: 026c67c405e0e80fb0ceb1c7553eed6c724eb170
3
+ metadata.gz: e998911edf06c4987d5e9fb5655db49332b1cf3e
4
+ data.tar.gz: c5c5efd4450eafe4e028226ed2aedd9e0268787c
5
5
  SHA512:
6
- metadata.gz: 1bce5e96adfaecb9ffd25c014f0e96b501e32738965b12a3fd3458b3a619dc5fe82718bfc7e6c6d4fd3de0745d97db5eda460c6e99dd50e4ec7d70b643e04e33
7
- data.tar.gz: 37eaee6c5aab1784e5af0d6ca086de9eb9aa8c18de8bf46e59f36ec845895e406db5c3e12b334c9f5d9a57eb382e1cd21f328533938679ec10e5700fab67a228
6
+ metadata.gz: a7f74b6b0874a4fced20ab115bafcab8cb10788d8e6f1b2d3c5a0c2daab098d99acefae73b47ffa61c853f88015054d47d1d8600f5eeb9cce7daa07db04e6032
7
+ data.tar.gz: 609eff1c52bfa7d03b944ce7579542ceabaaafc33876abefa01765fb62ea68a3ce32a1d7f37b157208fcb0a32dd51ac920aa2d68b7db699e897d71b0c806d0e6
@@ -8,7 +8,7 @@ module Onebox
8
8
  include HTML
9
9
 
10
10
  always_https
11
- matches_regexp(/^https?:\/\/(?:www)\.amazon\.(?<tld>com|ca|de|it|es|fr|co\.jp|co\.uk|cn|in|com\.br)\//)
11
+ matches_regexp(/^https?:\/\/(?:www\.)?(amazon|amzn)\.(?<tld>com|ca|de|it|es|fr|co\.jp|co\.uk|cn|in|com\.br)\//)
12
12
 
13
13
  def url
14
14
  if match && match[:id]
@@ -3,7 +3,7 @@ module Onebox
3
3
  class AudioOnebox
4
4
  include Engine
5
5
 
6
- matches_regexp /^(https?:)?\/\/.*\.(mp3|ogg|wav)(\?.*)?$/
6
+ matches_regexp /^(https?:)?\/\/.*\.(mp3|ogg|wav|m4a)(\?.*)?$/
7
7
 
8
8
  def always_https?
9
9
  WhitelistedGenericOnebox.host_matches(uri, WhitelistedGenericOnebox.https_hosts)
@@ -1,3 +1,3 @@
1
1
  module Onebox
2
- VERSION = "1.5.44"
2
+ VERSION = "1.5.45"
3
3
  end
@@ -13,6 +13,10 @@ describe Onebox::Engine::AudioOnebox do
13
13
  expect(Onebox.preview('http://download.wavetlan.com/SVV/Media/HTTP/sample14.wav').to_s).to match(/<audio/)
14
14
  end
15
15
 
16
+ it "supports m4a" do
17
+ expect(Onebox.preview('http://techslides.com/demos/samples/sample.m4a').to_s).to match(/<audio/)
18
+ end
19
+
16
20
  it "supports URLs with query parameters" do
17
21
  expect(Onebox.preview('https://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg?foo=bar').to_s).to match(/<audio/)
18
22
  end
@@ -20,7 +24,7 @@ describe Onebox::Engine::AudioOnebox do
20
24
  it "supports protocol relative URLs" do
21
25
  expect(Onebox.preview('//upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg').to_s).to match(/<audio/)
22
26
  end
23
-
27
+
24
28
  it "includes a fallback direct link to the audio" do
25
29
  expect(Onebox.preview('http://kolber.github.io/audiojs/demos/mp3/juicy.mp3').to_s).to match(/<a.*mp3/)
26
30
  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.44
4
+ version: 1.5.45
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: 2016-08-02 00:00:00.000000000 Z
13
+ date: 2016-08-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -437,7 +437,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
437
437
  version: '0'
438
438
  requirements: []
439
439
  rubyforge_project:
440
- rubygems_version: 2.5.1
440
+ rubygems_version: 2.6.6
441
441
  signing_key:
442
442
  specification_version: 4
443
443
  summary: A gem for turning URLs into previews.
@@ -497,3 +497,4 @@ test_files:
497
497
  - spec/lib/onebox_spec.rb
498
498
  - spec/spec_helper.rb
499
499
  - spec/support/html_spec_helper.rb
500
+ has_rdoc: