yt 0.6.0 → 0.6.1

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: 21b5af2314c676c2ba25c60e8b5f9162cb2692f1
4
- data.tar.gz: 3b9b42304e0f418b5b95830171dfddecc53dccb1
3
+ metadata.gz: ed6567aa70134861a5d5267d15be4492828e43f3
4
+ data.tar.gz: d4bdab518b596e713bd176aec6b8433717f33770
5
5
  SHA512:
6
- metadata.gz: 2c61d1a02c65e1409c0ee6959a131027919962dd91255378e95eb3b7c6d4940fe92c6c999c161aee7d69a1abdc20e6bd1e7b3d619fbe1e423e651e4fcb0c5847
7
- data.tar.gz: 50a18ac7b664828653834e7aa5464376bd3ffd89cc4870fd64640a7a47d265522f8bdc17d6d5d80c80b88412c06e9b57db0b18bfa6e0cca5a8055cefcaaf5bda
6
+ metadata.gz: 06c0762ba2dad8a2cef8e02484e8b1640c83b247e1f3137dbf13fdd7822be95602cdcb6aab7adba763bd69e853c86727daa171c8491ba55922d6098e17585202
7
+ data.tar.gz: 54c741b87f443665ba64a14133d2816616ae0f3abc82794e42a2233e6ea7534a78e658cc3128cae5d324001f68bf2485764f9d61f2baf866331ecf486f754dce
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yt (0.6.0)
4
+ yt (0.6.1)
5
5
  activesupport
6
6
 
7
7
  GEM
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.0'
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.expire
29
- new_access_token = authentication.access_token
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
@@ -13,10 +13,6 @@ module Yt
13
13
  @expires_at && @expires_at.past?
14
14
  end
15
15
 
16
- def expire
17
- @expires_at = 10.years.ago
18
- end
19
-
20
16
  private
21
17
 
22
18
  def expiration_date(options = {})
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.6.0'
2
+ VERSION = '0.6.1'
3
3
  end
@@ -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.0
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-05 00:00:00.000000000 Z
11
+ date: 2014-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport