reddavis-embedit 0.0.5 → 0.0.6
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/lib/embedit/media.rb +2 -0
- data/lib/embedit/{oembed.rb → oembed/oembed.rb} +0 -0
- data/lib/embedit/{providers.rb → oembed/providers.rb} +1 -1
- data/lib/embedit/{ovi.rb → ovi/ovi.rb} +0 -0
- data/lib/embedit/validate.rb +2 -0
- data/lib/embedit/{youtube.rb → youtube/youtube.rb} +1 -0
- data/lib/embedit.rb +15 -11
- data/spec/player_spec.rb +21 -0
- metadata +7 -6
data/lib/embedit/media.rb
CHANGED
|
File without changes
|
|
@@ -14,7 +14,7 @@ module Embedit
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def load_providers
|
|
17
|
-
providers = YAML.load_file("#{File.dirname(__FILE__)}
|
|
17
|
+
providers = YAML.load_file("#{File.dirname(__FILE__)}/../../providers.yaml")
|
|
18
18
|
providers.each {|d| @sites.merge!(d[0] => d[1])}
|
|
19
19
|
end
|
|
20
20
|
end
|
|
File without changes
|
data/lib/embedit/validate.rb
CHANGED
|
@@ -17,6 +17,7 @@ module Embedit
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def html=(video_id)
|
|
20
|
+
#Add &ap=%2526fmt%3D18 to end of YouTube embed url to gain access to higher quality videos
|
|
20
21
|
@html = %{
|
|
21
22
|
<object width="425" height="350">
|
|
22
23
|
<param name="movie" value="http://www.youtube.com/v/#{video_id}"></param>
|
data/lib/embedit.rb
CHANGED
|
@@ -6,14 +6,16 @@ require 'open-uri'
|
|
|
6
6
|
require 'yaml'
|
|
7
7
|
|
|
8
8
|
#Files
|
|
9
|
-
require 'embedit/providers'
|
|
9
|
+
require 'embedit/oembed/providers'
|
|
10
10
|
require 'embedit/media'
|
|
11
|
-
require 'embedit/oembed'
|
|
12
|
-
require 'embedit/youtube'
|
|
13
|
-
require 'embedit/ovi'
|
|
11
|
+
require 'embedit/oembed/oembed'
|
|
12
|
+
require 'embedit/youtube/youtube'
|
|
13
|
+
require 'embedit/ovi/ovi'
|
|
14
14
|
require 'embedit/exceptions'
|
|
15
15
|
require 'embedit/validate'
|
|
16
|
+
require 'embedit/player/player'
|
|
16
17
|
|
|
18
|
+
# Oembed
|
|
17
19
|
|
|
18
20
|
#puts a = Embedit::Media.new('http://www.vimeo.com/1263763').html
|
|
19
21
|
|
|
@@ -27,16 +29,18 @@ require 'embedit/validate'
|
|
|
27
29
|
|
|
28
30
|
#puts f = Embedit::Media.new('http://revision3.com/trs/blockoland/').html(:height => 500)
|
|
29
31
|
|
|
30
|
-
#YouTUBE
|
|
32
|
+
# YouTUBE
|
|
31
33
|
|
|
32
|
-
#puts g = Embedit::Media.new("http://www.youtube.com/watch?v=j3TOT1lnVTA").
|
|
34
|
+
#puts g = Embedit::Media.new("http://www.youtube.com/watch?v=j3TOT1lnVTA").valid?
|
|
33
35
|
|
|
34
|
-
#
|
|
36
|
+
# OVI
|
|
35
37
|
|
|
36
|
-
#
|
|
37
|
-
|
|
38
|
-
#puts a = Embedit::Media.new('http://share.ovi.com/media/james___.public/james___.10016').html(:height => 900, :width => 100)
|
|
38
|
+
#puts a = Embedit::Media.new('http://share.ovi.com/media/PangeaDay.TEDTalks/PangeaDay.10054').html(:height => 900, :width => 100)
|
|
39
39
|
|
|
40
40
|
#puts b = Embedit::Media.new('http://share.ovi.com/media/DefragTV.public/DefragTV.10014').html#(:height => 900, :width => 100)
|
|
41
41
|
|
|
42
|
-
#puts c = Embedit::Media.new('http://share.ovi.com/media/james___.public/james___.10016').html(:height => 900, :width => 100)
|
|
42
|
+
#puts c = Embedit::Media.new('http://share.ovi.com/media/james___.public/james___.10016').html(:height => 900, :width => 100)
|
|
43
|
+
|
|
44
|
+
# Flash Player
|
|
45
|
+
|
|
46
|
+
#puts a = Embedit::Media.new('../video.flv').html(:height => 900)
|
data/spec/player_spec.rb
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper.rb'
|
|
2
|
+
|
|
3
|
+
describe "JW player tests" do
|
|
4
|
+
|
|
5
|
+
it "should show false on invalid path" do
|
|
6
|
+
a = create_media("aslkdh/asd/asdasda").valid?
|
|
7
|
+
a.should == false
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "should show false on invalid url" do
|
|
11
|
+
a = create_media("../test.flv").valid?
|
|
12
|
+
a.should == true
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
def create_media(url)
|
|
18
|
+
Embedit::Media.new(url)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: reddavis-embedit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Red Davis
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2008-09-
|
|
12
|
+
date: 2008-09-26 04:19:14 -07:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies: []
|
|
15
15
|
|
|
@@ -26,16 +26,17 @@ files:
|
|
|
26
26
|
- lib/embedit.rb
|
|
27
27
|
- lib/providers.yaml
|
|
28
28
|
- lib/embedit/media.rb
|
|
29
|
-
- lib/embedit/providers.rb
|
|
30
|
-
- lib/embedit/youtube.rb
|
|
31
|
-
- lib/embedit/oembed.rb
|
|
29
|
+
- lib/embedit/oembed/providers.rb
|
|
30
|
+
- lib/embedit/youtube/youtube.rb
|
|
31
|
+
- lib/embedit/oembed/oembed.rb
|
|
32
32
|
- lib/embedit/exceptions.rb
|
|
33
33
|
- lib/embedit/validate.rb
|
|
34
|
-
- lib/embedit/ovi.rb
|
|
34
|
+
- lib/embedit/ovi/ovi.rb
|
|
35
35
|
- spec/spec_helper.rb
|
|
36
36
|
- spec/oembed_spec.rb
|
|
37
37
|
- spec/youtube_spec.rb
|
|
38
38
|
- spec/ovi_spec.rb
|
|
39
|
+
- spec/player_spec.rb
|
|
39
40
|
has_rdoc: false
|
|
40
41
|
homepage: http://github.com/reddavis/embedit/
|
|
41
42
|
post_install_message:
|