videawesome 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/videawesome.rb +5 -6
  2. metadata +4 -4
data/lib/videawesome.rb CHANGED
@@ -1,18 +1,17 @@
1
1
  module Videawesome
2
2
  class Convertor
3
3
 
4
- URL = /(ht)tp\:\/\/[www.youtube||vimeo||youtu]+\.[com||be]/
5
- YOUTUBE = /[a-zA-Z0-9]{3,12}/
6
- VIMEO = /[0-9]{3,12}/
4
+ URL = /http\:\/\/[www.youtube||a-z]+\.[a-z]{2,3}\/[a-zA-Z0-9*\/]{3,15}/
5
+ IDENT = /[a-zA-Z0-9]{3,15}$/
7
6
 
8
7
  def self.youtube_video(url, text, height, width)
9
- url_ident =url.scan(YOUTUBE).to_s
8
+ url_ident =url.scan(IDENT).to_s
10
9
  altered_text = text.gsub(url,"<iframe title='YouTube video player' class='youtube-player' type='text/html' width='#{width}' height='#{height}' src='http://www.youtube.com/v/#{url_ident}' frameborder='0'></iframe><br /><small> dont have flash player installed? <a href=\"http://www.youtube.com/v/#{url_ident}\" target=\"_blank\">click here</a></small>")
11
10
  end
12
11
 
13
12
  def self.vimeo_video(url, text, height, width)
14
- url_ident = url.scan(VIMEO).to_s
15
- 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><br /> <small>dont have flash player installed? <a href=\"http://player.vimeo.com/video#{url_ident}\" target=\"_blank\">click here</a></small>")
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><br /> <small>dont have flash player installed? <a href=\"http://player.vimeo.com/video#{url_ident}\" target=\"_blank\">click here</a></small>")
16
15
  end
17
16
 
18
17
  def self.parse_video(text, height, width)
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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
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-09 00:00:00 +01:00
18
+ date: 2011-05-10 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21