youtube_it 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,10 +1,11 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'oauth'
4
- gem 'simple_oauth'
3
+ gem 'rake', '0.8.7'
4
+ gem 'oauth', '0.4.4'
5
+ gem 'oauth2', '0.5.2'
6
+ gem 'simple_oauth', '0.1.5'
7
+ gem 'faraday', '0.7.3'
5
8
  gem 'builder'
6
- gem 'faraday'
7
- gem 'nokogiri'
8
9
 
9
10
  group :test do
10
11
  gem 'webmock'
data/Gemfile.lock CHANGED
@@ -4,16 +4,20 @@ GEM
4
4
  addressable (2.2.6)
5
5
  builder (3.0.0)
6
6
  crack (0.3.1)
7
- faraday (0.7.5)
7
+ faraday (0.7.3)
8
8
  addressable (~> 2.2.6)
9
- multipart-post (~> 1.1.3)
9
+ multipart-post (~> 1.1.0)
10
10
  rack (>= 1.1.0, < 2)
11
+ multi_json (1.0.4)
11
12
  multipart-post (1.1.4)
12
- nokogiri (1.5.0)
13
- oauth (0.4.5)
14
- rack (1.3.5)
13
+ oauth (0.4.4)
14
+ oauth2 (0.5.2)
15
+ faraday (~> 0.7)
16
+ multi_json (~> 1.0)
17
+ rack (1.4.1)
18
+ rake (0.8.7)
15
19
  simple_oauth (0.1.5)
16
- webmock (1.7.7)
20
+ webmock (1.7.10)
17
21
  addressable (~> 2.2, > 2.2.5)
18
22
  crack (>= 0.1.7)
19
23
 
@@ -22,8 +26,9 @@ PLATFORMS
22
26
 
23
27
  DEPENDENCIES
24
28
  builder
25
- faraday
26
- nokogiri
27
- oauth
28
- simple_oauth
29
+ faraday (= 0.7.3)
30
+ oauth (= 0.4.4)
31
+ oauth2 (= 0.5.2)
32
+ rake (= 0.8.7)
33
+ simple_oauth (= 0.1.5)
29
34
  webmock
data/Manifest.txt CHANGED
@@ -10,6 +10,7 @@ lib/youtube_it/model/author.rb
10
10
  lib/youtube_it/model/category.rb
11
11
  lib/youtube_it/model/contact.rb
12
12
  lib/youtube_it/model/content.rb
13
+ lib/youtube_it/model/message.rb
13
14
  lib/youtube_it/model/playlist.rb
14
15
  lib/youtube_it/model/rating.rb
15
16
  lib/youtube_it/model/thumbnail.rb
data/README.rdoc CHANGED
@@ -42,6 +42,13 @@ Client with OAuth:
42
42
  $ client = YouTubeIt::OAuthClient.new("consumer_key", "consumer_secret", "youtube_username", "developer_key")
43
43
  $ client.authorize_from_access("access_token", "access_secret")
44
44
 
45
+ Client with OAuth2:
46
+ $ client = YouTubeIt::OAuth2Client.new(client_access_token: "access_token", client_refresh_token: "refresh_token", client_id: "client_id", client_secret: "client_secret", dev_key: "dev_key")
47
+
48
+ If your access token is still valid (be careful, access tokens may only be valid for about 1 hour), you can use the client directly. If you want to refresh the access token using the refresh token just do:
49
+
50
+ $ client.refresh_access_token!
51
+
45
52
  == VIDEO QUERIES
46
53
 
47
54
  Note: Each type of client enables searching capabilities.
@@ -49,6 +56,7 @@ Note: Each type of client enables searching capabilities.
49
56
  Basic Queries:
50
57
  $ client.videos_by(:query => "penguin")
51
58
  $ client.videos_by(:query => "penguin", :page => 2, :per_page => 15)
59
+ $ client.videos_by(:query => "penguin", :restriction => "DE")
52
60
  $ client.videos_by(:tags => ['tiger', 'leopard'])
53
61
  $ client.videos_by(:categories => [:news, :sports])
