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 +4 -4
- data/lib/drive_env/cli/spreadsheet.rb +10 -11
- data/lib/drive_env/version.rb +1 -1
- 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: fb1bb40e154e2f37788dc647359e7d319d15ef2f
|
4
|
+
data.tar.gz: a9f72fb90a98aa3f2ce757fa0e6e62dbb553cc5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
77
|
-
unless @
|
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
|
-
@
|
88
|
+
@credential
|
90
89
|
end
|
91
90
|
|
92
91
|
def session
|
93
|
-
@session ||= GoogleDrive.login_with_oauth(
|
92
|
+
@session ||= GoogleDrive.login_with_oauth(credential)
|
94
93
|
end
|
95
94
|
|
96
95
|
def worksheet(url_or_alias)
|
data/lib/drive_env/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google_drive
|