onebox 2.2.12 → 2.2.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +0 -4
  3. data/lib/onebox/engine.rb +7 -11
  4. data/lib/onebox/engine/allowlisted_generic_onebox.rb +11 -18
  5. data/lib/onebox/engine/amazon_onebox.rb +26 -17
  6. data/lib/onebox/engine/asciinema_onebox.rb +0 -1
  7. data/lib/onebox/engine/audioboom_onebox.rb +5 -2
  8. data/lib/onebox/engine/bandcamp_onebox.rb +8 -8
  9. data/lib/onebox/engine/cloudapp_onebox.rb +12 -12
  10. data/lib/onebox/engine/coub_onebox.rb +0 -1
  11. data/lib/onebox/engine/facebook_media_onebox.rb +8 -7
  12. data/lib/onebox/engine/five_hundred_px_onebox.rb +0 -1
  13. data/lib/onebox/engine/flickr_onebox.rb +14 -15
  14. data/lib/onebox/engine/gfycat_onebox.rb +26 -26
  15. data/lib/onebox/engine/giphy_onebox.rb +0 -1
  16. data/lib/onebox/engine/github_blob_onebox.rb +4 -0
  17. data/lib/onebox/engine/github_commit_onebox.rb +13 -16
  18. data/lib/onebox/engine/github_folder_onebox.rb +1 -1
  19. data/lib/onebox/engine/github_gist_onebox.rb +1 -2
  20. data/lib/onebox/engine/github_issue_onebox.rb +16 -18
  21. data/lib/onebox/engine/github_pullrequest_onebox.rb +7 -4
  22. data/lib/onebox/engine/gitlab_blob_onebox.rb +4 -0
  23. data/lib/onebox/engine/google_calendar_onebox.rb +1 -1
  24. data/lib/onebox/engine/google_docs_onebox.rb +23 -41
  25. data/lib/onebox/engine/google_drive_onebox.rb +7 -7
  26. data/lib/onebox/engine/google_maps_onebox.rb +10 -8
  27. data/lib/onebox/engine/google_photos_onebox.rb +18 -18
  28. data/lib/onebox/engine/google_play_app_onebox.rb +3 -7
  29. data/lib/onebox/engine/imgur_onebox.rb +2 -2
  30. data/lib/onebox/engine/instagram_onebox.rb +4 -5
  31. data/lib/onebox/engine/kaltura_onebox.rb +8 -6
  32. data/lib/onebox/engine/opengraph_image.rb +0 -1
  33. data/lib/onebox/engine/pastebin_onebox.rb +11 -15
  34. data/lib/onebox/engine/pdf_onebox.rb +7 -15
  35. data/lib/onebox/engine/pubmed_onebox.rb +17 -12
  36. data/lib/onebox/engine/replit_onebox.rb +0 -1
  37. data/lib/onebox/engine/sketchfab_onebox.rb +8 -8
  38. data/lib/onebox/engine/slides_onebox.rb +10 -10
  39. data/lib/onebox/engine/soundcloud_onebox.rb +0 -1
  40. data/lib/onebox/engine/stack_exchange_onebox.rb +3 -2
  41. data/lib/onebox/engine/standard_embed.rb +2 -5
  42. data/lib/onebox/engine/steam_store_onebox.rb +6 -5
  43. data/lib/onebox/engine/trello_onebox.rb +4 -7
  44. data/lib/onebox/engine/twitch_clips_onebox.rb +1 -3
  45. data/lib/onebox/engine/twitch_stream_onebox.rb +1 -2
  46. data/lib/onebox/engine/twitch_video_onebox.rb +0 -2
  47. data/lib/onebox/engine/typeform_onebox.rb +7 -6
  48. data/lib/onebox/engine/vimeo_onebox.rb +9 -7
  49. data/lib/onebox/engine/wikimedia_onebox.rb +1 -2
  50. data/lib/onebox/engine/wikipedia_onebox.rb +12 -8
  51. data/lib/onebox/engine/youku_onebox.rb +7 -13
  52. data/lib/onebox/engine/youtube_onebox.rb +14 -13
  53. data/lib/onebox/file_type_finder.rb +0 -1
  54. data/lib/onebox/helpers.rb +7 -24
  55. data/lib/onebox/layout.rb +2 -14
  56. data/lib/onebox/matcher.rb +10 -8
  57. data/lib/onebox/mixins/git_blob_onebox.rb +8 -8
  58. data/lib/onebox/mixins/github_body.rb +30 -0
  59. data/lib/onebox/mixins/twitch_onebox.rb +0 -1
  60. data/lib/onebox/open_graph.rb +4 -4
  61. data/lib/onebox/preview.rb +3 -4
  62. data/lib/onebox/version.rb +1 -1
  63. data/templates/_layout.mustache +6 -2
  64. data/templates/allowlistedgeneric.mustache +8 -9
  65. data/templates/amazon.mustache +5 -2
  66. data/templates/github/github_body.mustache +5 -0
  67. data/templates/githubblob.mustache +44 -34
  68. data/templates/githubcommit.mustache +2 -10
  69. data/templates/githubfolder.mustache +2 -2
  70. data/templates/githubgist.mustache +9 -6
  71. data/templates/githubissue.mustache +9 -11
  72. data/templates/githubpullrequest.mustache +6 -18
  73. data/templates/gitlabblob.mustache +11 -4
  74. data/templates/googledocs.mustache +2 -2
  75. data/templates/googledrive.mustache +2 -2
  76. data/templates/googleplayapp.mustache +2 -1
  77. data/templates/instagram.mustache +1 -1
  78. data/templates/pastebin.mustache +6 -2
  79. data/templates/pdf.mustache +6 -3
  80. data/templates/stackexchange.mustache +1 -0
  81. data/templates/twitterstatus.mustache +20 -5
  82. data/templates/wikimedia.mustache +2 -2
  83. data/templates/wikipedia.mustache +2 -2
  84. data/templates/xkcd.mustache +2 -2
  85. metadata +7 -5