54
62
  $ client.videos_by(:categories => [:news, :sports], :tags => ['soccer', 'football'])
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'rubygems'
2
+ gem 'rake', '0.9.2.2'
2
3
  require 'rake'
3
4
 
4
5
  begin
@@ -10,6 +11,7 @@ begin
10
11
  gem.email = "kylejginavan@gmail.com"
11
12
  gem.homepage = "http://github.com/kylejginavan/youtube_it"
12
13
  gem.add_dependency('oauth','>=0.4.4')
14
+ gem.add_dependency('oauth2','>=0.5.2')
13
15
  gem.add_dependency('simple_oauth', '>=0.1.5')
14
16
  gem.add_dependency('faraday','>=0.7.3')
15
17
  gem.add_dependency('builder')
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.1
1
+ 2.1.2
data/lib/youtube_it.rb CHANGED
@@ -33,6 +33,14 @@ class YouTubeIt
33
33
  @logger ||= create_default_logger
34
34
  end
35
35
 
36
+ def self.adapter=(faraday_adapter)
37
+ @adapter = faraday_adapter
38
+ end
39
+
40
+ def self.adapter
41
+ @adapter ||= Faraday.default_adapter
42
+ end
43
+
36
44
  # Gets mixed into the classes to provide the logger method
37
45
  module Logging #:nodoc:
38
46
 
@@ -60,6 +68,7 @@ end
60
68
  model/comment
61
69
  model/contact
62
70
  model/content
71
+ model/message
63
72
  model/playlist
64
73
  model/rating
65
74
  model/subscription
@@ -76,6 +85,7 @@ end
76
85
  response/video_search
77
86
  middleware/faraday_authheader.rb
78
87
  middleware/faraday_oauth.rb
88
+ middleware/faraday_oauth2.rb
79
89
  middleware/faraday_youtubeit.rb
80
90
  chain_io
81
91
  ).each{|m| require File.dirname(__FILE__) + '/youtube_it/' + m }
@@ -85,7 +85,7 @@ class YouTubeIt
85
85
  # YouTubeIt::Model::Video
86
86
  def video_by(video)
87
87
  vid = nil
88
- vid_regex = /(?:youtube.com|youtu.be).*(?:\/|v=)(\w+)/
88
+ vid_regex = /(?:youtube.com|youtu.be).*(?:\/|v=)([\w-]+)/
89
89
  if video =~ vid_regex
90
90
  vid = $1
91
91
  else
@@ -113,6 +113,10 @@ class YouTubeIt
113
113
  def video_delete(video_id)
114
114
  client.delete(video_id)
115
115
  end
116
+
117
+ def message_delete(message_id)
118
+ client.delete_message(message_id)
119
+ end
116
120
 
117
121
  def upload_token(options, nexturl = "http://www.youtube.com/my_videos")
118
122
  client.get_upload_token(options, nexturl)
@@ -228,6 +232,16 @@ class YouTubeIt
228
232
  def my_contacts(opts = {})
229
233
  client.get_my_contacts(opts)
230
234
  end
235
+
236
+ # Send vedio message
237
+ def send_message(opts = {})
238
+ client.send_message(opts)
239
+ end
240
+
241
+ # Get's all of the user's messages/inbox.
242
+ def my_messages(opts = {})
243
+ client.get_my_messages(opts)
244
+ end
231
245
 
232
246
  private
233
247
 
@@ -390,5 +404,48 @@ class YouTubeIt
390
404
  end
391
405
 
392
406
  end
393
- end
394
407
 
