youtube-g 0.4.9.9 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ == 0.5.0 / 2009-01-07
2
+
3
+ * Fixed bug in user favorites (thanks Pius Uzamere)
4
+
1
5
  == 0.4.9.9 / 2008-09-01
2
6
 
3
7
  * Add Geodata information (thanks Jose Galisteo)
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
 
@@ -25,5 +25,5 @@ require File.dirname(__FILE__) + '/youtube_g/request/video_search'
25
25
  require File.dirname(__FILE__) + '/youtube_g/response/video_search'
26
26
 
27
27
  class YouTubeG #:nodoc:
28
- VERSION = '0.4.9.9'
28
+ VERSION = '0.5.0'
29
29
  end
@@ -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(request_params, options)
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)
@@ -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
@@ -1,7 +1,7 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'youtube-g'
3
- s.version = '0.4.9.9'
4
- s.date = '2008-09-01'
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.9.9
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: 2008-09-01 00:00:00 -07:00
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.2.0
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