onebox 1.8.83 → 1.8.84

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
  SHA256:
3
- metadata.gz: 4a08cfcea7f4b84d1a07dde3fd32f4bd05c86c8daba270ca35f7d55c331c1043
4
- data.tar.gz: 988c9d45ce626ac665cbb7447afd64a4629ace8c83cfa43bc54a3e6a3de0e12b
3
+ metadata.gz: c9b50b734723c9e23516eef827a2ef7a823c084fac2cf0cc03892adb1dcab4dc
4
+ data.tar.gz: a677472a42ea5df1c4aaf7c96a213c5d2c041dd2d515a4546eb6b1b03383dfda
5
5
  SHA512:
6
- metadata.gz: 33719b6c4d8f1fb50b1c7c81c3503c2f7416c91ea1e2eb9fcfdbacc7fceefafc3af61f7904fe53dc368b5e514f04f7b20e6f174ab19217334e899fb54796bcae
7
- data.tar.gz: 6cdcdcdef8dcc6f4bbd9231cf45739748af5aa436c515ee466f05400981b997d8fcd8cf66d160acaa36a1ef0e73da85f7d4ecc563d2140e647d5068deb099f91
6
+ metadata.gz: 233915396f3c330770d7299785f6101c9a7269d59dae2fca5c35718c75c1852aa95bb4a0bfd03fb8df6b7f424b8ce7db1cb7f2d50d93eaf270b2141dedd281c2
7
+ data.tar.gz: 63f2e5e86390ab51618ab3b45664b16e0d0ee322f662ef61de1cbf3f96b7fa33759e4570092ae1c798e90184f0e262b18ba035e7dc5934d7916fa3528360daa9
data/Gemfile.lock CHANGED
@@ -51,12 +51,12 @@ GEM
51
51
  mini_portile2 (2.4.0)
52
52
  mocha (1.8.0)
53
53
  metaclass (~> 0.0.1)
54
- moneta (1.1.0)
54
+ moneta (1.0.0)
55
55
  multi_json (1.13.1)
56
56
  multipart-post (2.0.0)
57
57
  mustache (1.1.0)
58
58
  nenv (0.3.0)
59
- nokogiri (1.10.2)
59
+ nokogiri (1.10.1)
60
60
  mini_portile2 (~> 2.4.0)
61
61
  nokogumbo (2.0.1)
62
62
  nokogiri (~> 1.8, >= 1.8.4)
data/lib/onebox/engine.rb CHANGED
@@ -187,3 +187,4 @@ require_relative "engine/gitlab_blob_onebox"
187
187
  require_relative "engine/google_photos_onebox"
188
188
  require_relative "engine/kaltura_onebox"
189
189
  require_relative "engine/reddit_image_onebox"
190
+ require_relative "engine/google_drive_onebox"
@@ -0,0 +1,28 @@
1
+ module Onebox
2
+ module Engine
3
+ class GoogleDriveOnebox
4
+ include Engine
5
+ include StandardEmbed
6
+ include LayoutSupport
7
+
8
+ matches_regexp /^(https?:)?\/\/(drive\.google\.com)\/file\/d\/(?<key>[\w-]*)\/.+$/
9
+ always_https
10
+
11
+ protected
12
+
13
+ def data
14
+ og_data = get_opengraph
15
+ title = og_data.title || "Google Drive"
16
+ title = "#{og_data.title} (video)" if og_data.type =~ /^video[\/\.]/
17
+ description = og_data.description || "Google Drive file."
18
+
19
+ result = { link: link,
20
+ title: title,
21
+ description: Onebox::Helpers.truncate(description, 250),
22
+ image: og_data.image
23
+ }
24
+ result
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onebox
4
- VERSION = "1.8.83"
4
+ VERSION = "1.8.84"
5
5
  end
@@ -0,0 +1,9 @@
1
+ {{^image}}
2
+ <a href='{{link}}' target="_blank"><span class='googledocs-onebox-logo g-drive-logo'></span></a>
3
+ {{/image}}
4
+
5
+ {{#image}}<img src="{{image}}" class="thumbnail"/>{{/image}}
6
+
7
+ <h3><a href='{{link}}' target="_blank">{{title}}</a></h3>
8
+
9
+ <p>{{description}}</p>
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.83
4
+ version: 1.8.84
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-04 00:00:00.000000000 Z
13
+ date: 2019-04-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -322,6 +322,7 @@ files:
322
322
  - lib/onebox/engine/gitlab_blob_onebox.rb
323
323
  - lib/onebox/engine/google_calendar_onebox.rb
324
324
  - lib/onebox/engine/google_docs_onebox.rb
325
+ - lib/onebox/engine/google_drive_onebox.rb
325
326
  - lib/onebox/engine/google_maps_onebox.rb
326
327
  - lib/onebox/engine/google_photos_onebox.rb
327
328
  - lib/onebox/engine/google_play_app_onebox.rb
@@ -388,6 +389,7 @@ files:
388
389
  - templates/githubpullrequest.mustache
389
390
  - templates/gitlabblob.mustache
390
391
  - templates/googledocs.mustache
392
+ - templates/googledrive.mustache
391
393
  - templates/googleplayapp.mustache
392
394
  - templates/instagram.mustache
393
395
  - templates/pastebin.mustache