acts_as_video 0.1.3 → 0.1.4

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{acts_as_video}
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["anark"]
@@ -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.type = domain_class.to_s
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 type
71
- type.constantize.send :embed_url, embed_id
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(:type) { should == 'Vimeo' }
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(:type) { should == "Vimeo"}
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(:type) { should == "Youtube"}
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>"}
@@ -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 :type, :string
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 :type, :string
12
+ t.column :host, :string
13
13
  t.column :thumbnail_url, :string
14
14
  end
15
15
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_video
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - anark