408
+ class OAuth2Client < YouTubeIt::Client
409
+ def initialize(options)
410
+ @client_id = options[:client_id]
411
+ @client_secret = options[:client_secret]
412
+ @client_access_token = options[:client_access_token]
413
+ @client_refresh_token = options[:client_refresh_token]
414
+ @dev_key = options[:dev_key]
415
+ end
416
+
417
+ def oauth_client
418
+ @oauth_client ||= ::OAuth2::Client.new(@client_id, @client_secret,
419
+ :site => "https://accounts.google.com",
420
+ :authorize_url => '/o/oauth2/auth',
421
+ :token_url => '/o/oauth2/token')
422
+ end
423
+
424
+ def access_token
425
+ @access_token ||= ::OAuth2::AccessToken.new(oauth_client, @client_access_token, :refresh_token => @client_refresh_token)
426
+ end
427
+
428
+ def refresh_access_token!
429
+ @access_token = access_token.refresh!
430
+ end
431
+
432
+ def current_user
433
+ profile = access_token.get("http://gdata.youtube.com/feeds/api/users/default")
434
+ response_code = profile.status
435
+
436
+ if response_code/10 == 20 # success
437
+ REXML::Document.new(profile.body).elements["entry"].elements['author'].elements['name'].text
438
+ elsif response_code == 403 || response_code == 401 # auth failure
439
+ raise YouTubeIt::Upload::AuthenticationError.new(profile.inspect, response_code)
440
+ else
441
+ raise YouTubeIt::Upload::UploadError.new(profile.inspect, response_code)
442
+ end
443
+ end
444
+
445
+ private
446
+
447
+ def client
448
+ @client ||= YouTubeIt::Upload::VideoUpload.new(:username => current_user, :access_token => access_token, :dev_key => @dev_key)
449
+ end
450
+ end
451
+ end
@@ -21,4 +21,4 @@ module Faraday
21
21
  @app, @headers = app, headers
22
22
  end
23
23
  end
24
- end
24
+ end
@@ -0,0 +1,13 @@
1
+ module Faraday
2
+ class Request::OAuth2 < Faraday::Middleware
3
+ def call(env)
4
+ env[:request_headers]['Authorization'] = "Bearer #{@access_token.token}"
5
+
6
+ @app.call(env)
7
+ end
8
+
9
+ def initialize(app, access_token)
10
+ @app, @access_token = app, access_token
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ class YouTubeIt
2
+ module Model
3
+ class Message < YouTubeIt::Record
4
+ attr_reader :id, :name, :title, :summary, :published
5
+
6
+ def content
7
+ # This tag contains the same value as the <summary> tag.
8
+ self.summary
9
+ end
10
+ end
11
+ end
12
+ end
@@ -247,6 +247,33 @@ class YouTubeIt
247
247
  return contacts
248
248
  end
249
249
  end
250
+
251
+ # Returns an array of the user's messages
252
+ class MessagesParser < FeedParser
253
+ def parse_content(content)
254
+ doc = REXML::Document.new(content.body)
255
+ puts content.body
256
+ puts "doc..."
257
+ puts doc.inspect
258
+ feed = doc.elements["feed"]
259
+
260
+ messages = []
261
+ feed.elements.each("entry") do |entry|
262
+ author = entry.elements["author"]
263
+ temp_message = YouTubeIt::Model::Message.new(
264
+ :id => entry.elements["id"] ? entry.elements["id"].text.gsub(/.+:inbox:/, "") : nil,
265
+ :title => entry.elements["title"] ? entry.elements["title"].text : nil,
266
+ :name => author && author.elements["name"] ? author.elements["name"].text : nil,
267
+ :summary => entry.elements["summary"] ? entry.elements["summary"].text : nil,
268
+ :published => entry.elements["published"] ? entry.elements["published"].text : nil
269
+ )
270
+
271
+ messages << temp_message
272
+ end
273
+
274
+ return messages
275
+ end
276
+ end
250
277
 
251
278
  class ProfileFeedParser < FeedParser #:nodoc:
252
279
  def parse_content(content)
@@ -17,7 +17,9 @@ class YouTubeIt
17
17
  attr_reader :racy # racy ([exclude], include)
18
18
  attr_reader :author
19
19
  attr_reader :lang # lt
20
-
20
+ attr_reader :restriction
21
+
22
+
21
23
  def initialize(params={})
22
24
  # Initialize our various member data to avoid warnings and so we'll
23
25
  # automatically fall back to the youtube api defaults
@@ -62,6 +64,7 @@ class YouTubeIt
62
64
  'format' => @video_format,
