drive_env 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b91d91a26586d6e6d6a3fa72cc950353ef83bf4
4
- data.tar.gz: dcc400d4a9d200d949464ea193a51e5ad73d8bbe
3
+ metadata.gz: fb1bb40e154e2f37788dc647359e7d319d15ef2f
4
+ data.tar.gz: a9f72fb90a98aa3f2ce757fa0e6e62dbb553cc5b
5
5
  SHA512:
6
- metadata.gz: 0461d1c75f092b533eeb14c30ffc61a8519594c1e3b82a0da0e6b3951979ab06e129285c989bba31c1a7a56199908abf66942b1d4b8c9bae05df10f33923894d
7
- data.tar.gz: 20e41cf8bceb48c932d20c986fb8b75fec27adf57676ec10dcbc9f4b3a4482499eb2de5864cc868eaf76274d6b6a02a337aea578a9c254b299049c6eaf3e2fd5
6
+ metadata.gz: 2c012be4c993d385da2bccb426efd92458a6960f10b549674ea162b5f42324ebba8f650d93f88148892e9ed06beb84ef55287eabdb83429b439ffee2f562e181
7
+ data.tar.gz: aee1c2cc88aeec90c55ae146c978d593830ba7f14c4ae6e69f000294fe5dfefdfccef1c44aa066dbda55f4555321e0ad4721bcf99ea89ed88a0ab77d33839868
@@ -73,24 +73,23 @@ module DriveEnv
73
73
  DriveEnv.authorizer(config.client_id, config.client_secret, DriveEnv::Config::DEFAULT_TOKENS_STORE_FILE)
74
74
  end
75
75
 
76
- def access_token
77
- unless @access_token
78
- credential = authorizer.get_credentials(DriveEnv::Config::DEFAULT_TOKEN_USER_ID)
76
+ def credential
77
+ unless @credential
78
+ @credential = authorizer.get_credentials(DriveEnv::Config::DEFAULT_TOKEN_USER_ID)
79
79
  case
80
- when credential.nil?
80
+ when @credential.nil?
81
81
  abort "please set access_token: #{$0} auth login"
82
- when credential.expired?
83
- credential.fetch_access_token!
84
- credential.expires_at = credential.issued_at + credential.expires_in
85
- authorizer.store_credentials(DriveEnv::Config::DEFAULT_TOKEN_USER_ID, credential)
82
+ when @credential.expired?
83
+ @credential.fetch_access_token!
84
+ @credential.expires_at = credential.issued_at + credential.expires_in
85
+ authorizer.store_credentials(DriveEnv::Config::DEFAULT_TOKEN_USER_ID, @credential)
86
86
  end
87
- @access_token = credential.access_token
88
87
  end
89
- @access_token
88
+ @credential
90
89
  end
91
90
 
92
91
  def session
93
- @session ||= GoogleDrive.login_with_oauth(access_token)
92
+ @session ||= GoogleDrive.login_with_oauth(credential)
94
93
  end
95
94
 
96
95
  def worksheet(url_or_alias)
@@ -1,3 +1,3 @@
1
1
  module DriveEnv
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drive_env
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - YAMADA Tsuyoshi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-30 00:00:00.000000000 Z
11
+ date: 2016-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google_drive