onebox 1.5.44 → 1.5.45
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e998911edf06c4987d5e9fb5655db49332b1cf3e
|
4
|
+
data.tar.gz: c5c5efd4450eafe4e028226ed2aedd9e0268787c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
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)
|
data/lib/onebox/version.rb
CHANGED
@@ -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.
|
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-
|
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.
|
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:
|