yt 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/yt/associations/authentications.rb +2 -3
- data/lib/yt/models/authentication.rb +0 -4
- data/lib/yt/version.rb +1 -1
- data/spec/associations/device_auth/authentications_spec.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed6567aa70134861a5d5267d15be4492828e43f3
|
4
|
+
data.tar.gz: d4bdab518b596e713bd176aec6b8433717f33770
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06c0762ba2dad8a2cef8e02484e8b1640c83b247e1f3137dbf13fdd7822be95602cdcb6aab7adba763bd69e853c86727daa171c8491ba55922d6098e17585202
|
7
|
+
data.tar.gz: 54c741b87f443665ba64a14133d2816616ae0f3abc82794e42a2233e6ea7534a78e658cc3128cae5d324001f68bf2485764f9d61f2baf866331ecf486f754dce
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -326,7 +326,7 @@ To install on your system, run
|
|
326
326
|
|
327
327
|
To use inside a bundled Ruby project, add this line to the Gemfile:
|
328
328
|
|
329
|
-
gem 'yt', '~> 0.6.
|
329
|
+
gem 'yt', '~> 0.6.1'
|
330
330
|
|
331
331
|
Since the gem follows [Semantic Versioning](http://semver.org),
|
332
332
|
indicating the full version in your Gemfile (~> *major*.*minor*.*patch*)
|
@@ -25,9 +25,8 @@ module Yt
|
|
25
25
|
# Returns true if the new access token is different from the previous one
|
26
26
|
def refresh
|
27
27
|
old_access_token = authentication.access_token
|
28
|
-
authentication
|
29
|
-
|
30
|
-
old_access_token != new_access_token
|
28
|
+
@authentication = @access_token = @refreshed_authentications = nil
|
29
|
+
old_access_token != authentication.access_token
|
31
30
|
end
|
32
31
|
|
33
32
|
private
|
data/lib/yt/version.rb
CHANGED
@@ -4,6 +4,19 @@ require 'yt/associations/authentications'
|
|
4
4
|
describe Yt::Associations::Authentications, :device_app do
|
5
5
|
subject(:account) { Yt::Account.new attrs }
|
6
6
|
|
7
|
+
describe '#refresh' do
|
8
|
+
context 'given a valid refresh token' do
|
9
|
+
let(:attrs) { {refresh_token: ENV['YT_TEST_DEVICE_REFRESH_TOKEN']} }
|
10
|
+
|
11
|
+
# NOTE: When the token is refreshed, YouTube *might* actually return
|
12
|
+
# the *same* access token if it is still valid. Typically, within the
|
13
|
+
# same second, refreshing the token returns the same token. Still,
|
14
|
+
# testing that *expires_at* changes is a guarantee that we attempted
|
15
|
+
# to get a new token, which is what refresh is meant to do.
|
16
|
+
it { expect{account.refresh}.to change{account.expires_at} }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
7
20
|
describe '#authentication' do
|
8
21
|
context 'given a refresh token' do
|
9
22
|
let(:attrs) { {refresh_token: refresh_token} }
|
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.6.
|
4
|
+
version: 0.6.1
|
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-
|
11
|
+
date: 2014-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|