google_spreadsheet_fetcher 0.1.0 → 0.2.0

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: f64fc0c33bc7dae3976b4524939abbc4fa804d85
4
- data.tar.gz: 53df8c4ab01d25ca63861af70238c60b8099f9a4
3
+ metadata.gz: 827587e277f42c7d004d94267bda0a2f843cc31a
4
+ data.tar.gz: 4edea0e53c1a8b3ff7300c84acac9f6ba052a12a
5
5
  SHA512:
6
- metadata.gz: f3e0dad7e17d8beb8f133139a2e8133f3c7c3ce578e4a2cb9aac1942faeed1b0da5706cd23e71d9db6d0edeb1893b8dee15a7a32bb0a71fb1eb27e2f07220692
7
- data.tar.gz: 71a98ab13281cbf7442a3cbc42d47c2e62eb9851d98c3fb90e4088a0ce58bdef71bd8c722312fa469e2a4d6137ab475e0409d6444b9d53bd7d42a39969304de7
6
+ metadata.gz: 6fae7fb39bded59baadb1e173f34730cb0e33d2d7be9f5172ad750dce45f9710ab61f86b5baa0b94b4cc6f86bf5e7ecbfa28ed8788452d400c7567448caac9f3
7
+ data.tar.gz: 31e8a6d6562452ffddd45056f98d3c242e0feaad9ba5bd262aa9d823b3cea1f3063cd8e977c7f2744ad7eba3817403d896ddbf6e558019b424aabb8bbda123fc
data/.gitignore CHANGED
@@ -10,3 +10,5 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+
14
+ vendor/
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # GoogleSpreadsheetFetcher
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/google_spreadsheet_fetcher`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
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/[USERNAME]/google_spreadsheet_fetcher.
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"
@@ -1,3 +1,3 @@
1
1
  module GoogleSpreadsheetFetcher
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.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: 0.1.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