zemus 0.0.8 → 0.0.9
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.
- data/README.md +6 -12
- data/lib/zemus/version.rb +1 -1
- data/lib/zemus/youtube.rb +4 -0
- data/spec/zemus/youtube_spec.rb +5 -0
- metadata +3 -2
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Zemus is a ruby gem that translates URLs into embedable code you can insert on a page. It does its magic by simply inspecting and hacking up the URL itself, it makes no external requests to a webservice.
|
4
4
|
|
5
|
-
|
5
|
+
Zemus translates the following URLs to embedabble HTML in standard HTML5 mode:
|
6
6
|
|
7
7
|
* images
|
8
8
|
* mp3s
|
@@ -12,9 +12,9 @@ It currently translates the following URLs to embedabble HTML in standard mode:
|
|
12
12
|
* kickstarter
|
13
13
|
* soundcloud
|
14
14
|
|
15
|
-
For embeddable elements that require flash, we have implemented a "dirty mode" that will allow these objects
|
15
|
+
For embeddable elements that require flash, we have implemented a "dirty mode" that will allow these objects to be displayed in browsers that support it.
|
16
16
|
|
17
|
-
|
17
|
+
Zemus translates the following URLs to embeddable Flash HTML in dirty mode:
|
18
18
|
|
19
19
|
* twitch
|
20
20
|
|
@@ -26,19 +26,13 @@ Add this line to your application's Gemfile:
|
|
26
26
|
|
27
27
|
And then execute:
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
**If you only want to use standard mode and embed HTML5 widgets only, you're done. Skip to usage below.**
|
29
|
+
bundle
|
32
30
|
|
33
31
|
To enable dirty mode, enter the following command:
|
34
32
|
|
35
|
-
|
33
|
+
rails g zemus:install
|
36
34
|
|
37
|
-
This will install the necessary javascript and css files to your project's app/assets directory.
|
38
|
-
|
39
|
-
Be sure to precompile your assets before going live to ensure the zemus.js and zemus.css files get included.
|
40
|
-
|
41
|
-
$ rake assets:precompile
|
35
|
+
This will install the necessary javascript and css files to your project's app/assets directory.
|
42
36
|
|
43
37
|
|
44
38
|
## Usage
|
data/lib/zemus/version.rb
CHANGED
data/lib/zemus/youtube.rb
CHANGED
@@ -17,6 +17,10 @@ module Zemus
|
|
17
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
|
+
def to_embed_image
|
21
|
+
"http://img.youtube.com/vi/#{youtube_id}/hqdefault.jpg"
|
22
|
+
end
|
23
|
+
|
20
24
|
def youtube_id
|
21
25
|
id = ''
|
22
26
|
|
data/spec/zemus/youtube_spec.rb
CHANGED
@@ -5,4 +5,9 @@ describe Zemus::Youtube do
|
|
5
5
|
Zemus::Youtube.new("youtube.com/watch?v=Ai7pMPCDHpo").to_embed.
|
6
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
|
+
|
9
|
+
it "get youtube embed image" do
|
10
|
+
Zemus::Youtube.new("youtube.com/watch?v=Ai7pMPCDHpo").
|
11
|
+
to_embed_image.should eq("http://img.youtube.com/vi/Ai7pMPCDHpo/hqdefault.jpg")
|
12
|
+
end
|
8
13
|
end
|
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.9
|
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: 2014-
|
13
|
+
date: 2014-04-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: railties
|
@@ -155,3 +155,4 @@ test_files:
|
|
155
155
|
- spec/zemus/vine_spec.rb
|
156
156
|
- spec/zemus/youtube_spec.rb
|
157
157
|
- spec/zemus_spec.rb
|
158
|
+
has_rdoc:
|