yt 0.5.13 → 0.5.14

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc79b5682be98448f4c2ad0e47e025ece396f2ca
4
- data.tar.gz: 3b3ba9a7646c1fe350c10bf1cc01ffc9e3c01062
3
+ metadata.gz: cc8bf39c826412cf4ebac40de897b1e6d298d3db
4
+ data.tar.gz: 56a50c740682435e1cf6640e13b1f456f85f7ef7
5
5
  SHA512:
6
- metadata.gz: e8be6da305362d7f2578157ba5cdd0d6c717bbbd8f5a677ac898af79332fc5bb098b0f777006fc7d002da696346403910d724c673e308d897b1c700fa83e295e
7
- data.tar.gz: 90842585d61ad708d4dba3fefac8b7bc2f51ac8eeae58ca3acdd5d989bf4eae495ba9a6b984b758f4e7bc5f2b20a5d8f14604c6e821ecb935745af67fb5363c8
6
+ metadata.gz: f23bdaf43476b944abfe8a0614cd381f4a340929aee7e480425a07f62ce4dbed0e76d5e65b4f15e22a4098fdee392de0b9e4b39492ddb4c28cb9fdab60ea2fa0
7
+ data.tar.gz: 5a3629db8476e76a4a37dbbb457f85a43a800149d7f31d8f9eb16cec181ee6d8f2be5ed5c5bb4e0dfa049750b3a919104cff4ad905f4d59d513d90eeafa0d9ce
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yt (0.5.13)
4
+ yt (0.5.14)
5
5
  activesupport
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -10,7 +10,7 @@ Yt helps you write apps that need to interact with the YouTube API V3.
10
10
  [![Code Climate](https://codeclimate.com/github/Fullscreen/yt.png)](https://codeclimate.com/github/Fullscreen/yt)
11
11
  [![Inline docs](http://inch-pages.github.io/github/Fullscreen/yt.png)](http://inch-pages.github.io/github/Fullscreen/yt)
12
12
 
13
- After [registering your app](#registering-your-app), you can run commands like:
13
+ After [registering your app](#configuring-your-app), you can run commands like:
14
14
 
15
15
  ```ruby
16
16
  channel = Yt::Channel.new id: 'UCxO1tY8h1AhOz0T4ENwmpow'
@@ -226,8 +226,8 @@ so you won’t be able to like a video, subscribe to a channel or delete a
226
226
  playlist from a specific account. You will only be able to retrieve read-only
227
227
  data.
228
228
 
229
- Web apps that do require user interactions
230
- ------------------------------------------
229
+ Web apps that require user interactions
230
+ ---------------------------------------
231
231
 
232
232
  If you are building a web app that manages YouTube accounts, you need the
233
233
  owner of each account to authorize your app. There are three scenarios:
@@ -287,52 +287,10 @@ account.email #=> (retrieves the account’s e-mail address)
287
287
  account.playlists.first.add_video 'MESycYJytkU' #=> (adds a video to an account’s playlist)
288
288
  ```
289
289
 
290
- Device apps that do require user interactions
291
- ---------------------------------------------
292
-
293
- These apps are equivalent to web apps. The only difference is the interface
294
- that Google uses to ask people to authenticate.
295
-
296
-
297
- Scenario 1. If you already have the account’s **access token**, then you are ready to go.
298
- Just pass that access token to the account initializer, such as:
299
-
300
- ```ruby
301
- account = Yt::Account.new access_token: 'ya29.1.ABCDEFGHIJ'
302
- account.email #=> (retrieves the account’s e-mail address)
303
- account.playlists.first.add_video 'MESycYJytkU' #=> (adds a video to an account’s playlist)
304
- ```
305
-
306
- Scenario 2. If you don’t have the account’s access token, but you have the
307
- **refresh token**, then it’s almost as easy.
308
- Open the [Google Developers Console](https://console.developers.google.com),
309
- find the client ID and client secret of the **native application** that you used to obtain the
310
- refresh token, then add the following snippet of code to the initializer of your app:
311
-
312
- ```ruby
313
- Yt.configure do |config|
314
- config.client_id = '1234567890.apps.googleusercontent.com'
315
- config.client_secret = '1234567890'
316
- end
317
- ```
318
-
319
- replacing the values above with the client ID and secret for web application.
320
- Then you can manage a YouTube account by passing the refresh token to the
321
- account initializer, such as:
322
-
323
- ```ruby
324
- account = Yt::Account.new refresh_token: '1/1234567890'
325
- account.email #=> (retrieves the account’s e-mail address)
326
- account.playlists.first.add_video 'MESycYJytkU' #=> (adds a video to an account’s playlist)
327
- ```
328
-
329
- Scenario 3. If you don’t have the account’s refresh token, then [..TODO..]
330
-
331
-
332
- Configuring your app through environment variables
333
- ==================================================
290
+ Configuring with environment variables
291
+ --------------------------------------
334
292
 
335
- As an alternative to the approach above, you can configure Yt using environment
293
+ As an alternative to the approach above, you can configure your app with
336
294
  variables. Setting the following environment variables:
337
295
 
338
296
  ```bash
@@ -342,7 +300,7 @@ export YT_CLIENT_SECRET="1234567890"
342
300
  export YT_API_KEY="123456789012345678901234567890"
343
301
  ```
344
302
 
345
- is equivalent to configuration your app with the initializer:
303
+ is equivalent to configuring your app with the initializer:
346
304
 
347
305
  ```ruby
348
306
  Yt.configure do |config|
@@ -365,7 +323,7 @@ To install on your system, run
365
323
 
366
324
  To use inside a bundled Ruby project, add this line to the Gemfile:
367
325
 
368
- gem 'yt', '~> 0.5.13'
326
+ gem 'yt', '~> 0.5.14'
369
327
 
370
328
  Since the gem follows [Semantic Versioning](http://semver.org),
371
329
  indicating the full version in your Gemfile (~> *major*.*minor*.*patch*)
@@ -9,6 +9,7 @@ module Yt
9
9
  private
10
10
 
11
11
  def new_item(data)
12
+ data['refresh_token'] = auth_params[:refresh_token]
12
13
  Yt::Authentication.new data
13
14
  end
14
15
 
data/lib/yt/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.5.13'
2
+ VERSION = '0.5.14'
3
3
  end
@@ -11,6 +11,7 @@ describe Yt::Associations::Authentications, :device_app do
11
11
  context 'that is valid' do
12
12
  let(:refresh_token) { ENV['YT_TEST_DEVICE_REFRESH_TOKEN'] }
13
13
  it { expect(account.authentication).to be_a Yt::Authentication }
14
+ it { expect(account.refresh_token).to eq refresh_token }
14
15
  end
15
16
 
16
17
  context 'that is invalid' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.13
4
+ version: 0.5.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-04 00:00:00.000000000 Z
11
+ date: 2014-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport