google_spreadsheet_fetcher 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +22 -5
- data/google_spreadsheet_fetcher.gemspec +1 -0
- data/lib/google_spreadsheet_fetcher/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 827587e277f42c7d004d94267bda0a2f843cc31a
|
4
|
+
data.tar.gz: 4edea0e53c1a8b3ff7300c84acac9f6ba052a12a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fae7fb39bded59baadb1e173f34730cb0e33d2d7be9f5172ad750dce45f9710ab61f86b5baa0b94b4cc6f86bf5e7ecbfa28ed8788452d400c7567448caac9f3
|
7
|
+
data.tar.gz: 31e8a6d6562452ffddd45056f98d3c242e0feaad9ba5bd262aa9d823b3cea1f3063cd8e977c7f2744ad7eba3817403d896ddbf6e558019b424aabb8bbda123fc
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# GoogleSpreadsheetFetcher
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Use OAuth 2 authentication to retrieve data from Google Spreadsheet.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,7 +20,26 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
- Make project. https://cloud.google.com/resource-manager/docs/creating-managing-projects
|
24
|
+
- Enable Google Drive API
|
25
|
+
- Make OAuth 2.0 Client. (other)
|
26
|
+
- Download client secret json
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
credential_store_file = Rails.root.join('config', 'credential-oauth2-supporter.json').to_s
|
30
|
+
sheet_key = 'YOUR_SHEET_KEY'
|
31
|
+
|
32
|
+
GoogleSpreadsheetFetcher.configure do |config|
|
33
|
+
config.client_secrets_file_path = Rails.root.join('config', 'client_secrets_pokota_supporter.json').to_s
|
34
|
+
end
|
35
|
+
|
36
|
+
user_id = 'sample'
|
37
|
+
fetcher = GoogleSpreadsheetFetcher::Fetcher.new(credential_store_file, user_id, sheet_key)
|
38
|
+
|
39
|
+
fetcher.fetch_by_index(0)
|
40
|
+
fetcher.fetch_by_title('title')
|
41
|
+
fetcher.fetch_by_gid('gid')
|
42
|
+
```
|
26
43
|
|
27
44
|
## Development
|
28
45
|
|
@@ -32,5 +49,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
49
|
|
33
50
|
## Contributing
|
34
51
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
52
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/taka0125/google_spreadsheet_fetcher.
|
36
53
|
|
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.required_ruby_version = '>= 2.3.0'
|
24
24
|
|
25
25
|
spec.add_dependency 'google-api-client', '~> 0.9'
|
26
|
+
spec.add_dependency 'google_drive', '~> 2.1.3'
|
26
27
|
|
27
28
|
spec.add_development_dependency "bundler", "~> 1.14"
|
28
29
|
spec.add_development_dependency "rake", "~> 10.0"
|
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: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takahiro Ooishi
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: google_drive
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.1.3
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.1.3
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|