@@ -1,4 +1,7 @@
1
- <a href='{{link}}' target="_blank" rel="noopener"><span class='pdf-onebox-logo'></span></a>
2
- <h3><a href='{{link}}' target="_blank" rel="noopener">{{title}}</a></h3>
1
+ <a href="{{link}}" target="_blank" rel="noopener"><span class="pdf-onebox-logo"></span></a>
3
2
 
4
- {{#filesize}}<p class='filesize'>{{filesize}}</p>{{/filesize}}
3
+ <h3><a href="{{link}}" target="_blank" rel="noopener">{{title}}</a></h3>
4
+
5
+ {{#filesize}}
6
+ <p class="filesize">{{filesize}}</p>
7
+ {{/filesize}}
@@ -3,6 +3,7 @@
3
3
  <img alt="{{owner.display_name}}" src="{{owner.profile_image}}" class="thumbnail onebox-avatar">
4
4
  </a>
5
5
  {{/owner.profile_image}}
6
+
6
7
  <h4>
7
8
  <a href="{{link}}" target="_blank" rel="noopener">{{{title}}}</a>
8
9
  </h4>
@@ -1,23 +1,38 @@
1
1
  {{#avatar}}<img src="{{avatar}}" class="thumbnail onebox-avatar">{{/avatar}}
2
2
 
3
- <h4><a href='{{link}}' target='_blank' rel='noopener'>{{title}}</a></h4>
3
+ <h4><a href="{{link}}" target="_blank" rel="noopener">{{title}}</a></h4>
4
4
 
5
- <div class="tweet"> {{{tweet}}}{{#quoted_tweet}}<div class="quoted"><a class="quoted-link" href="{{quoted_link}}"><p class="quoted-title">{{quoted_full_name}} <span>@{{quoted_screen_name}}</span></p></a><div>{{quoted_tweet}}</div></div>{{/quoted_tweet}}</div>
5
+ <div class="tweet">
6
+ {{{tweet}}}
7
+ {{#quoted_tweet}}
8
+ <div class="quoted">
9
+ <a class="quoted-link" href="{{quoted_link}}">
10
+ <p class="quoted-title">{{quoted_full_name}} <span>@{{quoted_screen_name}}</span></p>
11
+ </a>
6
12
 
7
- <div class='date'>
13
+ <div>{{quoted_tweet}}</div>
14
+ </div>
15
+ {{/quoted_tweet}}
16
+ </div>
17
+
18
+ <div class="date">
8
19
  <a href="{{link}}" target="_blank" rel="noopener">{{timestamp}}</a>
20
+
9
21
  {{#likes}}
10
22
  <span class="like">
11
23
  <svg viewBox="0 0 512 512" width="14px" height="16px" aria-hidden="true">
12
24
  <path d="M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"></path>
13
- </svg> {{likes}}
25
+ </svg>
26
+ {{likes}}
14
27
  </span>
15
28
  {{/likes}}
29
+
16
30
  {{#retweets}}
17
31
  <span class="retweet">
18
32
  <svg viewBox="0 0 640 512" width="14px" height="16px" aria-hidden="true">
19
33
  <path d="M629.657 343.598L528.971 444.284c-9.373 9.372-24.568 9.372-33.941 0L394.343 343.598c-9.373-9.373-9.373-24.569 0-33.941l10.823-10.823c9.562-9.562 25.133-9.34 34.419.492L480 342.118V160H292.451a24.005 24.005 0 0 1-16.971-7.029l-16-16C244.361 121.851 255.069 96 276.451 96H520c13.255 0 24 10.745 24 24v222.118l40.416-42.792c9.285-9.831 24.856-10.054 34.419-.492l10.823 10.823c9.372 9.372 9.372 24.569-.001 33.941zm-265.138 15.431A23.999 23.999 0 0 0 347.548 352H160V169.881l40.416 42.792c9.286 9.831 24.856 10.054 34.419.491l10.822-10.822c9.373-9.373 9.373-24.569 0-33.941L144.971 67.716c-9.373-9.373-24.569-9.373-33.941 0L10.343 168.402c-9.373 9.373-9.373 24.569 0 33.941l10.822 10.822c9.562 9.562 25.133 9.34 34.419-.491L96 169.881V392c0 13.255 10.745 24 24 24h243.549c21.382 0 32.09-25.851 16.971-40.971l-16.001-16z"></path>
20
- </svg> {{retweets}}
34
+ </svg>
35
+ {{retweets}}
21
36
  </span>
22
37
  {{/retweets}}
23
38
  </div>
@@ -1,3 +1,3 @@
1
- {{#image}}<img src="{{image}}" class="thumbnail"/>{{/image}}
1
+ {{#image}}<img src="{{image}}" class="thumbnail">{{/image}}
2
2
 
3
- <h3><a href='{{link}}' target='_blank' rel='noopener'>{{title}}</a></h3>
3
+ <h3><a href="{{link}}" target="_blank" rel="noopener">{{title}}</a></h3>
@@ -1,5 +1,5 @@
1
- {{#image}}<img src="{{image}}" class="thumbnail"/>{{/image}}
1
+ {{#image}}<img src="{{image}}" class="thumbnail">{{/image}}
2
2
 
3
- <h3><a href='{{link}}' target='_blank' rel='noopener'>{{title}}</a></h3>
3
+ <h3><a href="{{link}}" target="_blank" rel="noopener">{{title}}</a></h3>
4
4
 
5
5
  <p>{{description}}</p>
@@ -1,7 +1,7 @@
1
- <h3><a href='{{link}}' target='_blank' rel='noopener'>{{title}}</a></h3>
1
+ <h3><a href="{{link}}" target="_blank" rel="noopener">{{title}}</a></h3>
2
2
 
3
3
  {{#image}}
4
- <div class="xkcd-image"><img src="{{image}}"/></div>
4
+ <div class="xkcd-image"><img src="{{image}}"></div>
5
5
  {{/image}}
6
6
 
7
7
  <p>{{description}}</p>
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onebox
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.12
4
+ version: 2.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joanna Zeta
8
8
  - Vyki Englert
9
9
  - Robin Ward
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-04-12 00:00:00.000000000 Z
13
+ date: 2021-07-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable
@@ -367,6 +367,7 @@ files:
367
367
  - lib/onebox/layout_support.rb
368
368
  - lib/onebox/matcher.rb
369
369
  - lib/onebox/mixins/git_blob_onebox.rb
370
+ - lib/onebox/mixins/github_body.rb
370
371
  - lib/onebox/mixins/twitch_onebox.rb
371
372
  - lib/onebox/oembed.rb
372
373
  - lib/onebox/open_graph.rb
@@ -382,6 +383,7 @@ files:
382
383
  - templates/_layout.mustache
383
384
  - templates/allowlistedgeneric.mustache
384
385
  - templates/amazon.mustache
386
+ - templates/github/github_body.mustache
385
387
  - templates/githubblob.mustache
386
388
  - templates/githubcommit.mustache
387
389
  - templates/githubfolder.mustache
@@ -405,7 +407,7 @@ homepage: https://github.com/discourse/onebox
405
407
  licenses:
406
408
  - MIT
407
409
  metadata: {}
408
- post_install_message:
410
+ post_install_message:
409
411
  rdoc_options: []
410
412
  require_paths:
411
413
  - lib
@@ -421,7 +423,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
421
423
  version: '0'
422
424
  requirements: []
423
425
  rubygems_version: 3.0.3
424
- signing_key:
426
+ signing_key:
425
427
  specification_version: 4
426
428
  summary: A gem for generating embeddable HTML previews from URLs.
427
429
  test_files: []