youtube-g 0.4.9.9 → 0.5.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/History.txt +4 -0
- data/README.txt +1 -0
- data/lib/youtube_g.rb +1 -1
- data/lib/youtube_g/client.rb +1 -1
- data/lib/youtube_g/request/user_search.rb +4 -0
- data/test/test_client.rb +6 -0
- data/youtube-g.gemspec +2 -2
- metadata +3 -3
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -37,6 +37,7 @@ Basic queries:
|
|
37
37
|
client.videos_by(:categories => [:news, :sports])
|
38
38
|
client.videos_by(:categories => [:news, :sports], :tags => ['soccer', 'football'])
|
39
39
|
client.videos_by(:user => 'liz')
|
40
|
+
client.videos_by(:favorites, :user => 'liz')
|
40
41
|
|
41
42
|
Standard feeds:
|
42
43
|
|
data/lib/youtube_g.rb
CHANGED
data/lib/youtube_g/client.rb
CHANGED
@@ -48,7 +48,7 @@ class YouTubeG
|
|
48
48
|
if params.respond_to?(:to_hash) and not params[:user]
|
49
49
|
request = YouTubeG::Request::VideoSearch.new(request_params)
|
50
50
|
elsif (params.respond_to?(:to_hash) && params[:user]) || (params == :favorites)
|
51
|
-
request = YouTubeG::Request::UserSearch.new(
|
51
|
+
request = YouTubeG::Request::UserSearch.new(params, request_params)
|
52
52
|
else
|
53
53
|
request = YouTubeG::Request::StandardSearch.new(params, request_params)
|
54
54
|
end
|
@@ -12,6 +12,10 @@ class YouTubeG
|
|
12
12
|
if params == :favorites
|
13
13
|
@url << "#{options[:user]}/favorites"
|
14
14
|
set_instance_variables(options)
|
15
|
+
elsif params[:user] && options[:favorites]
|
16
|
+
@url << "#{params[:user]}/favorites"
|
17
|
+
set_instance_variables(params)
|
18
|
+
break
|
15
19
|
elsif params[:user]
|
16
20
|
@url << "#{params[:user]}/uploads"
|
17
21
|
set_instance_variables(params)
|
data/test/test_client.rb
CHANGED
@@ -145,6 +145,12 @@ class TestClient < Test::Unit::TestCase
|
|
145
145
|
# response.videos.each { |v| assert_valid_video v }
|
146
146
|
# end
|
147
147
|
|
148
|
+
def test_should_get_favorite_videos_by_user
|
149
|
+
response = @client.videos_by(:favorites, :user => 'drnicwilliams')
|
150
|
+
assert_equal "http://gdata.youtube.com/feeds/api/users/drnicwilliams/favorites", response.feed_id
|
151
|
+
response.videos.each { |v| assert_valid_video v }
|
152
|
+
end
|
153
|
+
|
148
154
|
def test_should_get_videos_for_query_search_with_categories_excluded
|
149
155
|
video = @client.video_by("EkF4JD2rO3Q")
|
150
156
|
assert_equal "<object width=\"425\" height=\"350\">\n <param name=\"movie\" value=\"http://www.youtube.com/v/EkF4JD2rO3Q\"></param>\n <param name=\"wmode\" value=\"transparent\"></param>\n <embed src=\"http://www.youtube.com/v/EkF4JD2rO3Q\" type=\"application/x-shockwave-flash\" \n wmode=\"transparent\" width=\"425\" height=\"350\"></embed>\n</object>\n", video.embed_html
|
data/youtube-g.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
spec = Gem::Specification.new do |s|
|
2
2
|
s.name = 'youtube-g'
|
3
|
-
s.version = '0.
|
4
|
-
s.date = '
|
3
|
+
s.version = '0.5.0'
|
4
|
+
s.date = '2009-01-07'
|
5
5
|
s.summary = 'An object-oriented Ruby wrapper for the YouTube GData API'
|
6
6
|
s.email = "ruby-youtube-library@googlegroups.com"
|
7
7
|
s.homepage = "http://youtube-g.rubyforge.org/"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: youtube-g
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Vitarana
|
@@ -12,7 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date:
|
15
|
+
date: 2009-01-07 00:00:00 -08:00
|
16
16
|
default_executable:
|
17
17
|
dependencies: []
|
18
18
|
|
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
77
|
requirements: []
|
78
78
|
|
79
79
|
rubyforge_project:
|
80
|
-
rubygems_version: 1.
|
80
|
+
rubygems_version: 1.3.0
|
81
81
|
signing_key:
|
82
82
|
specification_version: 2
|
83
83
|
summary: An object-oriented Ruby wrapper for the YouTube GData API
|