onebox 1.5.64 → 1.5.65

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
  SHA1:
3
- metadata.gz: 27b80099dc780ea9cf712253a0df500f8244d3fc
4
- data.tar.gz: edbb2372f23ed67e92836b45548e1ef9711291b1
3
+ metadata.gz: b1dd682c72681a17c69e363766f587a4097c04db
4
+ data.tar.gz: 75f051379112a175c15a2e5ecda7f70a28ffbd0c
5
5
  SHA512:
6
- metadata.gz: 6a231b47916df63078667679fbf5da44382a9b482bb6140ae70280e4f82ad688c62f71b83db8c9a5afbcd6846a63aa38f0c0257c22e0f994835d66c5a1e3f5ad
7
- data.tar.gz: c2044e2c861058a2eb9461b2c6a8b70587be21bd43cd6b3cc22fcb906610e1cb33c30403340d893ed194d2e8393e7b9da9f5a7ce6a4917c8b5b2f63ab3efb9ad
6
+ metadata.gz: afd8f90b47a506d77485ba827adec451b599ce69de29bd9ebb9731085422eebbb8edb73adff841f94a28006734343b9c8161fd0c4e28ef30ea6bd9fc4e191373
7
+ data.tar.gz: 4e9c9f3afb625ff29cdae3c6959199796377f04cb48aa3f9a20282a57308be9fcb3e8c4c20a8ba8e16151982548ae8fa50ba3a5cbdac0e7120a60fc8314993aa
data/lib/onebox/engine.rb CHANGED
@@ -166,3 +166,4 @@ require_relative "engine/pastebin_onebox"
166
166
  require_relative "engine/slides_onebox"
167
167
  require_relative "engine/xkcd_onebox"
168
168
  require_relative "engine/giphy_onebox"
169
+ require_relative "engine/gfycat_onebox"
@@ -0,0 +1,34 @@
1
+ module Onebox
2
+ module Engine
3
+ class GfycatOnebox
4
+ include Engine
5
+ include StandardEmbed
6
+
7
+ matches_regexp(/^https?:\/\/gfycat\.com\//)
8
+
9
+ def to_html
10
+ oembed = get_oembed
11
+ src = Nokogiri::HTML::fragment(oembed[:html]).at_css("iframe")["src"]
12
+
13
+ <<-HTML
14
+ <iframe src="#{src}"
15
+ width="#{oembed[:width]}"
16
+ height="#{oembed[:height]}"
17
+ scrolling="no"
18
+ frameborder="0"
19
+ allowfullscreen>
20
+ </iframe>
21
+ HTML
22
+ end
23
+
24
+ def placeholder_html
25
+ opengraph = get_opengraph
26
+
27
+ <<-HTML
28
+ <img src="#{opengraph[:image]}" width=""#{opengraph[:image_width]}" height=""#{opengraph[:image_height]}">
29
+ HTML
30
+ end
31
+
32
+ end
33
+ end
34
+ end
@@ -4,7 +4,7 @@ module Onebox
4
4
  include Engine
5
5
  include StandardEmbed
6
6
 
7
- matches_regexp(/^https?:\/\/giphy\.com\/gifs\//)
7
+ matches_regexp(/^https?:\/\/(giphy\.com\/gifs|gph\.is)\//)
8
8
 
9
9
  def to_html
10
10
  oembed = get_oembed
@@ -15,6 +15,7 @@ module Onebox
15
15
  </a>
16
16
  HTML
17
17
  end
18
+
18
19
  end
19
20
  end
20
21
  end
@@ -16,7 +16,7 @@ module Onebox
16
16
  webkitallowfullscreen
17
17
  mozallowfullscreen
18
18
  allowfullscreen>
19
- </iframe>"
19
+ </iframe>
20
20
  HTML
21
21
  end
22
22
 
@@ -1,3 +1,3 @@
1
1
  module Onebox
2
- VERSION = "1.5.64"
2
+ VERSION = "1.5.65"
3
3
  end
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.5.64
4
+ version: 1.5.65
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: 2016-11-14 00:00:00.000000000 Z
13
+ date: 2016-11-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -303,6 +303,7 @@ files:
303
303
  - lib/onebox/engine/amazon_onebox.rb
304
304
  - lib/onebox/engine/audio_onebox.rb
305
305
  - lib/onebox/engine/douban_onebox.rb
306
+ - lib/onebox/engine/gfycat_onebox.rb
306
307
  - lib/onebox/engine/giphy_onebox.rb
307
308
  - lib/onebox/engine/github_blob_onebox.rb
308
309
  - lib/onebox/engine/github_commit_onebox.rb
@@ -445,7 +446,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
445
446
  version: '0'
446
447
  requirements: []
447
448
  rubyforge_project:
448
- rubygems_version: 2.6.7
449
+ rubygems_version: 2.5.1
449
450
  signing_key:
450
451
  specification_version: 4
451
452
  summary: A gem for turning URLs into previews.