onebox 1.8.20 → 1.8.21
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eafb5f0b66a7560af96e2b5edb0457514d181968
|
4
|
+
data.tar.gz: 9ecbf40e30463e624df105d5ef1643a6421875a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87bfa72f7fbc7fbf6971d955fa9f87515f7eaaf80f4d4ea009c34cd1970d5fb03964adef45e4d4b9e29a6877189a017a80fc8e2ff03a7a0597141a016745cc76
|
7
|
+
data.tar.gz: 9954790f0a61a7394935346249bf11a43d3e118890d7a6ca8629fd39c59ae2d063311242e7469998275ec5321fce11a2740cc94ca907dfb6f93833fe0f204942
|
@@ -3,7 +3,7 @@ require_relative '../mixins/twitch_onebox'
|
|
3
3
|
class Onebox::Engine::TwitchStreamOnebox
|
4
4
|
|
5
5
|
def self.twitch_regexp
|
6
|
-
/^https?:\/\/(?:www\.)?twitch\.tv\/(?!directory)([a-zA-Z0-9_]{4,25})$/
|
6
|
+
/^https?:\/\/(?:www\.|go\.)?twitch\.tv\/(?!directory)([a-zA-Z0-9_]{4,25})$/
|
7
7
|
end
|
8
8
|
include Onebox::Mixins::TwitchOnebox
|
9
9
|
|
@@ -217,10 +217,10 @@ module Onebox
|
|
217
217
|
d[:video] = d[:video_secure_url] || d[:video_url] || d[:video]
|
218
218
|
|
219
219
|
# Twitter labels
|
220
|
-
d[:label1] = Sanitize.fragment(Onebox::Helpers.truncate(d[:label1].strip))
|
221
|
-
d[:data1] = Sanitize.fragment(Onebox::Helpers.truncate(d[:data1].strip))
|
222
|
-
d[:label2] = Sanitize.fragment(Onebox::Helpers.truncate(d[:label2].strip))
|
223
|
-
d[:data2] = Sanitize.fragment(Onebox::Helpers.truncate(d[:data2].strip))
|
220
|
+
d[:label1] = Sanitize.fragment(Onebox::Helpers.truncate(d[:label1].strip)) unless Onebox::Helpers.blank?(d[:label1])
|
221
|
+
d[:data1] = Sanitize.fragment(Onebox::Helpers.truncate(d[:data1].strip)) unless Onebox::Helpers.blank?(d[:data1])
|
222
|
+
d[:label2] = Sanitize.fragment(Onebox::Helpers.truncate(d[:label2].strip)) unless Onebox::Helpers.blank?(d[:label2])
|
223
|
+
d[:data2] = Sanitize.fragment(Onebox::Helpers.truncate(d[:data2].strip)) unless Onebox::Helpers.blank?(d[:data2])
|
224
224
|
|
225
225
|
d
|
226
226
|
end
|
data/lib/onebox/version.rb
CHANGED
@@ -7,4 +7,9 @@ describe Onebox::Engine::TwitchStreamOnebox do
|
|
7
7
|
|
8
8
|
end
|
9
9
|
|
10
|
+
it "works in the twitch new interface/url" do
|
11
|
+
expect(Onebox.preview('https://go.twitch.tv/admiralbulldog').to_s).to match(/<iframe src="\/\/player\.twitch\.tv\/\?channel=admiralbulldog/)
|
12
|
+
|
13
|
+
end
|
14
|
+
|
10
15
|
end
|