google_spreadsheet_fetcher 1.7.0 → 1.8.0

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
  SHA256:
3
- metadata.gz: adf35fcabe96fa86ae6e1a6e30d728531471b24c8a1e358e7bf7506db08286ba
4
- data.tar.gz: e6fa6c579750fb93ab46f28bfdf8f6ddda7d00b2c00c79dd29aff62ea9e269eb
3
+ metadata.gz: cff3e92433c66cea9ef0c7b38034a0a1dc8b60147d23b79b8fdd8c63b75d410b
4
+ data.tar.gz: 3990a45e68356829594c4efe28ca5e5d22930e960276a66787c85e8746aef0a8
5
5
  SHA512:
6
- metadata.gz: 40492b6fbe256c65df40a92fc1e4a9d941a2eb25feb82f9f04a68226eb3d4b60defb5d5ba9cebf4dae042d8cb0e8c8ed2b60d76d9b61f2c886d646b04ba88d3d
7
- data.tar.gz: 1ccab637e4927b1031c6e4b262461fb108a5728582bc9e7c9ffd31f29545c23ab146640da89543a56912958bf200452874e8cb5614329eb1ece7ccdc5a909e1d
6
+ metadata.gz: a89913bd36f9d02448d8705e5b28e901306ab65d7abaa56879d1bfd961939e5a7978a4169a9e9b49ceee0b90b38fda03435e230fe00a25c3cfd05487161e7c18
7
+ data.tar.gz: 1378109ec133abfbb2caed2022cd3b31fe472a4ca9ec1ee7a9c4c3532df045f70c917e3adc38c00d47d4d56519aefc96f8d0a065d019de8c568163ab35f20cc2
@@ -79,4 +79,4 @@ module GoogleSpreadsheetFetcher
79
79
  items + (count - items.count).times.map { fill }
80
80
  end
81
81
  end
82
- end
82
+ end
@@ -5,7 +5,8 @@ module GoogleSpreadsheetFetcher
5
5
  include ActiveSupport::Configurable
6
6
 
7
7
  config_accessor :client_secrets_file
8
- config_accessor :credential_store_file
8
+ config_accessor :credential_store_file # required if token_store not set
9
+ config_accessor :token_store # required if credential_store_file not set
9
10
  config_accessor :scopes
10
11
 
11
12
  def self.default_config
@@ -14,6 +14,7 @@ module GoogleSpreadsheetFetcher
14
14
  @user_id = user_id
15
15
  @config = config || GoogleSpreadsheetFetcher.config
16
16
  @application_name = application_name
17
+ @token_store = config.token_store || Google::Auth::Stores::FileTokenStore.new(file: @config.credential_store_file)
17
18
  end
18
19
 
19
20
  def build
@@ -27,8 +28,7 @@ module GoogleSpreadsheetFetcher
27
28
 
28
29
  def fetch_credentials
29
30
  client_id = Google::Auth::ClientId.from_file(@config.client_secrets_file)
30
- token_store = Google::Auth::Stores::FileTokenStore.new(file: @config.credential_store_file)
31
- authorizer = Google::Auth::UserAuthorizer.new(client_id, @config.scopes, token_store)
31
+ authorizer = Google::Auth::UserAuthorizer.new(client_id, @config.scopes, @token_store)
32
32
 
33
33
  credentials = authorizer.get_credentials(@user_id)
34
34
  return credentials if credentials.present?
@@ -1,3 +1,3 @@
1
1
  module GoogleSpreadsheetFetcher
2
- VERSION = "1.7.0"
2
+ VERSION = "1.8.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_spreadsheet_fetcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takahiro Ooishi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-07-17 00:00:00.000000000 Z
12
+ date: 2021-11-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-api-client