zemus 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -0
- data/lib/zemus/kickstarter.rb +1 -1
- data/lib/zemus/soundcloud.rb +1 -1
- data/lib/zemus/version.rb +1 -1
- data/lib/zemus/vimeo.rb +1 -1
- data/lib/zemus/vine.rb +1 -1
- data/lib/zemus/youtube.rb +1 -1
- data/spec/zemus/kickstarter_spec.rb +2 -2
- data/spec/zemus/soundcloud_spec.rb +1 -1
- data/spec/zemus/vimeo_spec.rb +1 -1
- data/spec/zemus/vine_spec.rb +1 -1
- data/spec/zemus/youtube_spec.rb +1 -1
- data/spec/zemus_spec.rb +4 -4
- metadata +2 -2
data/README.md
CHANGED
@@ -28,6 +28,8 @@ And then execute:
|
|
28
28
|
|
29
29
|
Zemus.embed("http://www.youtube.com/watch?v=bjAcMDGJcHI")
|
30
30
|
|
31
|
+
Zemus.embed("http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake")
|
32
|
+
|
31
33
|
Zemus.embed("http://www.podtrac.com/pts/redirect.mp3/content.duckfeed.tv/bsc/bsc_E001.mp3")
|
32
34
|
|
33
35
|
Zemus.embed("https://soundcloud.com/destructoid/super-mario-world-by-video")
|
@@ -36,6 +38,8 @@ And then execute:
|
|
36
38
|
|
37
39
|
Zemus.embed("https://vine.co/v/bFPjjheVnau/embed/simple")
|
38
40
|
|
41
|
+
If Zemus can't automagically transfigure the URL it just returns it as a truncated link.
|
42
|
+
|
39
43
|
## TODO / Contributions
|
40
44
|
|
41
45
|
When we output HTML for images and other URLs we tack on some HTML and classes some people may not need. For instance, to get the images we embed to be responsive we tack on the Bootstrap 3 "img-responsive img-thumbnail" classes. We also put a link under the Kickstarter embed to take the person to the page itself. I totally get some people may not want that so feel free to submit a patch to fix this.
|
data/lib/zemus/kickstarter.rb
CHANGED
@@ -14,7 +14,7 @@ module Zemus
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def to_embed
|
17
|
-
embed = "<iframe width='100%' height='
|
17
|
+
embed = "<iframe width='100%' height='600px' scrolling='no' src='http://www.kickstarter.com/projects/#{kickstarter_id}/widget/video.html' frameborder='0'> </iframe>"
|
18
18
|
embed += "<a href='#{url}' target='_blank' class='btn btn-default btn-xs'><i class='glyphicon glyphicon-heart'></i> Back this on Kickstarter!</a>"
|
19
19
|
|
20
20
|
embed
|
data/lib/zemus/soundcloud.rb
CHANGED
@@ -10,7 +10,7 @@ module Zemus
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def to_embed
|
13
|
-
"<iframe autosize='false' width='100%' height='
|
13
|
+
"<iframe autosize='false' width='100%' height='166px' scrolling='no' frameborder='no' src='https://w.soundcloud.com/player/?url=#{@url}'></iframe>"
|
14
14
|
end
|
15
15
|
|
16
16
|
end
|
data/lib/zemus/version.rb
CHANGED
data/lib/zemus/vimeo.rb
CHANGED
@@ -12,7 +12,7 @@ module Zemus
|
|
12
12
|
def to_embed
|
13
13
|
id = @url.split('/').last
|
14
14
|
|
15
|
-
"<iframe src='http://player.vimeo.com/video/#{id}' width='100%' height='
|
15
|
+
"<iframe src='http://player.vimeo.com/video/#{id}' width='100%' height='600px' frameborder='0'></iframe>"
|
16
16
|
end
|
17
17
|
|
18
18
|
end
|
data/lib/zemus/vine.rb
CHANGED
@@ -10,7 +10,7 @@ module Zemus
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def to_embed
|
13
|
-
"<iframe class='vine-embed' src='https://vine.co/v/#{vine_id}/embed/simple' width='100%' height='
|
13
|
+
"<iframe class='vine-embed' src='https://vine.co/v/#{vine_id}/embed/simple' width='100%' height='600px' frameborder='0'></iframe><script async src='//platform.vine.co/static/scripts/embed.js' charset='utf-8'></script>"
|
14
14
|
end
|
15
15
|
|
16
16
|
def vine_id
|
data/lib/zemus/youtube.rb
CHANGED
@@ -14,7 +14,7 @@ module Zemus
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def to_embed
|
17
|
-
"<iframe width='100%' height='
|
17
|
+
"<iframe width='100%' height='600px' src='http://www.youtube.com/embed/#{youtube_id}?wmode=opaque' frameborder='0' allowfullscreen></iframe>"
|
18
18
|
end
|
19
19
|
|
20
20
|
def youtube_id
|
@@ -3,10 +3,10 @@ require_relative('../spec_helper')
|
|
3
3
|
describe Zemus::Kickstarter do
|
4
4
|
it "embeds kickstarter" do
|
5
5
|
Zemus::Kickstarter.new("http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake").to_embed.
|
6
|
-
should eq("<iframe width='100%' height='
|
6
|
+
should eq("<iframe width='100%' height='600px' scrolling='no' src='http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake/widget/video.html' frameborder='0'> </iframe><a href='http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake' target='_blank' class='btn btn-default btn-xs'><i class='glyphicon glyphicon-heart'></i> Back this on Kickstarter!</a>")
|
7
7
|
|
8
8
|
# fix for a bug where a kickstarter URL had a # sign at the end
|
9
9
|
Zemus::Kickstarter.new("http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake#").to_embed.
|
10
|
-
should eq("<iframe width='100%' height='
|
10
|
+
should eq("<iframe width='100%' height='600px' scrolling='no' src='http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake/widget/video.html' frameborder='0'> </iframe><a href='http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake' target='_blank' class='btn btn-default btn-xs'><i class='glyphicon glyphicon-heart'></i> Back this on Kickstarter!</a>")
|
11
11
|
end
|
12
12
|
end
|
@@ -3,6 +3,6 @@ require_relative('../spec_helper')
|
|
3
3
|
describe Zemus::Soundcloud do
|
4
4
|
it "embeds soundcloud" do
|
5
5
|
Zemus::Soundcloud.new("https://soundcloud.com/destructoid/super-mario-world-by-video").to_embed.
|
6
|
-
should eq("<iframe autosize='false' width='100%' height='
|
6
|
+
should eq("<iframe autosize='false' width='100%' height='166px' scrolling='no' frameborder='no' src='https://w.soundcloud.com/player/?url=https://soundcloud.com/destructoid/super-mario-world-by-video'></iframe>")
|
7
7
|
end
|
8
8
|
end
|
data/spec/zemus/vimeo_spec.rb
CHANGED
@@ -3,6 +3,6 @@ require_relative('../spec_helper')
|
|
3
3
|
describe Zemus::Vimeo do
|
4
4
|
it "embeds vimeo" do
|
5
5
|
Zemus::Vimeo.new("http://vimeo.com/21929292").to_embed.
|
6
|
-
should eq("<iframe src='http://player.vimeo.com/video/21929292' width='100%' height='
|
6
|
+
should eq("<iframe src='http://player.vimeo.com/video/21929292' width='100%' height='600px' frameborder='0'></iframe>")
|
7
7
|
end
|
8
8
|
end
|
data/spec/zemus/vine_spec.rb
CHANGED
@@ -3,6 +3,6 @@ require_relative('../spec_helper')
|
|
3
3
|
describe Zemus::Vine do
|
4
4
|
it "embeds vine" do
|
5
5
|
Zemus::Vine.new("https://vine.co/v/bFPjjheVnau/embed/simple").to_embed.
|
6
|
-
should eq("<iframe class='vine-embed' src='https://vine.co/v/bFPjjheVnau/embed/simple' width='100%' height='
|
6
|
+
should eq("<iframe class='vine-embed' src='https://vine.co/v/bFPjjheVnau/embed/simple' width='100%' height='600px' frameborder='0'></iframe><script async src='//platform.vine.co/static/scripts/embed.js' charset='utf-8'></script>")
|
7
7
|
end
|
8
8
|
end
|
data/spec/zemus/youtube_spec.rb
CHANGED
@@ -3,6 +3,6 @@ require_relative('../spec_helper')
|
|
3
3
|
describe Zemus::Youtube do
|
4
4
|
it "embeds youtube" do
|
5
5
|
Zemus::Youtube.new("youtube.com/watch?v=Ai7pMPCDHpo").to_embed.
|
6
|
-
should eq("<iframe width='100%' height='
|
6
|
+
should eq("<iframe width='100%' height='600px' src='http://www.youtube.com/embed/Ai7pMPCDHpo?wmode=opaque' frameborder='0' allowfullscreen></iframe>")
|
7
7
|
end
|
8
8
|
end
|
data/spec/zemus_spec.rb
CHANGED
@@ -29,7 +29,7 @@ describe Zemus do
|
|
29
29
|
[ "", "http://", "http://www.", "https://", "https://www." ].each do |subdomain|
|
30
30
|
url = "#{subdomain}#{url_format}"
|
31
31
|
|
32
|
-
Zemus.embed(url).should eq("<iframe width='100%' height='
|
32
|
+
Zemus.embed(url).should eq("<iframe width='100%' height='600px' src='http://www.youtube.com/embed/Ai7pMPCDHpo?wmode=opaque' frameborder='0' allowfullscreen></iframe>")
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
@@ -43,19 +43,19 @@ describe Zemus do
|
|
43
43
|
it "acceptance test for sound-claus" do
|
44
44
|
url = "https://soundcloud.com/destructoid/super-mario-world-by-video"
|
45
45
|
|
46
|
-
Zemus.embed(url).should eq("<iframe autosize='false' width='100%' height='
|
46
|
+
Zemus.embed(url).should eq("<iframe autosize='false' width='100%' height='166px' scrolling='no' frameborder='no' src='https://w.soundcloud.com/player/?url=https://soundcloud.com/destructoid/super-mario-world-by-video'></iframe>")
|
47
47
|
end
|
48
48
|
|
49
49
|
it "acceptance test for vimeo" do
|
50
50
|
url = "http://vimeo.com/21929292"
|
51
51
|
|
52
|
-
Zemus.embed(url).should eq("<iframe src='http://player.vimeo.com/video/21929292' width='100%' height='
|
52
|
+
Zemus.embed(url).should eq("<iframe src='http://player.vimeo.com/video/21929292' width='100%' height='600px' frameborder='0'></iframe>")
|
53
53
|
end
|
54
54
|
|
55
55
|
it "acceptance test for vine" do
|
56
56
|
url = "https://vine.co/v/bFPjjheVnau/embed/simple"
|
57
57
|
|
58
|
-
Zemus.embed(url).should eq("<iframe class='vine-embed' src='https://vine.co/v/bFPjjheVnau/embed/simple' width='100%' height='
|
58
|
+
Zemus.embed(url).should eq("<iframe class='vine-embed' src='https://vine.co/v/bFPjjheVnau/embed/simple' width='100%' height='600px' frameborder='0'></iframe><script async src='//platform.vine.co/static/scripts/embed.js' charset='utf-8'></script>")
|
59
59
|
end
|
60
60
|
|
61
61
|
it "acceptance test for the generic fallback" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zemus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-11-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|