onebox 2.2.9 → 2.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +0 -4
  3. data/lib/onebox/engine.rb +1 -1
  4. data/lib/onebox/engine/allowlisted_generic_onebox.rb +11 -9
  5. data/lib/onebox/engine/amazon_onebox.rb +25 -13
  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/giphy_onebox.rb +0 -1
  15. data/lib/onebox/engine/github_blob_onebox.rb +4 -0
  16. data/lib/onebox/engine/github_commit_onebox.rb +12 -15
  17. data/lib/onebox/engine/github_gist_onebox.rb +1 -2
  18. data/lib/onebox/engine/github_issue_onebox.rb +16 -18
  19. data/lib/onebox/engine/github_pullrequest_onebox.rb +9 -1
  20. data/lib/onebox/engine/gitlab_blob_onebox.rb +4 -0
  21. data/lib/onebox/engine/google_calendar_onebox.rb +1 -1
  22. data/lib/onebox/engine/google_docs_onebox.rb +7 -7
  23. data/lib/onebox/engine/google_drive_onebox.rb +7 -7
  24. data/lib/onebox/engine/google_maps_onebox.rb +0 -2
  25. data/lib/onebox/engine/google_photos_onebox.rb +14 -14
  26. data/lib/onebox/engine/google_play_app_onebox.rb +3 -7
  27. data/lib/onebox/engine/html.rb +4 -1
  28. data/lib/onebox/engine/instagram_onebox.rb +2 -2
  29. data/lib/onebox/engine/kaltura_onebox.rb +8 -6
  30. data/lib/onebox/engine/opengraph_image.rb +0 -1
  31. data/lib/onebox/engine/pubmed_onebox.rb +3 -2
  32. data/lib/onebox/engine/replit_onebox.rb +0 -1
  33. data/lib/onebox/engine/sketchfab_onebox.rb +8 -8
  34. data/lib/onebox/engine/slides_onebox.rb +10 -10
  35. data/lib/onebox/engine/soundcloud_onebox.rb +0 -1
  36. data/lib/onebox/engine/stack_exchange_onebox.rb +2 -1
  37. data/lib/onebox/engine/standard_embed.rb +2 -2
  38. data/lib/onebox/engine/steam_store_onebox.rb +6 -5
  39. data/lib/onebox/engine/trello_onebox.rb +2 -2
  40. data/lib/onebox/engine/twitch_clips_onebox.rb +1 -3
  41. data/lib/onebox/engine/twitch_stream_onebox.rb +1 -2
  42. data/lib/onebox/engine/twitch_video_onebox.rb +0 -2
  43. data/lib/onebox/engine/typeform_onebox.rb +7 -6
  44. data/lib/onebox/engine/vimeo_onebox.rb +9 -7
  45. data/lib/onebox/engine/wikimedia_onebox.rb +1 -2
  46. data/lib/onebox/engine/wikipedia_onebox.rb +12 -8
  47. data/lib/onebox/engine/youku_onebox.rb +7 -7
  48. data/lib/onebox/engine/youtube_onebox.rb +46 -17
  49. data/lib/onebox/file_type_finder.rb +0 -1
  50. data/lib/onebox/helpers.rb +3 -3
  51. data/lib/onebox/mixins/git_blob_onebox.rb +5 -3
  52. data/lib/onebox/mixins/github_body.rb +30 -0
  53. data/lib/onebox/mixins/twitch_onebox.rb +0 -1
  54. data/lib/onebox/preview.rb +1 -2
  55. data/lib/onebox/sanitize_config.rb +1 -1
  56. data/lib/onebox/version.rb +1 -1
  57. data/templates/github/github_body.mustache +5 -0
  58. data/templates/githubcommit.mustache +2 -8
  59. data/templates/githubissue.mustache +7 -9
  60. data/templates/githubpullrequest.mustache +2 -1
  61. metadata +4 -2
@@ -3,7 +3,6 @@
3
3
  module Onebox
4
4
  module Mixins
5
5
  module TwitchOnebox
6
-
7
6
  def self.included(klass)
