onebox 1.8.77 → 1.8.78

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -0
  3. data/.rspec +0 -0
  4. data/.rubocop.yml +0 -0
  5. data/.ruby-gemset +0 -0
  6. data/.travis.yml +0 -0
  7. data/CHANGELOG.md +5 -0
  8. data/Gemfile +0 -0
  9. data/Gemfile.lock +3 -3
  10. data/Guardfile +0 -0
  11. data/LICENSE.txt +0 -0
  12. data/README.md +2 -2
  13. data/Rakefile +0 -0
  14. data/lib/onebox.rb +0 -0
  15. data/lib/onebox/engine.rb +2 -0
  16. data/lib/onebox/engine/amazon_onebox.rb +0 -0
  17. data/lib/onebox/engine/asciinema_onebox.rb +0 -0
  18. data/lib/onebox/engine/audio_onebox.rb +0 -0
  19. data/lib/onebox/engine/audioboom_onebox.rb +0 -0
  20. data/lib/onebox/engine/bandcamp_onebox.rb +0 -0
  21. data/lib/onebox/engine/cloudapp_onebox.rb +0 -0
  22. data/lib/onebox/engine/coub_onebox.rb +0 -0
  23. data/lib/onebox/engine/douban_onebox.rb +0 -0
  24. data/lib/onebox/engine/five_hundred_px_onebox.rb +0 -0
  25. data/lib/onebox/engine/flickr_onebox.rb +0 -0
  26. data/lib/onebox/engine/flickr_shortened_onebox.rb +0 -0
  27. data/lib/onebox/engine/gfycat_onebox.rb +0 -0
  28. data/lib/onebox/engine/giphy_onebox.rb +0 -0
  29. data/lib/onebox/engine/github_blob_onebox.rb +0 -0
  30. data/lib/onebox/engine/github_commit_onebox.rb +0 -0
  31. data/lib/onebox/engine/github_gist_onebox.rb +0 -0
  32. data/lib/onebox/engine/github_issue_onebox.rb +0 -0
  33. data/lib/onebox/engine/github_pullrequest_onebox.rb +0 -0
  34. data/lib/onebox/engine/gitlab_blob_onebox.rb +0 -0
  35. data/lib/onebox/engine/google_calendar_onebox.rb +0 -0
  36. data/lib/onebox/engine/google_docs_onebox.rb +0 -0
  37. data/lib/onebox/engine/google_maps_onebox.rb +0 -0
  38. data/lib/onebox/engine/google_photos_onebox.rb +0 -0
  39. data/lib/onebox/engine/google_play_app_onebox.rb +0 -0
  40. data/lib/onebox/engine/html.rb +0 -0
  41. data/lib/onebox/engine/image_onebox.rb +0 -0
  42. data/lib/onebox/engine/imgur_onebox.rb +0 -0
  43. data/lib/onebox/engine/instagram_onebox.rb +0 -0
  44. data/lib/onebox/engine/json.rb +0 -0
  45. data/lib/onebox/engine/kaltura_onebox.rb +33 -0
  46. data/lib/onebox/engine/mixcloud_onebox.rb +0 -0
  47. data/lib/onebox/engine/opengraph_image.rb +0 -0
  48. data/lib/onebox/engine/pastebin_onebox.rb +0 -0
  49. data/lib/onebox/engine/pdf_onebox.rb +0 -0
  50. data/lib/onebox/engine/pubmed_onebox.rb +0 -0
  51. data/lib/onebox/engine/replit_onebox.rb +0 -0
  52. data/lib/onebox/engine/sketchfab_onebox.rb +1 -1
  53. data/lib/onebox/engine/slides_onebox.rb +0 -0
  54. data/lib/onebox/engine/soundcloud_onebox.rb +0 -0
  55. data/lib/onebox/engine/stack_exchange_onebox.rb +0 -0
  56. data/lib/onebox/engine/standard_embed.rb +0 -0
  57. data/lib/onebox/engine/steam_store_onebox.rb +0 -0
  58. data/lib/onebox/engine/trello_onebox.rb +0 -0
  59. data/lib/onebox/engine/twitch_clips_onebox.rb +0 -0
  60. data/lib/onebox/engine/twitch_stream_onebox.rb +0 -0
  61. data/lib/onebox/engine/twitch_video_onebox.rb +0 -0
  62. data/lib/onebox/engine/twitter_status_onebox.rb +0 -0
  63. data/lib/onebox/engine/typeform_onebox.rb +41 -0
  64. data/lib/onebox/engine/video_onebox.rb +0 -0
  65. data/lib/onebox/engine/vimeo_onebox.rb +0 -0
  66. data/lib/onebox/engine/wechat_mp_onebox.rb +0 -0
  67. data/lib/onebox/engine/whitelisted_generic_onebox.rb +0 -0
  68. data/lib/onebox/engine/wikimedia_onebox.rb +0 -0
  69. data/lib/onebox/engine/wikipedia_onebox.rb +0 -0
  70. data/lib/onebox/engine/wistia_onebox.rb +0 -0
  71. data/lib/onebox/engine/xkcd_onebox.rb +0 -0
  72. data/lib/onebox/engine/youku_onebox.rb +0 -0
  73. data/lib/onebox/engine/youtube_onebox.rb +0 -0
  74. data/lib/onebox/file_type_finder.rb +0 -0
  75. data/lib/onebox/helpers.rb +0 -0
  76. data/lib/onebox/layout.rb +0 -0
  77. data/lib/onebox/layout_support.rb +0 -0
  78. data/lib/onebox/matcher.rb +0 -0
  79. data/lib/onebox/mixins/git_blob_onebox.rb +0 -0
  80. data/lib/onebox/mixins/twitch_onebox.rb +0 -0
  81. data/lib/onebox/preview.rb +0 -0
  82. data/lib/onebox/sanitize_config.rb +0 -0
  83. data/lib/onebox/status_check.rb +0 -0
  84. data/lib/onebox/template_support.rb +0 -0
  85. data/lib/onebox/version.rb +1 -1
  86. data/lib/onebox/view.rb +0 -0
  87. data/lib/onebox/web.rb +0 -0
  88. data/lib/onebox/web_helpers.rb +0 -0
  89. data/onebox.gemspec +0 -0
  90. data/templates/_layout.mustache +0 -0
  91. data/templates/amazon.mustache +0 -0
  92. data/templates/douban.mustache +0 -0
  93. data/templates/githubblob.mustache +0 -0
  94. data/templates/githubcommit.mustache +0 -0
  95. data/templates/githubgist.mustache +0 -0
  96. data/templates/githubissue.mustache +0 -0
  97. data/templates/githubpullrequest.mustache +0 -0
  98. data/templates/gitlabblob.mustache +0 -0
  99. data/templates/googledocs.mustache +0 -0
  100. data/templates/googleplayapp.mustache +0 -0
  101. data/templates/instagram.mustache +0 -0
  102. data/templates/pastebin.mustache +0 -0
  103. data/templates/pdf.mustache +0 -0
  104. data/templates/pubmed.mustache +0 -0
  105. data/templates/stackexchange.mustache +0 -0
  106. data/templates/twitterstatus.mustache +0 -0
  107. data/templates/wechatmp.mustache +0 -0
  108. data/templates/whitelistedgeneric.mustache +0 -0
  109. data/templates/wikimedia.mustache +0 -0
  110. data/templates/wikipedia.mustache +0 -0
  111. data/templates/xkcd.mustache +0 -0
  112. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08c3a640785331288e85c9998707a13f7cc2179cb2cc319535123595c5c52ef4'
