youtube_it 1.2.5 → 1.2.6

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/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.5
1
+ 1.2.6
@@ -302,6 +302,11 @@ class YouTubeIt
302
302
  @atoken,@asecret = atoken, asecret
303
303
  end
304
304
 
305
+ def current_user
306
+ body = access_token.get("http://gdata.youtube.com/feeds/api/users/default").body
307
+ REXML::Document.new(body).elements["entry"].elements['author'].elements['name'].text
308
+ end
309
+
305
310
  private
306
311
 
307
312
  def client
@@ -405,15 +405,16 @@ class YouTubeIt
405
405
 
406
406
  def get_current_user
407
407
  current_user_url = "/feeds/api/users/default"
408
- body = ''
408
+ response = ''
409
409
  if @access_token.nil?
410
410
  http_connection do |session|
411
- body = session.get2(current_user_url, authorization_headers).body
411
+ response = session.get2(current_user_url, authorization_headers)
412
412
  end
413
413
  else
414
- body = @access_token.get("http://gdata.youtube.com/feeds/api/users/default").body
414
+ response = @access_token.get("http://gdata.youtube.com/feeds/api/users/default")
415
415
  end
416
- REXML::Document.new(body).elements["entry"].elements['author'].elements['name'].text
416
+ raise_on_faulty_response(response)
417
+ REXML::Document.new(response.body).elements["entry"].elements['author'].elements['name'].text
417
418
  end
418
419
 
419
420
  private
Binary file
data/test/test_client.rb CHANGED
@@ -280,6 +280,10 @@ class TestClient < Test::Unit::TestCase
280
280
  assert video.widescreen?
281
281
  end
282
282
 
283
+ def test_get_current_user
284
+ assert @client.current_user, 'tubeit20101'
285
+ end
286
+
283
287
  private
284
288
 
285
289
  def assert_valid_video (video)
data/youtube_it.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{youtube_it}
8
- s.version = "1.2.5"
8
+ s.version = "1.2.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["chebyte", "kylejginavan"]
12
- s.date = %q{2011-01-26}
12
+ s.date = %q{2011-02-01}
13
13
  s.description = %q{Upload, delete, update, comment on youtube videos all from one gem.}
14
14
  s.email = %q{kylejginavan@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -50,6 +50,7 @@ Gem::Specification.new do |s|
50
50
  "pkg/youtube_it-1.2.1.gem",
51
51
  "pkg/youtube_it-1.2.3.gem",
52
52
  "pkg/youtube_it-1.2.4.gem",
53
+ "pkg/youtube_it-1.2.5.gem",
53
54
  "test/helper.rb",
54
55
  "test/test.mov",
55
56
  "test/test_chain_io.rb",
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 2
8
- - 5
9
- version: 1.2.5
8
+ - 6
9
+ version: 1.2.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - chebyte
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-26 00:00:00 -06:00
18
+ date: 2011-02-01 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -89,6 +89,7 @@ files:
89
89
  - pkg/youtube_it-1.2.1.gem
90
90
  - pkg/youtube_it-1.2.3.gem
91
91
  - pkg/youtube_it-1.2.4.gem
92
+ - pkg/youtube_it-1.2.5.gem
92
93
  - test/helper.rb
93
94
  - test/test.mov
94
95
  - test/test_chain_io.rb