onebox 1.9.25 → 1.9.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +15 -0
- data/lib/onebox/engine.rb +0 -1
- data/lib/onebox/engine/google_maps_onebox.rb +1 -3
- data/lib/onebox/helpers.rb +4 -0
- data/lib/onebox/version.rb +1 -1
- metadata +2 -4
- data/lib/onebox/engine/douban_onebox.rb +0 -25
- data/templates/douban.mustache +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84aac5ae01b5513e3f3f24ab5dcef3ea04fce6f760acd88439cbab7aa0155232
|
4
|
+
data.tar.gz: 48e36383d31afec9d40ac32194756107c911de597596a9b3231967c6a22b8462
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 275d1316c48338b60eab191e076117619fd9ecb0f944cc88429151316df7fab10fd2251035ddbda5a0dd711700d75aa9c19490d42ad41c295e799c7a38168625
|
7
|
+
data.tar.gz: d89cbca0ea276ed3c6c7d6b96e72763e42cbbd3c14e249c6516601b78e6239b78c24136dbaa628de9b42c246dc0ecfb576eb6a57eee7473b0991ea67d0b6778d
|
data/.github/workflows/ci.yml
CHANGED
@@ -5,6 +5,8 @@ on:
|
|
5
5
|
push:
|
6
6
|
branches:
|
7
7
|
- master
|
8
|
+
tags:
|
9
|
+
- v*
|
8
10
|
|
9
11
|
jobs:
|
10
12
|
build:
|
@@ -37,3 +39,16 @@ jobs:
|
|
37
39
|
|
38
40
|
- name: RSpec
|
39
41
|
run: bundle exec rspec
|
42
|
+
|
43
|
+
publish:
|
44
|
+
if: contains(github.ref, 'refs/tags/v')
|
45
|
+
needs: build
|
46
|
+
runs-on: ubuntu-latest
|
47
|
+
|
48
|
+
steps:
|
49
|
+
- uses: actions/checkout@v2
|
50
|
+
|
51
|
+
- name: Release Gem
|
52
|
+
uses: cadwallion/publish-rubygems-action@5dfdb61
|
53
|
+
env:
|
54
|
+
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
|
data/lib/onebox/engine.rb
CHANGED
@@ -141,7 +141,6 @@ require_relative "engine/wikimedia_onebox"
|
|
141
141
|
require_relative "engine/wikipedia_onebox"
|
142
142
|
require_relative "engine/youtube_onebox"
|
143
143
|
require_relative "engine/youku_onebox"
|
144
|
-
require_relative "engine/douban_onebox"
|
145
144
|
require_relative "engine/whitelisted_generic_onebox"
|
146
145
|
require_relative "engine/pubmed_onebox"
|
147
146
|
require_relative "engine/soundcloud_onebox"
|
@@ -54,9 +54,7 @@ module Onebox
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def placeholder_html
|
57
|
-
|
58
|
-
height = @placeholder_height || 400
|
59
|
-
"<img src='#{@placeholder}' width='#{width}' height='#{height}'/>"
|
57
|
+
::Onebox::Helpers.map_placeholder_html
|
60
58
|
end
|
61
59
|
|
62
60
|
private
|
data/lib/onebox/helpers.rb
CHANGED
@@ -224,6 +224,10 @@ module Onebox
|
|
224
224
|
"<div class='onebox-placeholder-container'><span class='placeholder-icon audio'></span></div>"
|
225
225
|
end
|
226
226
|
|
227
|
+
def self.map_placeholder_html
|
228
|
+
"<div class='onebox-placeholder-container'><span class='placeholder-icon map'></span></div>"
|
229
|
+
end
|
230
|
+
|
227
231
|
def self.generic_placeholder_html
|
228
232
|
"<div class='onebox-placeholder-container'><span class='placeholder-icon generic'></span></div>"
|
229
233
|
end
|
data/lib/onebox/version.rb
CHANGED
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.9.
|
4
|
+
version: 1.9.26
|
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: 2020-
|
13
|
+
date: 2020-02-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: addressable
|
@@ -321,7 +321,6 @@ files:
|
|
321
321
|
- lib/onebox/engine/bandcamp_onebox.rb
|
322
322
|
- lib/onebox/engine/cloudapp_onebox.rb
|
323
323
|
- lib/onebox/engine/coub_onebox.rb
|
324
|
-
- lib/onebox/engine/douban_onebox.rb
|
325
324
|
- lib/onebox/engine/five_hundred_px_onebox.rb
|
326
325
|
- lib/onebox/engine/flickr_onebox.rb
|
327
326
|
- lib/onebox/engine/flickr_shortened_onebox.rb
|
@@ -395,7 +394,6 @@ files:
|
|
395
394
|
- onebox.gemspec
|
396
395
|
- templates/_layout.mustache
|
397
396
|
- templates/amazon.mustache
|
398
|
-
- templates/douban.mustache
|
399
397
|
- templates/githubblob.mustache
|
400
398
|
- templates/githubcommit.mustache
|
401
399
|
- templates/githubgist.mustache
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Onebox
|
4
|
-
module Engine
|
5
|
-
class DoubanOnebox
|
6
|
-
include Engine
|
7
|
-
include LayoutSupport
|
8
|
-
include HTML
|
9
|
-
|
10
|
-
matches_regexp(/^(https?:\/\/)?([\da-z\.-]+)(douban.com\/)(.)+\/?$/)
|
11
|
-
|
12
|
-
private
|
13
|
-
|
14
|
-
def data
|
15
|
-
{
|
16
|
-
link: link,
|
17
|
-
title: raw.css('title').text.gsub("\n", '').strip(),
|
18
|
-
image: raw.css('img[rel*="v:"]').first['src'],
|
19
|
-
description: raw.css('meta[name=description]').first['content'],
|
20
|
-
}
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|