4
- data.tar.gz: b2e3f75c91844b7ee42cb41f874ed4d65387db2d33a74b9ff931aaf7dccfd608
3
+ metadata.gz: 2178e12356ed7b300df051ce85855ede74f44f307ea0cfae92a6991d84aa78b2
4
+ data.tar.gz: '059aac2d7b8498a8c135c09db94f15a4deb5236bd0544f1dc517c88c21d57ebc'
5
5
  SHA512:
6
- metadata.gz: 47bf5de643663053b206d7309bfaa47c1e87e7970452a3afd9eccf83cdbe70a3078ffc72e2b8d248a1e145a7dd9a976bb105ffd84d31676f20b7870ad7b973ce
7
- data.tar.gz: 2c6b8430d91bb83994c756f28ebf18ff31313e24f6bd5b64e6ec42f1d0b907438ec6112224cc2d8f7fd75f408eb370f6d617bc44fa10f5573e484df1369d1e2d
6
+ metadata.gz: eaaf399a2338486a367bcf14d3350be8f8821840fa1d3e45c74c3a9b29b545fe433dedb0b077eb4b617dc9563fc5ef3abe07b424c32537d429b2aa9c42e7b36c
7
+ data.tar.gz: 7858b04e1dbbb59e5a23a03301b275e1a573505f9dbcbd7ec02201955991149120276a44bd42af50907987eeec1deab4bbbd99a2f1da9c66486dde4f487de168
data/.gitignore CHANGED
File without changes
data/.rspec CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,8 @@
1
+ ## 1.8.78
2
+
3
+ * Kaltura onebox support
4
+ * Typeform onebox support
5
+
1
6
  ## 1.8.40
