laserlemon-videoclip 0.1.1 → 0.2.0
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/Manifest +1 -0
- data/Rakefile +1 -1
- data/VERSION.yml +2 -2
- data/lib/videoclip/videos/blip.rb +31 -0
- data/videoclip.gemspec +3 -3
- metadata +3 -1
data/Manifest
CHANGED
data/Rakefile
CHANGED
|
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
|
2
2
|
require 'rake'
|
|
3
3
|
require 'echoe'
|
|
4
4
|
|
|
5
|
-
Echoe.new('videoclip', '0.
|
|
5
|
+
Echoe.new('videoclip', '0.2.0') 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
|
@@ -0,0 +1,31 @@
|
|
|
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
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
data/videoclip.gemspec
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = %q{videoclip}
|
|
5
|
-
s.version = "0.
|
|
5
|
+
s.version = "0.2.0"
|
|
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"]
|
|
9
9
|
s.date = %q{2009-05-28}
|
|
10
10
|
s.description = %q{Save videos from popular sites alongside your ActiveRecord models}
|
|
11
11
|
s.email = %q{steve@laserlemon.com}
|
|
12
|
-
s.extra_rdoc_files = ["lib/videoclip/video.rb", "lib/videoclip/videos/youtube.rb", "lib/videoclip.rb", "README.rdoc", "tasks/videoclip_tasks.rake"]
|
|
13
|
-
s.files = ["init.rb", "lib/videoclip/video.rb", "lib/videoclip/videos/youtube.rb", "lib/videoclip.rb", "Manifest", "MIT-LICENSE", "Rakefile", "README.rdoc", "tasks/videoclip_tasks.rake", "test/test_helper.rb", "test/videoclip_test.rb", "VERSION.yml", "videoclip.gemspec"]
|
|
12
|
+
s.extra_rdoc_files = ["lib/videoclip/video.rb", "lib/videoclip/videos/blip.rb", "lib/videoclip/videos/youtube.rb", "lib/videoclip.rb", "README.rdoc", "tasks/videoclip_tasks.rake"]
|
|
13
|
+
s.files = ["init.rb", "lib/videoclip/video.rb", "lib/videoclip/videos/blip.rb", "lib/videoclip/videos/youtube.rb", "lib/videoclip.rb", "Manifest", "MIT-LICENSE", "Rakefile", "README.rdoc", "tasks/videoclip_tasks.rake", "test/test_helper.rb", "test/videoclip_test.rb", "VERSION.yml", "videoclip.gemspec"]
|
|
14
14
|
s.homepage = %q{http://github.com/laserlemon/videoclip}
|
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Videoclip", "--main", "README.rdoc"]
|
|
16
16
|
s.require_paths = ["lib"]
|
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.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Steve Richert
|
|
@@ -21,6 +21,7 @@ extensions: []
|
|
|
21
21
|
|
|
22
22
|
extra_rdoc_files:
|
|
23
23
|
- lib/videoclip/video.rb
|
|
24
|
+
- lib/videoclip/videos/blip.rb
|
|
24
25
|
- lib/videoclip/videos/youtube.rb
|
|
25
26
|
- lib/videoclip.rb
|
|
26
27
|
- README.rdoc
|
|
@@ -28,6 +29,7 @@ extra_rdoc_files:
|
|
|
28
29
|
files:
|
|
29
30
|
- init.rb
|
|
30
31
|
- lib/videoclip/video.rb
|
|
32
|
+
- lib/videoclip/videos/blip.rb
|
|
31
33
|
- lib/videoclip/videos/youtube.rb
|
|
32
34
|
- lib/videoclip.rb
|
|
33
35
|
- Manifest
|