laserlemon-videoclip 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('videoclip', '0.2.0') do |g|
5
+ Echoe.new('videoclip', '0.2.1') do |g|
6
6
  g.description = %(Save videos from popular sites alongside your ActiveRecord models)
7
7
  g.url = 'http://github.com/laserlemon/videoclip'
8
8
  g.author = 'Steve Richert'
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 2
4
- :patch: 0
4
+ :patch: 1
@@ -1,31 +1,35 @@
1
- class Blip < LaserLemon::Videoclip::Video
2
- def self.match?(uri)
3
- (uri.host =~ /^(?:www\.)?blip\.tv$/i) && (uri.path =~ /^\/file\/\d+$/)
4
- end
5
-
6
- def assign(uri)
7
- @url = "http://blip.tv#{uri.path}"
8
- response = Net::HTTP.get(URI.parse(@url + '?skin=api'))
9
- @key = parse_response(response, %w(response payload asset embed_lookup))
10
- end
11
-
12
- def embed(style = nil)
13
- %(<embed src="http://blip.tv/play/#{@key}" type="application/x-shockwave-flash" width="#{width(style)}" height="#{height(style)}" allowscriptaccess="always" allowfullscreen="true"></embed>)
14
- end
15
-
16
- protected
17
-
18
- def chrome_height
19
- 30
20
- end
21
-
22
- def parse_response(response, path, default = nil)
23
- begin
24
- path.collect!(&:to_s)
25
- destination = path.pop
26
- path.inject(Hash.from_xml(response)){|h,p| h.fetch(p, {}) }.fetch(destination, default)
27
- rescue
28
- default
1
+ module LaserLemon
2
+ module Videoclip
3
+ class Video::Blip < Video
4
+ def self.match?(uri)
5
+ (uri.host =~ /^(?:www\.)?blip\.tv$/i) && (uri.path =~ /^\/file\/\d+$/)
6
+ end
7
+
8
+ def assign(uri)
9
+ @url = "http://blip.tv#{uri.path}"
10
+ response = Net::HTTP.get(URI.parse(@url + '?skin=api'))
11
+ @key = parse_response(response, %w(response payload asset embed_lookup))
12
+ end
13
+
14
+ def embed(style = nil)
15
+ %(<embed src="http://blip.tv/play/#{@key}" type="application/x-shockwave-flash" width="#{width(style)}" height="#{height(style)}" allowscriptaccess="always" allowfullscreen="true"></embed>)
16
+ end
17
+
18
+ protected
19
+
20
+ def chrome_height
21
+ 30
22
+ end
23
+
24
+ def parse_response(response, path, default = nil)
25
+ begin
26
+ path.collect!(&:to_s)
27
+ destination = path.pop
28
+ path.inject(Hash.from_xml(response)){|h,p| h.fetch(p, {}) }.fetch(destination, default)
29
+ rescue
30
+ default
31
+ end
32
+ end
29
33
  end
30
34
  end
31
35
  end
data/videoclip.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{videoclip}
5
- s.version = "0.2.0"
5
+ s.version = "0.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Steve Richert"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: laserlemon-videoclip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Richert