videawesome 0.0.7 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/videawesome.rb +6 -3
- metadata +6 -6
data/lib/videawesome.rb
CHANGED
@@ -6,15 +6,15 @@ module Videawesome
|
|
6
6
|
|
7
7
|
def self.youtube_video(url, text, height, width)
|
8
8
|
url_ident =url.scan(IDENT).to_s
|
9
|
-
altered_text = text.gsub(url,"<iframe
|
9
|
+
altered_text = text.gsub(url,"<iframe width=\"#{width}\" height=\"#{height}\" src=\"http://www.youtube.com/embed/#{url_ident}\" frameborder=\"0\" allowfullscreen></iframe>")
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.vimeo_video(url, text, height, width)
|
13
13
|
url_ident = url.scan(IDENT).to_s
|
14
|
-
altered_text = text.gsub(url,"<iframe title='Vimeo Video Player' src='http://player.vimeo.com/video#{url_ident}' width='#{width}' height='#{height}' frameborder='0'></iframe
|
14
|
+
altered_text = text.gsub(url,"<iframe title='Vimeo Video Player' src='http://player.vimeo.com/video#{url_ident}' width='#{width}' height='#{height}' frameborder='0'></iframe>")
|
15
15
|
end
|
16
16
|
|
17
|
-
def self.parse_video(text, height, width)
|
17
|
+
def self.parse_video(text, height, width, show_message=true)
|
18
18
|
url = text.split.grep(URL).to_s
|
19
19
|
|
20
20
|
if url != "" && url.match("youtube.com") || url.match("youtu.be")
|
@@ -22,6 +22,9 @@ module Videawesome
|
|
22
22
|
elsif url != "" && url.match("vimeo.com")
|
23
23
|
text = vimeo_video(url, text, height, width)
|
24
24
|
end
|
25
|
+
if show_message
|
26
|
+
text << "<br /> <small>dont have flash player installed? <a href=\"#{url}\" target=\"_blank\">click here</a></small>"
|
27
|
+
end
|
25
28
|
return text
|
26
29
|
end
|
27
30
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: videawesome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 13
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Lee
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-05-
|
18
|
+
date: 2011-05-24 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
59
|
requirements: []
|
60
60
|
|
61
61
|
rubyforge_project:
|
62
|
-
rubygems_version: 1.
|
62
|
+
rubygems_version: 1.4.2
|
63
63
|
signing_key:
|
64
64
|
specification_version: 3
|
65
65
|
summary: An awesome video helper for Ruby and Rails apps
|