2
7
 
3
8
  * remove explicit dependency on fast blank
data/Gemfile CHANGED
File without changes
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- onebox (1.8.76)
4
+ onebox (1.8.78)
5
5
  htmlentities (~> 4.3)
6
6
  moneta (~> 1.0)
7
7
  multi_json (~> 1.11)
@@ -38,7 +38,7 @@ GEM
38
38
  rspec (>= 2.14, < 4.0)
39
39
  haml (4.0.7)
40
40
  tilt
41
- hitimes (1.3.0)
41
+ hitimes (1.3.1)
42
42
  htmlentities (4.3.4)
43
43
  jaro_winkler (1.5.2)
44
44
  listen (2.10.1)
@@ -93,7 +93,7 @@ GEM
93
93
  diff-lcs (>= 1.2.0, < 2.0)
94
94
  rspec-support (~> 3.8.0)
95
95
  rspec-support (3.8.0)
96
- rubocop (0.63.0)
96
+ rubocop (0.64.0)
97
97
  jaro_winkler (~> 1.5.1)
98
98
  parallel (~> 1.10)
99
99
  parser (>= 2.5, != 2.5.1.1)
data/Guardfile CHANGED
File without changes
File without changes
data/README.md CHANGED
@@ -132,7 +132,7 @@ Adding Support for a new URL
132
132
  let(:html) { described_class.new(link).to_html }
133
133
 
134
134
  before do
135
- fake(link, response("name.response"))
135
+ fake(link, response("name"))
136
136
  end
137
137
 
138
138
  it "has the video's title" do
@@ -170,7 +170,7 @@ Adding Support for a new URL
170
170
  5. Create new fixture from HTML response for your FakeWeb request(s)
171
171
 
172
172
  ``` bash
173
- curl --output spec/fixtures/oneboxname.response -L -X -GET http://example.com
173
+ curl --output spec/fixtures/oneboxname.response -L -X GET http://example.com
174
174
  ```
175
175
 
176
176
  6. Require in Engine module
data/Rakefile CHANGED
File without changes
File without changes
@@ -161,6 +161,7 @@ require_relative "engine/slides_onebox"
161
161
  require_relative "engine/xkcd_onebox"
162
162
  require_relative "engine/giphy_onebox"
163
163
  require_relative "engine/gfycat_onebox"
164
+ require_relative "engine/typeform_onebox"
164
165
  require_relative "engine/vimeo_onebox"
165
166
  require_relative "engine/steam_store_onebox"
166
167
  require_relative "engine/sketchfab_onebox"
@@ -184,3 +185,4 @@ require_relative "engine/wistia_onebox"
184
185
  require_relative "engine/instagram_onebox"
185
186
  require_relative "engine/gitlab_blob_onebox"
186
187
  require_relative "engine/google_photos_onebox"