63
65
  'racy' => @racy,
64
66
  'author' => @author,
67
+ 'restriction' => @restriction,
65
68
  'lr' => @lang
66
69
  }
67
70
  end
@@ -124,6 +124,24 @@ class YouTubeIt
124
124
 
125
125
  return YouTubeIt::Parser::ContactsParser.new(response).parse
126
126
  end
127
+
128
+ def send_message(opts)
129
+ message_body = message_xml_for(opts)
130
+ message_url = "/feeds/api/users/%s/inbox" % opts[:recipient_id]
131
+ response = yt_session.post(message_url, message_body)
132
+
133
+ return {:code => response.status, :body => response.body}
134
+ end
135
+
136
+ # Fetches the currently authenticated user's messages (i.e. inbox).
137
+ # When the authentication credentials are incorrect, an AuthenticationError will be raised.
138
+ def get_my_messages(opts)
139
+ messages_url = "/feeds/api/users/default/inbox"
140
+ messages_url << opts.collect { |k,p| [k,p].join '=' }.join('&')
141
+ response = yt_session.get(messages_url)
142
+
143
+ return YouTubeIt::Parser::MessagesParser.new(response).parse
144
+ end
127
145
 
128
146
  # Fetches the data of a video, which may be private. The video must be owned by this user.
129
147
  # When the authentication credentials are incorrect, an AuthenticationError will be raised.
@@ -152,6 +170,14 @@ class YouTubeIt
152
170
 
153
171
  return true
154
172
  end
173
+
174
+ # Delete a video message
175
+ def delete_message(message_id)
176
+ delete_url = "/feeds/api/users/default/inbox/%s" % message_id
177
+ response = yt_session.delete(delete_url)
178
+
179
+ return true
180
+ end
155
181
 
156
182
  def get_upload_token(options, nexturl)
157
183
  @opts = options
@@ -450,6 +476,16 @@ class YouTubeIt
450
476
  end
451
477
  end.to_s
452
478
  end
479
+
480
+ def message_xml_for(data)
481
+ b = Builder::XmlMarkup.new
482
+ b.instruct!
483
+ b.entry(:xmlns => "http://www.w3.org/2005/Atom", 'xmlns:yt' => "http://gdata.youtube.com/schemas/2007") do | m |
484
+ m.id(data[:vedio_id]) #if data[:vedio_id]
485
+ m.title(data[:title]) if data[:title]
486
+ m.summary(data[:message])
487
+ end.to_s
488
+ end
453
489
 
454
490
  def video_xml_for_playlist(data)
455
491
  b = Builder::XmlMarkup.new
@@ -485,10 +521,16 @@ class YouTubeIt
485
521
 
486
522
  def yt_session(url = nil)
487
523
  Faraday.new(:url => (url ? url : base_url), :ssl => {:verify => false}) do |builder|
488
- builder.use Faraday::Request::OAuth, @config_token if @config_token
524
+ if @access_token
525
+ if @config_token
526
+ builder.use Faraday::Request::OAuth, @config_token
527
+ else
528
+ builder.use Faraday::Request::OAuth2, @access_token
529
+ end
530
+ end
489
531
  builder.use Faraday::Request::AuthHeader, authorization_headers
490
532
  builder.use Faraday::Response::YouTubeIt
491
- builder.adapter Faraday.default_adapter
533
+ builder.adapter YouTubeIt.adapter
492
534
 
493
535
  end
494
536
  end
data/test/helper.rb CHANGED
@@ -3,7 +3,6 @@ require 'date'
3
3
  require 'test/unit'
4
4
  require 'pp'
5
5
  require 'open-uri'
6
- require 'nokogiri'
7
6
  require File.dirname(__FILE__) + '/../lib/youtube_it'
8
7
 
9
8
  YouTubeIt.logger.level = Logger::ERROR
data/test/test_client.rb CHANGED
@@ -50,7 +50,7 @@ class TestClient < Test::Unit::TestCase
50
50
  assert_equal 25, response.max_result_count
