youtube_it 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.4
1
+ 1.2.5
@@ -167,6 +167,10 @@ class YouTubeIt
167
167
  client.enable_http_debugging
168
168
  end
169
169
 
170
+ def current_user
171
+ client.get_current_user
172
+ end
173
+
170
174
  private
171
175
 
172
176
  def client
@@ -229,7 +233,7 @@ class YouTubeIt
229
233
  end
230
234
  {:code => response.code, :body => response.body }
231
235
  end
232
-
236
+
233
237
  private
234
238
  def client
235
239
  @client ||= YouTubeIt::Upload::VideoUpload.new(:dev_key => @dev_key, :authsub_token => @authsub_token)
@@ -298,12 +302,6 @@ class YouTubeIt
298
302
  @atoken,@asecret = atoken, asecret
299
303
  end
300
304
 
301
- def current_user
302
- body = access_token.get("http://gdata.youtube.com/feeds/api/users/default").body
303
- REXML::Document.new(body).elements["entry"].elements['author'].elements['name'].text
304
- end
305
-
306
-
307
305
  private
308
306
 
309
307
  def client
@@ -403,6 +403,19 @@ class YouTubeIt
403
403
  end
404
404
  end
405
405
 
406
+ def get_current_user
407
+ current_user_url = "/feeds/api/users/default"
408
+ body = ''
409
+ if @access_token.nil?
410
+ http_connection do |session|
411
+ body = session.get2(current_user_url, authorization_headers).body
412
+ end
413
+ else
414
+ body = @access_token.get("http://gdata.youtube.com/feeds/api/users/default").body
415
+ end
416
+ REXML::Document.new(body).elements["entry"].elements['author'].elements['name'].text
417
+ end
418
+
406
419
  private
407
420
 
408
421
  def uploads_url
Binary file
data/youtube_it.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{youtube_it}
8
- s.version = "1.2.4"
8
+ s.version = "1.2.5"
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"]
@@ -49,6 +49,7 @@ Gem::Specification.new do |s|
49
49
  "pkg/youtube_it-1.2.0.gem",
50
50
  "pkg/youtube_it-1.2.1.gem",
51
51
  "pkg/youtube_it-1.2.3.gem",
52
+ "pkg/youtube_it-1.2.4.gem",
52
53
  "test/helper.rb",
53
54
  "test/test.mov",
54
55
  "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
- - 4
9
- version: 1.2.4
8
+ - 5
9
+ version: 1.2.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - chebyte
@@ -88,6 +88,7 @@ files:
88
88
  - pkg/youtube_it-1.2.0.gem
89
89
  - pkg/youtube_it-1.2.1.gem
90
90
  - pkg/youtube_it-1.2.3.gem
91
+ - pkg/youtube_it-1.2.4.gem
91
92
  - test/helper.rb
92
93
  - test/test.mov
93
94
  - test/test_chain_io.rb