8
7
  klass.include(Onebox::Engine)
9
8
  klass.matches_regexp(klass.twitch_regexp)
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Onebox
4
4
  class Preview
5
-
6
5
  # see https://bugs.ruby-lang.org/issues/14688
7
6
  client_exception = defined?(Net::HTTPClientException) ? Net::HTTPClientException : Net::HTTPServerException
8
7
  WEB_EXCEPTIONS ||= [client_exception, OpenURI::HTTPError, Timeout::Error, Net::HTTPError, Errno::ECONNREFUSED]
@@ -85,7 +84,7 @@ module Onebox
85
84
 
86
85
  def engine
87
86
  return nil unless @engine_class
88
- return @engine if @engine
87
+ return @engine if defined?(@engine)
89
88
 
90
89
  @engine = @engine_class.new(@url)
91
90
  @engine.options = @options
@@ -6,7 +6,7 @@ class Sanitize
6
6
  HTTP_PROTOCOLS ||= ['http', 'https', :relative].freeze
7
7
 
8
8
  ONEBOX ||= freeze_config merge(RELAXED,
9
- elements: RELAXED[:elements] + %w[audio embed iframe source video svg path],
9
+ elements: RELAXED[:elements] + %w[audio details embed iframe source video svg path],
10
10
 
11
11
  attributes: {
12
12
  'a' => RELAXED[:attributes]['a'] + %w(target),
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onebox
4
- VERSION = "2.2.9"
4
+ VERSION = "2.2.14"
5
5
  end
@@ -0,0 +1,5 @@
1
+ {{#body}}
2
+ <div class="github-row">
3
+ <p class="github-body-container">{{body}}{{#excerpt}}<span class="show-more-container"><a href="{{html_url}}" target="_blank" rel="noopener" class="show-more">…</a>{{/excerpt}}</span>{{#excerpt}}<span class="excerpt hidden">{{excerpt}}</span>{{/excerpt}}</p>
4
+ </div>
5
+ {{/body}}
@@ -18,7 +18,7 @@
18
18
  <img alt="{{author.login}}" src="{{author.avatar_url}}" class="onebox-avatar-inline" width="20" height="20">
19
19
  {{author.login}}
20
20
  </a>
21
-
21
+
22
22
  </div>
23
23
 
24
24
  <div class="lines" title="changed {{files.length}} files with {{stats.additions}} additions and {{stats.deletions}} deletions">
@@ -32,10 +32,4 @@
32
32
  </div>
33
33
  </div>
34
34
 
35
-
36
- {{#message}}
37
- <div class="github-row">
38
- <pre class="github-content" style="white-space: normal;">{{message}}</pre>
39
- </div>
40
- {{/message}}
41
-
35
+ {{> github/github_body}}
@@ -26,15 +26,13 @@
26
26
  </a>
27
27
  </div>
28
28
  </div>
29
- </div>
30
- </div>
31
29
 
32
- <div class="github-row">
33
- <p class='github-content'>{{content}}</p>
30
+ <div class='labels'>
31
+ {{#labels}}
32
+ <span style="display:inline-block;margin-top:2px;background-color: #B8B8B8;padding: 2px;border-radius: 4px;color: #fff;margin-left: 3px;">{{name}}</span>
33
+ {{/labels}}
34
+ </div>
35
+ </div>
34
36
  </div>
35
37
 
36
- <div class='labels'>
37
- {{#labels}}
38
- <span style="display:inline-block;margin-top:2px;background-color: #B8B8B8;padding: 2px;border-radius: 4px;color: #fff;margin-left: 3px;">{{name}}</span>
39
- {{/labels}}
40
- </div>
38
+ {{> github/github_body}}
@@ -31,6 +31,7 @@
31
31
  </a>
32
32
  </div>
33
33
  </div>
34
-
35
34
  </div>
36
35
  </div>
36
+
37
+ {{> github/github_body}}
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: 2.2.9
4
+ version: 2.2.14
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: 2021-03-31 00:00:00.000000000 Z
13
+ date: 2021-04-15 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