51
51
  assert_equal 1, response.offset
52
52
 
53
- response = @client.videos_by(:query => "penguin", :page => 2)
53
+ response = @client.videos_by(:query => "penguin", :page => 2)
54
54
  assert_equal "tag:youtube.com,2008:videos", response.feed_id
55
55
  assert_equal 25, response.max_result_count
56
56
  assert_equal 26, response.offset
@@ -217,16 +217,16 @@ class TestClient < Test::Unit::TestCase
217
217
  def test_should_denied_comments
218
218
  video = @client.video_upload(File.open("test/test.mov"), OPTIONS.merge(:comment => "denied"))
219
219
  assert_valid_video video
220
- doc = Nokogiri::HTML(open("http://www.youtube.com/watch?v=#{video.unique_id}"))
221
- doc.css('.comments-disabled-message').each{|tag| assert (tag.content.strip == "Adding comments has been disabled for this video.")}
220
+ doc = open("http://www.youtube.com/watch?v=#{video.unique_id}").read
221
+ assert "Adding comments has been disabled for this video.", doc.match("Adding comments has been disabled for this video.")[0]
222
222
  @client.video_delete(video.unique_id)
223
223
  end
224
224
 
225
225
  def test_should_denied_rate
226
226
  video = @client.video_upload(File.open("test/test.mov"), OPTIONS.merge(:rate => "denied"))
227
227
  assert_valid_video video
228
- doc = Nokogiri::HTML(open("http://www.youtube.com/watch?v=#{video.unique_id}"))
229
- doc.css('#watch-like').each{|tag|; assert (tag.attributes["title"].to_s == "Ratings have been disabled for this video.")}
228
+ doc = open("http://www.youtube.com/watch?v=#{video.unique_id}").read
229
+ assert "Ratings have been disabled for this video.", doc.match("Ratings have been disabled for this video.")[0]
230
230
  @client.video_delete(video.unique_id)
231
231
  end
232
232
 
@@ -359,7 +359,13 @@ class TestClient < Test::Unit::TestCase
359
359
  video = @client.video_by("https://www.youtube.com/watch?v=EkF4JD2rO3Q")
360
360
  assert_valid_video video
361
361
  end
362
-
362
+
363
+ def test_configure_faraday_adapter
364
+ assert YouTubeIt.adapter == Faraday.default_adapter
365
+ YouTubeIt.adapter = :net_http
366
+ assert YouTubeIt.adapter == :net_http
367
+ end
368
+
363
369
  private
364
370
 
365
371
  def assert_valid_video (video)
data/test/test_video.rb CHANGED
@@ -17,7 +17,7 @@ class TestVideo < Test::Unit::TestCase
17
17
 
18
18
  assert_equal "tag:youtube.com,2008:video:BDqs-OZWw9o:related", response.feed_id
19
19
  assert_equal 25, response.max_result_count
20
- assert_equal 23, response.videos.length
20
+ assert_equal 20, response.videos.length
21
21
  assert_equal 1, response.offset
22
22
  assert(response.total_result_count > 0)
23
23
  assert_instance_of Time, response.updated_at
@@ -137,5 +137,11 @@ class TestVideoSearch < Test::Unit::TestCase
137
137
  request = YouTubeIt::Request::UserSearch.new(:favorites, :user => 'liz', :offset => 20, :max_results => 10)
138
138
  assert_equal "http://gdata.youtube.com/feeds/api/users/liz/favorites?max-results=10&start-index=20&v=2", request.url
139
139
  end
