onebox 1.8.86 → 1.8.87

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
  SHA256:
3
- metadata.gz: 631c22d7ba52fd8d88052176bc42a74bfec14409ec65da82c9b8bf8eb64bae79
4
- data.tar.gz: '09d424a57ca87f9dd5c3be877c9b8ad0bd3cf4101536d3bbcf158f9ef9fef7de'
3
+ metadata.gz: feb212710bc29cb9f40fe3a693fa2f1da63b4c62ef45f95bf16dd5665b6f2ea7
4
+ data.tar.gz: 5d1f092e320bd28f3ee17feac0e7b91139e769b0b42a4aeecc20f5e99dab2a00
5
5
  SHA512:
6
- metadata.gz: 65cd19cd9e45693343c0cc470f9511d53eb7c43829a56591f18df1bd72583847c29533074ccc366916a45545a7824849298e7ed3d4bb42031f76d431a1824c6e
7
- data.tar.gz: 00f273d8ba17d3d4a5046bed67bccba703bd02d3f3ea96d727685fab1b4406dab017650872e8fdc329ffe6ad50f5d683884b37c7367200d5f7f29d387c5a6d1e
6
+ metadata.gz: 18bc5e6a7f72de373929ddbcbec7605135911a5126406cb98829f68986332a0d936da17dc0c219daa30619111cb29e1ba0a3c38d6db63d443cb3e83eea441365
7
+ data.tar.gz: 0406d24b43f94876bc127b44a5e268ef2a56c4ad6233781d8f9a2d465b0b56e044c96ffaca05f84f6e6623cdb0f7faef5fe047642f20a8d0fb89fab070ee1b39
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- onebox (1.8.86)
4
+ onebox (1.8.87)
5
5
  htmlentities (~> 4.3)
6
6
  moneta (~> 1.0)
7
7
  multi_json (~> 1.11)
data/lib/onebox/engine.rb CHANGED
@@ -182,6 +182,7 @@ require_relative "engine/trello_onebox"
182
182
  require_relative "engine/wechat_mp_onebox"
183
183
  require_relative "engine/cloudapp_onebox"
184
184
  require_relative "engine/wistia_onebox"
185
+ require_relative "engine/simplecast_onebox"
185
186
  require_relative "engine/instagram_onebox"
186
187
  require_relative "engine/gitlab_blob_onebox"
187
188
  require_relative "engine/google_photos_onebox"
@@ -7,7 +7,7 @@ module Onebox
7
7
  include StandardEmbed
8
8
  include LayoutSupport
9
9
 
10
- matches_regexp(/^https?:\/\/(?:www\.)?(?:instagram\.com|instagr\.am)\/[a-zA-Z0-9]+\/p\//)
10
+ matches_regexp(/^https?:\/\/(?:www\.)?(?:instagram\.com|instagr\.am)\/?(?:.*)\/p\//)
11
11
  always_https
12
12
 
13
13
  def data
@@ -0,0 +1,33 @@
1
+ module Onebox
2
+ module Engine
3
+ class SimplecastOnebox
4
+ include Engine
5
+ include StandardEmbed
6
+
7
+ matches_regexp(/https?:\/\/(.+)?simplecast.com\/(episodes|s)\/.*/)
8
+ always_https
9
+
10
+ def to_html
11
+ get_oembed.html
12
+ end
13
+
14
+ def placeholder_html
15
+ oembed = get_oembed
16
+ return if Onebox::Helpers.blank?(oembed.thumbnail_url)
17
+ "<img src='#{oembed.thumbnail_url}' #{oembed.title_attr}>"
18
+ end
19
+
20
+ private
21
+
22
+ def get_oembed_url
23
+ if id = url.scan(/\A.*?-([a-zA-Z0-9]*)\Z/).flatten.first
24
+ oembed_url = "https://simplecast.com/s/#{id}"
25
+ else
26
+ oembed_url = url
27
+ end
28
+
29
+ "https://simplecast.com/oembed?url=#{oembed_url}"
30
+ end
31
+ end
32
+ end
33
+ end
@@ -95,7 +95,6 @@ module Onebox
95
95
  samsung.com
96
96
  screenr.com
97
97
  scribd.com
98
- simplecast.com
99
98
  slideshare.net
100
99
  sourceforge.net
101
100
  speakerdeck.com
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onebox
4
- VERSION = "1.8.86"
4
+ VERSION = "1.8.87"
5
5
  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.86
4
+ version: 1.8.87
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: 2019-04-24 00:00:00.000000000 Z
13
+ date: 2019-04-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -339,6 +339,7 @@ files:
339
339
  - lib/onebox/engine/pubmed_onebox.rb
340
340
  - lib/onebox/engine/reddit_image_onebox.rb
341
341
  - lib/onebox/engine/replit_onebox.rb
342
+ - lib/onebox/engine/simplecast_onebox.rb
342
343
  - lib/onebox/engine/sketchfab_onebox.rb
343
344
  - lib/onebox/engine/slides_onebox.rb
344
345
  - lib/onebox/engine/soundcloud_onebox.rb