lumiere 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lumiere/version.rb +1 -1
- data/lib/lumiere.rb +1 -0
- data/lib/provider/vimeo/vimeo.rb +1 -1
- data/lib/provider/youtube/representer.rb +12 -2
- data/lib/provider/youtube/youtube.rb +4 -4
- data/lib/provider/youtubeplaylist/representer.rb +4 -14
- data/lib/provider/youtubeplaylist/youtubeplaylist.rb +1 -1
- data/lib/provider.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 402cdd95d8d122a17a2e90b334738289cd92effb
|
4
|
+
data.tar.gz: 629b0493becd5354a9c658924b5ef40b8a458cd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecd9905276cb5351e1fbadeae11e603226ea0f3df2c10b7ba6863735efdc2f505ee9bbfdbb39409fb8591ae4341294b5236e5a61807cfb9948558a92cd5547dd
|
7
|
+
data.tar.gz: a090003bbe50f509df7a74059dd19a01315c659080874d384c67ab392d9ccbd79973f3b28f95c6fafef7c4989bb53b5d173834dbe6f85714c7d0f95aa33d2e19
|
data/lib/lumiere/version.rb
CHANGED
data/lib/lumiere.rb
CHANGED
@@ -18,6 +18,7 @@ class Elluminate
|
|
18
18
|
@provider ||= Lumiere::Provider.delegate(url)
|
19
19
|
end
|
20
20
|
|
21
|
+
def_delegators :@provider, :video_id, :playlist_id
|
21
22
|
def_delegators :@provider, :provider, :upload_date
|
22
23
|
def_delegators :@provider, :title, :description, :duration
|
23
24
|
def_delegators :@provider, :thumbnail_small, :thumbnail_medium, :thumbnail_large
|
data/lib/provider/vimeo/vimeo.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
module Lumiere
|
2
2
|
module YouTubeVideoRepresenter
|
3
3
|
include Representable::JSON
|
4
|
-
self.representation_wrap = :entry
|
5
|
-
|
6
4
|
nested 'title' do
|
7
5
|
property :title, as: '$t'
|
8
6
|
end
|
@@ -13,6 +11,10 @@ module Lumiere
|
|
13
11
|
end
|
14
12
|
|
15
13
|
nested 'media$group' do
|
14
|
+
nested 'yt$videoid' do
|
15
|
+
property :video_id, as: '$t'
|
16
|
+
end
|
17
|
+
|
16
18
|
nested 'media$description' do
|
17
19
|
property :description, as: '$t'
|
18
20
|
end
|
@@ -27,4 +29,12 @@ module Lumiere
|
|
27
29
|
end
|
28
30
|
end
|
29
31
|
end
|
32
|
+
|
33
|
+
module YouTubeVideoEntryRepresenter
|
34
|
+
include Representable::JSON
|
35
|
+
nested 'entry' do
|
36
|
+
include YouTubeVideoRepresenter
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
30
40
|
end
|
@@ -6,14 +6,14 @@ class YouTube < Provider
|
|
6
6
|
|
7
7
|
def self.useable?(url)
|
8
8
|
uri = URISchemeless.parse(url)
|
9
|
-
USEABLE.include?(uri.host
|
9
|
+
USEABLE.include?(uri.host)
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.new_from_video_id(video_id)
|
13
13
|
new("http://www.youtube.com/watch?v=#{video_id}")
|
14
14
|
end
|
15
15
|
|
16
|
-
def initialize(url)
|
16
|
+
def initialize(url=nil)
|
17
17
|
@url = url
|
18
18
|
end
|
19
19
|
|
@@ -67,10 +67,10 @@ class YouTube < Provider
|
|
67
67
|
attr_writer attribute
|
68
68
|
end
|
69
69
|
|
70
|
-
attr_writer :thumbnails
|
70
|
+
attr_writer :thumbnails, :video_id
|
71
71
|
|
72
72
|
def fetch!
|
73
|
-
self.extend(
|
73
|
+
self.extend(YouTubeVideoEntryRepresenter).from_json(raw_response)
|
74
74
|
end
|
75
75
|
|
76
76
|
def calculate_video_id
|
@@ -1,3 +1,6 @@
|
|
1
|
+
require_relative '../youtube/youtube'
|
2
|
+
require_relative '../youtube/representer'
|
3
|
+
|
1
4
|
module Lumiere
|
2
5
|
|
3
6
|
module YouTubePlaylistRepresenter
|
@@ -23,20 +26,7 @@ module Lumiere
|
|
23
26
|
end
|
24
27
|
end
|
25
28
|
|
26
|
-
collection :videos, as: :entry, class:
|
27
|
-
|
28
|
-
nested 'links' do
|
29
|
-
property :url, :reader => lambda { |doc, args| self.url = doc[0]['href'] }
|
30
|
-
end
|
31
|
-
|
32
|
-
nested 'media$group' do
|
33
|
-
nested 'yt$videoid' do
|
34
|
-
property :video_id, as: '$t'
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
|
29
|
+
collection :videos, as: :entry, extend: YouTubeVideoRepresenter, class: YouTube
|
40
30
|
end
|
41
31
|
|
42
32
|
end
|
@@ -6,7 +6,7 @@ class YouTubePlaylist < Provider
|
|
6
6
|
|
7
7
|
def self.useable?(url)
|
8
8
|
uri = URISchemeless.parse(url)
|
9
|
-
USEABLE.include?(uri.host
|
9
|
+
USEABLE.include?(uri.host) && (uri.path == '/playlist' || uri.path == '/view_play_list')
|
10
10
|
end
|
11
11
|
|
12
12
|
def initialize(url, opts={})
|
data/lib/provider.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lumiere
|
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
|
- Karl Entwistle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: representable
|