acts_as_video 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/acts_as_video.gemspec
CHANGED
@@ -33,7 +33,7 @@ module ActsAsVideo
|
|
33
33
|
def url=(url)
|
34
34
|
begin
|
35
35
|
domain_class = self.class.send :class_from_url, url
|
36
|
-
self.
|
36
|
+
self.host = domain_class.to_s
|
37
37
|
self.embed_id = embed_id_from_url(url, domain_class)
|
38
38
|
data = response
|
39
39
|
self.title = data['title']
|
@@ -67,8 +67,8 @@ module ActsAsVideo
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def embed_url
|
70
|
-
raise NotImplementedError, "Can only call #embed_url on a subclass of acts_as_video class" unless
|
71
|
-
|
70
|
+
raise NotImplementedError, "Can only call #embed_url on a subclass of acts_as_video class" unless host
|
71
|
+
host.constantize.send :embed_url, embed_id
|
72
72
|
end
|
73
73
|
|
74
74
|
def response(options={})
|
@@ -30,7 +30,7 @@ describe Video do
|
|
30
30
|
FakeWeb.register_uri(:get, Vimeo.embed_url(vid_id), :status => ["200", "OK"], :body => {:title => "Hi"}.to_json)
|
31
31
|
subject { Video.new :url => "vimeo.com/#{vid_id}" }
|
32
32
|
it { should be_valid }
|
33
|
-
its(:
|
33
|
+
its(:host) { should == 'Vimeo' }
|
34
34
|
its(:title) { should == 'Hi' }
|
35
35
|
end
|
36
36
|
|
@@ -9,7 +9,7 @@ describe Vimeo do
|
|
9
9
|
let(:video) { Video.new(:url => 'http://www.vimeo.com/17147129') }
|
10
10
|
subject { video }
|
11
11
|
it { should be_valid }
|
12
|
-
its(:
|
12
|
+
its(:host) { should == "Vimeo"}
|
13
13
|
its(:title) { should == 'Tourism Whistler Commercial' }
|
14
14
|
its(:thumbnail_url) { should == 'http://b.vimeocdn.com/ts/106/104/106104409_640.jpg' }
|
15
15
|
its(:embed_code) { should == '<iframe src="http://player.vimeo.com/video/17147129" width="720" height="405" frameborder="0"></iframe>'}
|
@@ -9,7 +9,7 @@ describe Youtube do
|
|
9
9
|
let(:video) { Video.new :url => 'http://www.youtube.com/watch?v=qs0rqOo2Rdw' }
|
10
10
|
subject { video }
|
11
11
|
it { should be_valid }
|
12
|
-
its(:
|
12
|
+
its(:host) { should == "Youtube"}
|
13
13
|
its(:title) { should == 'Opening Day Shred Madness - Whistler/Blackcomb Opening Day 2010/2011' }
|
14
14
|
its(:thumbnail_url) { should == 'http://i2.ytimg.com/vi/qs0rqOo2Rdw/hqdefault.jpg' }
|
15
15
|
its(:embed_code) { should == "<object width=\"720\" height=\"430\"><param name=\"movie\" value=\"http://www.youtube.com/v/qs0rqOo2Rdw?version=3\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/qs0rqOo2Rdw?version=3\" type=\"application/x-shockwave-flash\" width=\"720\" height=\"430\" allowscriptaccess=\"always\" allowfullscreen=\"true\"></embed></object>"}
|
data/spec/schema.rb
CHANGED
@@ -2,14 +2,14 @@ ActiveRecord::Schema.define :version => 0 do
|
|
2
2
|
create_table :videos, :force => true do |t|
|
3
3
|
t.column :title, :string
|
4
4
|
t.column :embed_id, :string
|
5
|
-
t.column :
|
5
|
+
t.column :host, :string
|
6
6
|
t.column :thumbnail_url, :string
|
7
7
|
end
|
8
8
|
|
9
9
|
create_table :vimeo_videos, :force => true do |t|
|
10
10
|
t.column :title, :string
|
11
11
|
t.column :embed_id, :string
|
12
|
-
t.column :
|
12
|
+
t.column :host, :string
|
13
13
|
t.column :thumbnail_url, :string
|
14
14
|
end
|
15
15
|
end
|
metadata
CHANGED