onebox 1.8.71 → 1.8.72

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: 433d6b01c6f71fd12300770534db9b4231a1abe44dc823be8da8130d6a7c892f
4
- data.tar.gz: 654c6241edf4e2ab6f5d7f699bdfda53b88091acb9f09955cabc0f9e5d58b991
3
+ metadata.gz: 33d3025cb9f8b3e27817b87357527810499cc595e12aa313e936f77a79b7931f
4
+ data.tar.gz: 3bf36d19666b22b45ca27111fc18ea488c2aec3e52f05a7c74a94ab8a31aa973
5
5
  SHA512:
6
- metadata.gz: d2c33ef96c2f68d8992a26dcf369417b8298c705458360a7de59e0c6176563fea4e81eb7dbb1bfb4e18e8f67ae3ac836f51f531379ede5ea4bdd6a7e49559e29
7
- data.tar.gz: b05256ea4ebe8b8815a932aa9906b62873b9b4b35b860a6add1fde53735ccb118b4790353647cb4d4f99a31b6823c3838d77f54d2b10db57704ab37ee32ea3bc
6
+ metadata.gz: a3a8a2de0637e9e28d485ee9a819446d00ad85c612b0b387858f9edb6e563b71acdbb52a620e4cdd08be22e519efb99a91fac9f846a89ec807235af9e0dc57fa
7
+ data.tar.gz: 928ba4b367508c9c7c7261c9ba275370187dd4b6436a762a9aa4fc0d06329466e0b1d10c13bf5bf2b1f8dfbedc55bc99870773d80e4a1db76809847b9ac2a2f6
@@ -3,6 +3,7 @@ sudo: false
3
3
  rvm:
4
4
  - 2.3
5
5
  - 2.4
6
+ - 2.5
6
7
  notifications:
7
8
  email:
8
9
  on_success: change
@@ -12,3 +13,5 @@ script:
12
13
  - bundle exec rspec
13
14
  cache:
14
15
  bundler: true
16
+ before_install:
17
+ - gem install bundler
@@ -96,6 +96,7 @@ module Onebox
96
96
  samsung.com
97
97
  screenr.com
98
98
  scribd.com
99
+ simplecast.com
99
100
  slideshare.net
100
101
  sourceforge.net
101
102
  speakerdeck.com
@@ -262,6 +263,7 @@ module Onebox
262
263
  end
263
264
 
264
265
  def generic_html
266
+ return card_html if is_card?
265
267
  return article_html if is_article?
266
268
  return video_html if is_video?
267
269
  return image_html if is_image?
@@ -269,6 +271,10 @@ module Onebox
269
271
  return article_html if has_text?
270
272
  end
271
273
 
274
+ def is_card?
275
+ data[:card] == 'player' && data[:player] =~ URI::regexp
276
+ end
277
+
272
278
  def is_article?
273
279
  (data[:type] =~ /article/ || data[:asset_type] =~ /article/) &&
274
280
  has_text?
@@ -302,6 +308,19 @@ module Onebox
302
308
  )
303
309
  end
304
310
 
311
+ def card_html
312
+ escaped_url = ::Onebox::Helpers.normalize_url_for_output(data[:player])
313
+
314
+ <<~RAW
315
+ <iframe src="#{escaped_url}"
316
+ width="#{data[:player_width] || "100%"}"
317
+ height="#{data[:player_height]}"
318
+ scrolling="no"
319
+ frameborder="0">
320
+ </iframe>
321
+ RAW
322
+ end
323
+
305
324
  def article_html
306
325
  layout.to_html
307
326
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onebox
4
- VERSION = "1.8.71"
4
+ VERSION = "1.8.72"
5
5
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_runtime_dependency 'htmlentities', '~> 4.3'
28
28
  spec.add_runtime_dependency 'sanitize'
29
29
 
30
- spec.add_development_dependency 'bundler', '~> 1.7'
30
+ spec.add_development_dependency 'bundler', '~> 2.0'
31
31
  spec.add_development_dependency 'rake', '~> 10.4'
32
32
  spec.add_development_dependency 'rspec', '~> 3.2'
33
33
  spec.add_development_dependency 'fakeweb', '~> 1.3'
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.71
4
+ version: 1.8.72
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: 2018-12-25 00:00:00.000000000 Z
13
+ date: 2019-01-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -102,14 +102,14 @@ dependencies:
102
102
  requirements:
103
103
  - - "~>"
104
104
  - !ruby/object:Gem::Version
105
- version: '1.7'
105
+ version: '2.0'
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - "~>"
111
111
  - !ruby/object:Gem::Version
112
- version: '1.7'
112
+ version: '2.0'
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rake
115
115
  requirement: !ruby/object:Gem::Requirement
@@ -413,7 +413,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
413
413
  - !ruby/object:Gem::Version
414
414
  version: '0'
415
415
  requirements: []
416
- rubygems_version: 3.0.0
416
+ rubyforge_project:
417
+ rubygems_version: 2.7.6
417
418
  signing_key:
418
419
  specification_version: 4
419
420
  summary: A gem for generating embeddable HTML previews from URLs.