188
+ require_relative "engine/kaltura_onebox"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,33 @@
1
+ module Onebox
2
+ module Engine
3
+ class KalturaOnebox
4
+ include Engine
5
+ include StandardEmbed
6
+
7
+ always_https
8
+ matches_regexp(/^https?:\/\/[a-z0-9]+\.kaltura\.com\/id\/[a-zA-Z0-9]+/)
9
+
10
+ def preview_html
11
+ og = get_opengraph
12
+ thumbnail_url = ::Onebox::Helpers.normalize_url_for_output(og[:image_secure_url])
13
+
14
+ <<~HTML
15
+ <img src="#{thumbnail_url}" width="#{og[:video_width]}" height="#{og[:video_height]}" >
16
+ HTML
17
+ end
18
+
19
+ def to_html
20
+ og = get_opengraph
21
+ embedded_video_url = ::Onebox::Helpers.normalize_url_for_output(og[:video_secure_url])
22
+
23
+ <<~HTML
24
+ <iframe src="#{embedded_video_url}"
25
+ width="#{og[:video_width]}" height="#{og[:video_height]}"
26
+ frameborder='0'
27
+ allowfullscreen >
28
+ </iframe>
29
+ HTML
30
+ end
31
+ end
32
+ end
33
+ end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -4,7 +4,7 @@ module Onebox
4
4
  include Engine
5
5
  include StandardEmbed
6
6
 
7
- matches_regexp(/^https?:\/\/sketchfab\.com\/models\/[a-z0-9]{32}/)
7
+ matches_regexp(/^https?:\/\/sketchfab\.com\/(?:models\/|3d-models\/(?:[^\/\s]+-)?)([a-z0-9]{32})/)
8
8
  always_https
9
9
 
10
10
  def to_html
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,41 @@
1
+ module Onebox
2
+ module Engine
3
+ class TypeformOnebox
4
+ include Engine
5
+
6
+ matches_regexp(/^https?:\/\/[a-z0-9]+\.typeform\.com\/to\/[a-zA-Z0-9]+/)
7
+ always_https
8
+
9
+ def to_html
10
+ typeform_src = build_typeform_src
11
+
12
+ <<~HTML
13
+ <iframe src="#{typeform_src}"
14
+ width="100%"
15
+ height="600px"
16
+ scrolling="no"
17
+ frameborder="0">
18
+ </iframe>
19
+ HTML
20
+ end
21
+ alias placeholder_html to_html
22
+
23
+ private
24
+
25
+ def build_typeform_src
26
+ escaped_src = ::Onebox::Helpers.normalize_url_for_output(@url)
27
+ query_params = CGI::parse(URI::parse(escaped_src).query || '')
28
+
29
+ return escaped_src if query_params.has_key?('typeform-embed')
30
+
31
+ if query_params.empty?
32
+ escaped_src << '?' unless escaped_src.end_with?('?')
33
+ else
34
+ escaped_src << '&'
35
+ end
36
+
37
+ escaped_src << 'typeform-embed=embed-widget'
38
+ end
39
+ end
40
+ end
41
+ end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onebox
4
- VERSION = "1.8.77"
4
+ VERSION = "1.8.78"
5
5
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
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.77
4
+ version: 1.8.78
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-02-12 00:00:00.000000000 Z
13
+ date: 2019-02-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -330,6 +330,7 @@ files:
330
330
  - lib/onebox/engine/imgur_onebox.rb
331
331
  - lib/onebox/engine/instagram_onebox.rb
332
332
  - lib/onebox/engine/json.rb
333
+ - lib/onebox/engine/kaltura_onebox.rb
333
334
  - lib/onebox/engine/mixcloud_onebox.rb
334
335
  - lib/onebox/engine/opengraph_image.rb
335
336
  - lib/onebox/engine/pastebin_onebox.rb
@@ -347,6 +348,7 @@ files:
347
348
  - lib/onebox/engine/twitch_stream_onebox.rb
348
349
  - lib/onebox/engine/twitch_video_onebox.rb
349
350
  - lib/onebox/engine/twitter_status_onebox.rb
351
+ - lib/onebox/engine/typeform_onebox.rb
350
352
  - lib/onebox/engine/video_onebox.rb
351
353
  - lib/onebox/engine/vimeo_onebox.rb
352
354
  - lib/onebox/engine/wechat_mp_onebox.rb
@@ -415,7 +417,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
415
417
  version: '0'
416
418
  requirements: []
417
419
  rubyforge_project:
418
- rubygems_version: 2.7.8
420
+ rubygems_version: 2.7.6
419
421
  signing_key:
420
422
  specification_version: 4
421
423
  summary: A gem for generating embeddable HTML previews from URLs.