sheetsapi 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/sheetsAPI.rb +8 -21
- metadata +24 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5746c09f5f280ea29f798bf50b82610132e1e7d209c03b6a45550767a6d6ae4b
|
4
|
+
data.tar.gz: 7f9b2c2fba937c4e8437635ba4955f29481e8dfbcd9c7ae057cd4aad068ff03a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 446b91b708164d147f7d2628169913eccf69e417eebb961ec67f2c8d623962b7514260528b09b02edb42b64f55ce6e707aa551a471f30bf99f334b7388748762
|
7
|
+
data.tar.gz: b2596a32ac0855dbf8892ff437f5337957a19de0a2de50296fcaecedf9c7fcb29ff9f7a65274462f175a2517e82c1aa2db5edb1194d2a0fa67a50f13d93fd38d
|
data/lib/sheetsAPI.rb
CHANGED
@@ -3,21 +3,6 @@ require 'googleauth'
|
|
3
3
|
require 'google/apis/sheets_v4'
|
4
4
|
require 'google/apis/drive_v3'
|
5
5
|
|
6
|
-
# Uncomment this to inspect requests made to the google API
|
7
|
-
module Google
|
8
|
-
module Apis
|
9
|
-
module Core
|
10
|
-
class HttpClientAdapter
|
11
|
-
alias old_call call
|
12
|
-
def call(request)
|
13
|
-
puts request.inspect
|
14
|
-
old_call(request)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
6
|
module SheetsAPI
|
22
7
|
if !File.file? "#{Dir.pwd}/GoogleAPICredentials.json"
|
23
8
|
puts "WARNING -- Missing Google API Credentials: #{Dir.pwd}/GoogleAPICredentials.json"
|
@@ -25,14 +10,16 @@ module SheetsAPI
|
|
25
10
|
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "#{Dir.pwd}/GoogleAPICredentials.json"
|
26
11
|
end
|
27
12
|
|
28
|
-
|
29
|
-
|
13
|
+
if ENV["GOOGLE_APPLICATION_CREDENTIALS"]
|
14
|
+
scopes = ['https://www.googleapis.com/auth/drive']
|
15
|
+
authorization = Google::Auth.get_application_default(scopes)
|
30
16
|
|
31
|
-
|
32
|
-
|
17
|
+
SheetService = Google::Apis::SheetsV4::SheetsService.new
|
18
|
+
SheetService.authorization = authorization
|
33
19
|
|
34
|
-
|
35
|
-
|
20
|
+
DriveService = Google::Apis::DriveV3::DriveService.new
|
21
|
+
DriveService.authorization = authorization
|
22
|
+
end
|
36
23
|
|
37
24
|
class << self
|
38
25
|
# This will raise if the document cannot be opened
|
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sheetsapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phusion B.V.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2017-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: google-
|
14
|
+
name: google-apis-sheets_v4
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.26.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.26.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: google-apis-drive_v3
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.44.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.44.0
|
27
41
|
description: A simple API for writing to Google Sheets
|
28
42
|
email:
|
29
43
|
- info@phusion.nl
|
@@ -38,7 +52,7 @@ homepage: https://github.com/phusion/sheetsapi
|
|
38
52
|
licenses:
|
39
53
|
- MIT
|
40
54
|
metadata: {}
|
41
|
-
post_install_message:
|
55
|
+
post_install_message:
|
42
56
|
rdoc_options: []
|
43
57
|
require_paths:
|
44
58
|
- lib
|
@@ -53,9 +67,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '0'
|
55
69
|
requirements: []
|
56
|
-
|
57
|
-
|
58
|
-
signing_key:
|
70
|
+
rubygems_version: 3.4.6
|
71
|
+
signing_key:
|
59
72
|
specification_version: 4
|
60
73
|
summary: A simple API for writing to Google Sheets
|
61
74
|
test_files: []
|