140
-
140
+
141
+ # -- Queries with restrictions ---------------------------------------------------------------------------------
142
+
143
+ def test_should_build_basic_query_url_with_restriction
144
+ request = YouTubeIt::Request::VideoSearch.new(:query => "penguin", :restriction => "DE")
145
+ assert_equal "http://gdata.youtube.com/feeds/api/videos?q=penguin&restriction=DE&v=2", request.url
146
+ end
141
147
  end
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 = "2.1.1"
8
+ s.version = "2.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["kylejginavan", "chebyte", "mseppae"]
12
- s.date = %q{2011-12-19}
12
+ s.date = %q{2012-02-05}
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 = [
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
27
27
  "lib/youtube_it/client.rb",
28
28
  "lib/youtube_it/middleware/faraday_authheader.rb",
29
29
  "lib/youtube_it/middleware/faraday_oauth.rb",
30
+ "lib/youtube_it/middleware/faraday_oauth2.rb",
30
31
  "lib/youtube_it/middleware/faraday_youtubeit.rb",
31
32
  "lib/youtube_it/model/activity.rb",
32
33
  "lib/youtube_it/model/author.rb",
@@ -34,6 +35,7 @@ Gem::Specification.new do |s|
34
35
  "lib/youtube_it/model/comment.rb",
35
36
  "lib/youtube_it/model/contact.rb",
36
37
  "lib/youtube_it/model/content.rb",
38
+ "lib/youtube_it/model/message.rb",
37
39
  "lib/youtube_it/model/playlist.rb",
38
40
  "lib/youtube_it/model/rating.rb",
39
41
  "lib/youtube_it/model/subscription.rb",
@@ -71,33 +73,39 @@ Gem::Specification.new do |s|
71
73
  s.specification_version = 3
72
74
 
73
75
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
74
- s.add_runtime_dependency(%q<oauth>, [">= 0"])
75
- s.add_runtime_dependency(%q<simple_oauth>, [">= 0"])
76
+ s.add_runtime_dependency(%q<rake>, ["= 0.8.7"])
77
+ s.add_runtime_dependency(%q<oauth>, ["= 0.4.4"])
78
+ s.add_runtime_dependency(%q<oauth2>, ["= 0.5.2"])
79
+ s.add_runtime_dependency(%q<simple_oauth>, ["= 0.1.5"])
80
+ s.add_runtime_dependency(%q<faraday>, ["= 0.7.3"])
76
81
  s.add_runtime_dependency(%q<builder>, [">= 0"])
77
- s.add_runtime_dependency(%q<faraday>, [">= 0"])
78
- s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
79
82
  s.add_runtime_dependency(%q<oauth>, [">= 0.4.4"])
83
+ s.add_runtime_dependency(%q<oauth2>, [">= 0.5.2"])
80
84
  s.add_runtime_dependency(%q<simple_oauth>, [">= 0.1.5"])
81
85
  s.add_runtime_dependency(%q<faraday>, [">= 0.7.3"])
82
86
  s.add_runtime_dependency(%q<builder>, [">= 0"])
83
87
  else
84
- s.add_dependency(%q<oauth>, [">= 0"])
85
- s.add_dependency(%q<simple_oauth>, [">= 0"])
88
+ s.add_dependency(%q<rake>, ["= 0.8.7"])
89
+ s.add_dependency(%q<oauth>, ["= 0.4.4"])
90
+ s.add_dependency(%q<oauth2>, ["= 0.5.2"])
91
+ s.add_dependency(%q<simple_oauth>, ["= 0.1.5"])
92
+ s.add_dependency(%q<faraday>, ["= 0.7.3"])
86
93
  s.add_dependency(%q<builder>, [">= 0"])
87
- s.add_dependency(%q<faraday>, [">= 0"])
88
- s.add_dependency(%q<nokogiri>, [">= 0"])
89
94
  s.add_dependency(%q<oauth>, [">= 0.4.4"])
95
+ s.add_dependency(%q<oauth2>, [">= 0.5.2"])
90
96
  s.add_dependency(%q<simple_oauth>, [">= 0.1.5"])
91
97
  s.add_dependency(%q<faraday>, [">= 0.7.3"])
92
98
  s.add_dependency(%q<builder>, [">= 0"])
93
99
  end
94
100
  else
95
- s.add_dependency(%q<oauth>, [">= 0"])
96
- s.add_dependency(%q<simple_oauth>, [">= 0"])
101
+ s.add_dependency(%q<rake>, ["= 0.8.7"])
102
+ s.add_dependency(%q<oauth>, ["= 0.4.4"])
103
+ s.add_dependency(%q<oauth2>, ["= 0.5.2"])
104
+ s.add_dependency(%q<simple_oauth>, ["= 0.1.5"])
105
+ s.add_dependency(%q<faraday>, ["= 0.7.3"])
97
106
  s.add_dependency(%q<builder>, [">= 0"])
98
- s.add_dependency(%q<faraday>, [">= 0"])
99
- s.add_dependency(%q<nokogiri>, [">= 0"])
100
107
  s.add_dependency(%q<oauth>, [">= 0.4.4"])
108
+ s.add_dependency(%q<oauth2>, [">= 0.5.2"])
101
109
  s.add_dependency(%q<simple_oauth>, [">= 0.1.5"])
102
110
  s.add_dependency(%q<faraday>, [">= 0.7.3"])
103
111
  s.add_dependency(%q<builder>, [">= 0"])
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: youtube_it
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
- - 1
10
- version: 2.1.1
9
+ - 2
10
+ version: 2.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - kylejginavan
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-12-19 00:00:00 -06:00
20
+ date: 2012-02-05 00:00:00 -06:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -25,13 +25,15 @@ dependencies:
25
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
26
  none: false
27
27
  requirements:
28
- - - ">="
28
+ - - "="
29
29
  - !ruby/object:Gem::Version
30
- hash: 3
30
+ hash: 49
31
31
  segments:
32
32
  - 0
33
- version: "0"
34
- name: oauth
33
+ - 8
34
+ - 7
35
+ version: 0.8.7
36
+ name: rake
35
37
  version_requirements: *id001
36
38
  prerelease: false
37
39
  - !ruby/object:Gem::Dependency
@@ -39,13 +41,15 @@ dependencies:
39
41
  requirement: &id002 !ruby/object:Gem::Requirement
40
42
  none: false
41
43
  requirements:
42
- - - ">="
44
+ - - "="
43
45
  - !ruby/object:Gem::Version
44
- hash: 3
46
+ hash: 7
45
47
  segments:
46
48
  - 0
47
- version: "0"
48
- name: simple_oauth
49
+ - 4
50
+ - 4
51
+ version: 0.4.4
52
+ name: oauth
49
53
  version_requirements: *id002
50
54
  prerelease: false
51
55
  - !ruby/object:Gem::Dependency
@@ -53,13 +57,15 @@ dependencies:
53
57
  requirement: &id003 !ruby/object:Gem::Requirement
54
58
  none: false
55
59
  requirements:
56
- - - ">="
60
+ - - "="
57
61
  - !ruby/object:Gem::Version
58
- hash: 3
62
+ hash: 15
59
63
  segments:
60
64
  - 0
61
- version: "0"
62
- name: builder
65
+ - 5
66
+ - 2
67
+ version: 0.5.2
68
+ name: oauth2
63
69
  version_requirements: *id003
64
70
  prerelease: false
65
71
  - !ruby/object:Gem::Dependency
@@ -67,18 +73,36 @@ dependencies:
67
73
  requirement: &id004 !ruby/object:Gem::Requirement
68
74
  none: false
69
75
  requirements:
70
- - - ">="
76
+ - - "="
71
77
  - !ruby/object:Gem::Version
72
- hash: 3
78
+ hash: 17
73
79
  segments:
74
80
  - 0
75
- version: "0"
76
- name: faraday
81
+ - 1
82
+ - 5
83
+ version: 0.1.5
84
+ name: simple_oauth
77
85
  version_requirements: *id004
78
86
  prerelease: false
79
87
  - !ruby/object:Gem::Dependency
80
88
  type: :runtime
81
89
  requirement: &id005 !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - "="
93
+ - !ruby/object:Gem::Version
94
+ hash: 5
95
+ segments:
96
+ - 0
97
+ - 7
98
+ - 3
99
+ version: 0.7.3
100
+ name: faraday
101
+ version_requirements: *id005
102
+ prerelease: false
103
+ - !ruby/object:Gem::Dependency
104
+ type: :runtime
105
+ requirement: &id006 !ruby/object:Gem::Requirement
82
106
  none: false
83
107
  requirements:
84
108
  - - ">="
@@ -87,12 +111,12 @@ dependencies:
87
111
  segments:
88
112
  - 0
89
113
  version: "0"
90
- name: nokogiri
91
- version_requirements: *id005
114
+ name: builder
115
+ version_requirements: *id006
92
116
  prerelease: false
93
117
  - !ruby/object:Gem::Dependency
94
118
  type: :runtime
95
- requirement: &id006 !ruby/object:Gem::Requirement
119
+ requirement: &id007 !ruby/object:Gem::Requirement
96
120
  none: false
97
121
  requirements:
98
122
  - - ">="
@@ -104,11 +128,27 @@ dependencies:
104
128
  - 4
105
129
  version: 0.4.4
106
130
  name: oauth
107
- version_requirements: *id006
131
+ version_requirements: *id007
108
132
  prerelease: false
109
133
  - !ruby/object:Gem::Dependency
110
134
  type: :runtime
111
- requirement: &id007 !ruby/object:Gem::Requirement
135
+ requirement: &id008 !ruby/object:Gem::Requirement
136
+ none: false
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ hash: 15
141
+ segments:
142
+ - 0
143
+ - 5
144
+ - 2
145
+ version: 0.5.2
146
+ name: oauth2
147
+ version_requirements: *id008
148
+ prerelease: false
149
+ - !ruby/object:Gem::Dependency
150
+ type: :runtime
151
+ requirement: &id009 !ruby/object:Gem::Requirement
112
152
  none: false
113
153
  requirements:
114
154
  - - ">="
@@ -120,11 +160,11 @@ dependencies:
120
160
  - 5
121
161
  version: 0.1.5
122
162
  name: simple_oauth
123
- version_requirements: *id007
163
+ version_requirements: *id009
124
164
  prerelease: false
125
165
  - !ruby/object:Gem::Dependency
126
166
  type: :runtime
127
- requirement: &id008 !ruby/object:Gem::Requirement
167
+ requirement: &id010 !ruby/object:Gem::Requirement
128
168
  none: false
129
169
  requirements:
130
170
  - - ">="
@@ -136,11 +176,11 @@ dependencies:
136
176
  - 3
137
177
  version: 0.7.3
138
178
  name: faraday
139
- version_requirements: *id008
179
+ version_requirements: *id010
140
180
  prerelease: false
141
181
  - !ruby/object:Gem::Dependency
142
182
  type: :runtime
143
- requirement: &id009 !ruby/object:Gem::Requirement
183
+ requirement: &id011 !ruby/object:Gem::Requirement
144
184
  none: false
145
185
  requirements:
146
186
  - - ">="
@@ -150,7 +190,7 @@ dependencies:
150
190
  - 0
151
191
  version: "0"
152
192
  name: builder
153
- version_requirements: *id009
193
+ version_requirements: *id011
154
194
  prerelease: false
155
195
  description: Upload, delete, update, comment on youtube videos all from one gem.
156
196
  email: kylejginavan@gmail.com
@@ -172,6 +212,7 @@ files:
172
212
  - lib/youtube_it/client.rb
173
213
  - lib/youtube_it/middleware/faraday_authheader.rb
174
214
  - lib/youtube_it/middleware/faraday_oauth.rb
215
+ - lib/youtube_it/middleware/faraday_oauth2.rb
175
216
  - lib/youtube_it/middleware/faraday_youtubeit.rb
176
217
  - lib/youtube_it/model/activity.rb
177
218
  - lib/youtube_it/model/author.rb
@@ -179,6 +220,7 @@ files:
179
220
  - lib/youtube_it/model/comment.rb
180
221
  - lib/youtube_it/model/contact.rb
181
222
  - lib/youtube_it/model/content.rb
223
+ - lib/youtube_it/model/message.rb
182
224
  - lib/youtube_it/model/playlist.rb
183
225
  - lib/youtube_it/model/rating.rb
184
226
  - lib/youtube_it/model/subscription.rb