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: d0d747ccf49e968f722763eca04698951e5c7e68
4
- data.tar.gz: 35af72508f38423f9967f3eef0d1e91a13a5dbb7
3
+ metadata.gz: eafb5f0b66a7560af96e2b5edb0457514d181968
4
+ data.tar.gz: 9ecbf40e30463e624df105d5ef1643a6421875a2
5
5
  SHA512:
6
- metadata.gz: 461d1871c66df3448f96e8a6283bea3be8476cae3352b25708913734dd3af2ecd93eee2f413b0459a3a25bb3ed7f984644fda7825cbef147a9b27f1bc4403629
7
- data.tar.gz: 5751126eacb1be8122f6ff008fb981a6e38ec00fb4c02586a6662a28ad817d9e65d666fb3d279c51bb53f221f25717ff9bf3b1531a9110c43270c6d8c1baebba
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
@@ -1,3 +1,3 @@
1
1
  module Onebox
2
- VERSION = "1.8.20"
2
+ VERSION = "1.8.21"
3
3
  end
@@ -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
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.8.20
4
+ version: 1.8.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joanna Zeta