onebox 1.8.83 → 1.8.84
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/onebox/engine.rb +1 -0
- data/lib/onebox/engine/google_drive_onebox.rb +28 -0
- data/lib/onebox/version.rb +1 -1
- data/templates/googledrive.mustache +9 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9b50b734723c9e23516eef827a2ef7a823c084fac2cf0cc03892adb1dcab4dc
|
4
|
+
data.tar.gz: a677472a42ea5df1c4aaf7c96a213c5d2c041dd2d515a4546eb6b1b03383dfda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
@@ -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
|
data/lib/onebox/version.rb
CHANGED
@@ -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.
|
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-
|
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
|