lt-google-api 0.2.4 → 0.3.2

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
  SHA256:
3
- metadata.gz: 203073cba74046037ecc29511af5eb80b60bcb27a4590a5fe9fde1f9334e7355
4
- data.tar.gz: 0e61efbb1603bec389c470395637b31f8e81b3cbe50bb97b4a2a396bfaf375da
3
+ metadata.gz: d67409850dd6edb3a3e87407fd72455607efa5d3ea28cdbba77546095bc985e7
4
+ data.tar.gz: e6a884b8a377aae41ca2fe467550dbc338890c4ad3bf6f6aa4aa14f210d23d52
5
5
  SHA512:
6
- metadata.gz: dad5b20560975ce5037b9a07bf472fdc5ab3c1e3cd69ede699bd3d0d72cbc9b4c49abdfff7fd939b702ad67204285ccd1191ce811d40aa7b0d27e4421560830a
7
- data.tar.gz: f1d8ad2e964132b96317848f5f2413e9115af93c115f8e5888abc722d856d333f9d1786d46c0d14dac747e17aa59a84a2c866da892855c9ae29122d4ddba58d8
6
+ metadata.gz: 0ee254f16420d275a8fddff6598070b21914caacd11eb2ae6e750cf527af25ce760a9aa118d8addeafcf4b036308892dcae2c845882c7d089997bdaa8289c66a
7
+ data.tar.gz: c8f94a660173a69a469b601fe1109810c986d66af19a2d447d0e000e0ea9a57aad09cf542c4c2bdb4602c7db098b50ce38f6c5fcc05a75854bbefcd8a614dc5b
data/.dockerignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # Ignore IDE specific files
11
+ .idea/
12
+
13
+ # Misc
14
+ .DS_Store
15
+ .gem_rbs_collection/
File without changes
data/.gitignore CHANGED
@@ -10,4 +10,7 @@
10
10
  # Ignore IDE specific files
11
11
  .idea/
12
12
 
13
+ # Misc
13
14
  .DS_Store
15
+ .gem_rbs_collection/
16
+ /notes
data/.overcommit.yml CHANGED
@@ -30,6 +30,11 @@ PreCommit:
30
30
  TrailingWhitespace:
31
31
  enabled: true
32
32
 
33
+ TypeCheck:
34
+ enabled: true
35
+ description: RBS check
36
+ command: [ 'steep', 'check' ]
37
+
33
38
  PostCheckout:
34
39
  ALL:
35
40
  quiet: true # Change all post-checkout hooks to only display output on failure
data/.rubocop.yml CHANGED
@@ -13,7 +13,10 @@ AllCops:
13
13
  - db/schema.rb
14
14
  - node_modules/**/*
15
15
  NewCops: enable
16
- TargetRubyVersion: 2.6
16
+ TargetRubyVersion: 2.7
17
+
18
+ Gemspec/DevelopmentDependencies:
19
+ EnforcedStyle: gemspec
17
20
 
18
21
  Layout/MultilineMethodCallIndentation:
19
22
  EnforcedStyle: indented_relative_to_receiver
@@ -28,7 +31,7 @@ Metrics/BlockLength:
28
31
  Exclude:
29
32
  - '**/*_spec.rb'
30
33
  - 'config/routes.rb'
31
- ExcludedMethods: ['guard', 'included']
34
+ AllowedMethods: ['guard', 'included']
32
35
 
33
36
  Metrics/ClassLength:
34
37
  Max: 250
@@ -36,7 +39,7 @@ Metrics/ClassLength:
36
39
  Metrics/CyclomaticComplexity:
37
40
  Max: 9
38
41
 
39
- Metrics/LineLength:
42
+ Layout/LineLength:
40
43
  Max: 120
41
44
 
42
45
  Metrics/MethodLength:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.5
1
+ 2.7.7
data/CHANGELOG.md CHANGED
@@ -4,7 +4,26 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [Unreleased](https://github.com/learningtapestry/lt-google-api/compare/v0.2.4...HEAD)
7
+ ## [Unreleased](https://github.com/learningtapestry/lt-google-api/compare/v0.3.2...HEAD)
8
+
9
+ ## [0.3.0](https://github.com/learningtapestry/lt-lcms/compare/v0.3.0...v0.3.2) - 2023-12-23
10
+
11
+ ### Changed
12
+
13
+ - Bumped versions for 'google-apis-drive_v3' to '~> 0.63.0' and 'googleauth', '~> 1.11.2'
14
+
15
+ ## [0.3.0](https://github.com/learningtapestry/lt-lcms/compare/v0.2.4...v0.3.0) - 2023-12-23
16
+ ### Added
17
+
18
+ - Added Docker support [@paranoicsan](https://github.com/paranoicsan)
19
+ - Added RBS support [@paranoicsan](https://github.com/paranoicsan)
20
+
21
+ ### Changed
22
+
23
+ - Updated dependencies [@paranoicsan](https://github.com/paranoicsan)
24
+ - Ruby updated to 3.2.1 [@paranoicsan](https://github.com/paranoicsan), will be at separate branch ruby-3-upgrade
25
+ - Ruby updated to 2.7.7 [@shlag3n](https://github.com/shlag3n) at the main branch
26
+ - Upgraded google-api to 0.11 [@shlag3n](https://github.com/shlag3n)
8
27
 
9
28
  ## [0.2.4](https://github.com/learningtapestry/lt-lcms/compare/v0.2.3...v0.2.4) - 2021-07-16
10
29
 
data/Dockerfile ADDED
@@ -0,0 +1,17 @@
1
+ FROM ruby:2.7.7
2
+
3
+ ENV APP_PATH=/app/
4
+ ENV LANG=C.UTF-8
5
+ ENV GIT_AUTHOR_NAME="Joe Doe"
6
+ ENV GIT_AUTHOR_EMAIL=joe@doe.com
7
+
8
+ WORKDIR $APP_PATH
9
+
10
+ COPY . $APP_PATH
11
+
12
+ ENV BUNDLER_VERSION=2.4.22
13
+ RUN gem install bundler:"$BUNDLER_VERSION" \
14
+ && bundle install --jobs `expr $(cat /proc/cpuinfo | grep -c "cpu cores") - 1` --retry 3 \
15
+ && rm -rf /usr/local/bundle/cache/*.gem \
16
+ && find /usr/local/bundle/gems/ -name "*.c" -delete \
17
+ && find /usr/local/bundle/gems/ -name "*.o" -delete
data/Gemfile.lock CHANGED
@@ -1,134 +1,171 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lt-google-api (0.2.4)
5
- google-api-client (~> 0.46)
6
- googleauth (~> 0.14)
4
+ lt-google-api (0.3.1)
5
+ google-apis-drive_v3 (~> 0.63.0)
6
+ googleauth (~> 1.11.2)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (6.1.4)
12
- concurrent-ruby (~> 1.0, >= 1.0.2)
11
+ activesupport (8.0.2)
12
+ base64
13
+ benchmark (>= 0.3)
14
+ bigdecimal
15
+ concurrent-ruby (~> 1.0, >= 1.3.1)
16
+ connection_pool (>= 2.2.5)
17
+ drb
13
18
  i18n (>= 1.6, < 2)
19
+ logger (>= 1.4.2)
14
20
  minitest (>= 5.1)
15
- tzinfo (~> 2.0)
16
- zeitwerk (~> 2.3)
17
- addressable (2.8.0)
18
- public_suffix (>= 2.0.2, < 5.0)
19
- ast (2.4.2)
20
- childprocess (4.1.0)
21
- concurrent-ruby (1.1.9)
21
+ securerandom (>= 0.3)
22
+ tzinfo (~> 2.0, >= 2.0.5)
23
+ uri (>= 0.13.1)
24
+ addressable (2.8.7)
25
+ public_suffix (>= 2.0.2, < 7.0)
26
+ ast (2.4.3)
27
+ base64 (0.3.0)
28
+ benchmark (0.4.1)
29
+ bigdecimal (3.2.0)
30
+ childprocess (5.1.0)
31
+ logger (~> 1.5)
32
+ concurrent-ruby (1.3.5)
33
+ connection_pool (2.5.3)
34
+ csv (3.3.4)
22
35
  declarative (0.0.20)
23
- faraday (1.5.1)
24
- faraday-em_http (~> 1.0)
25
- faraday-em_synchrony (~> 1.0)
26
- faraday-excon (~> 1.1)
27
- faraday-httpclient (~> 1.0.1)
28
- faraday-net_http (~> 1.0)
29
- faraday-net_http_persistent (~> 1.1)
30
- faraday-patron (~> 1.0)
31
- multipart-post (>= 1.2, < 3)
32
- ruby2_keywords (>= 0.0.4)
33
- faraday-em_http (1.0.0)
34
- faraday-em_synchrony (1.0.0)
35
- faraday-excon (1.1.0)
36
- faraday-httpclient (1.0.1)
37
- faraday-net_http (1.0.1)
38
- faraday-net_http_persistent (1.2.0)
39
- faraday-patron (1.0.0)
40
- gems (1.2.0)
41
- google-api-client (0.53.0)
42
- google-apis-core (~> 0.1)
43
- google-apis-generator (~> 0.1)
44
- google-apis-core (0.4.0)
36
+ drb (2.2.3)
37
+ faraday (2.13.1)
38
+ faraday-net_http (>= 2.0, < 3.5)
39
+ json
40
+ logger
41
+ faraday-net_http (3.4.0)
42
+ net-http (>= 0.5.0)
43
+ ffi (1.17.2-aarch64-linux-gnu)
44
+ ffi (1.17.2-x86_64-linux-gnu)
45
+ fileutils (1.7.3)
46
+ google-apis-core (0.16.0)
45
47
  addressable (~> 2.5, >= 2.5.1)
46
- googleauth (>= 0.16.2, < 2.a)
47
- httpclient (>= 2.8.1, < 3.a)
48
+ googleauth (~> 1.9)
49
+ httpclient (>= 2.8.3, < 3.a)
48
50
  mini_mime (~> 1.0)
51
+ mutex_m
49
52
  representable (~> 3.0)
50
53
  retriable (>= 2.0, < 4.a)
51
- rexml
52
- webrick
53
- google-apis-discovery_v1 (0.6.0)
54
- google-apis-core (>= 0.4, < 2.a)
55
- google-apis-generator (0.4.0)
56
- activesupport (>= 5.0)
57
- gems (~> 1.2)
58
- google-apis-core (>= 0.4, < 2.a)
59
- google-apis-discovery_v1 (~> 0.5)
60
- thor (>= 0.20, < 2.a)
61
- googleauth (0.16.2)
62
- faraday (>= 0.17.3, < 2.0)
54
+ google-apis-drive_v3 (0.63.0)
55
+ google-apis-core (>= 0.15.0, < 2.a)
56
+ google-cloud-env (2.3.1)
57
+ base64 (~> 0.2)
58
+ faraday (>= 1.0, < 3.a)
59
+ googleauth (1.11.2)
60
+ faraday (>= 1.0, < 3.a)
61
+ google-cloud-env (~> 2.1)
63
62
  jwt (>= 1.4, < 3.0)
64
- memoist (~> 0.16)
65
63
  multi_json (~> 1.11)
66
64
  os (>= 0.9, < 2.0)
67
- signet (~> 0.14)
68
- httpclient (2.8.3)
69
- i18n (1.8.10)
65
+ signet (>= 0.16, < 2.a)
66
+ httpclient (2.9.0)
67
+ mutex_m
68
+ i18n (1.14.7)
70
69
  concurrent-ruby (~> 1.0)
71
70
  iniparse (1.5.0)
72
- jwt (2.2.3)
73
- memoist (0.16.2)
74
- mini_mime (1.1.0)
75
- minitest (5.14.4)
71
+ json (2.12.2)
72
+ jwt (2.10.1)
73
+ base64
74
+ language_server-protocol (3.17.0.5)
75
+ lint_roller (1.1.0)
76
+ listen (3.9.0)
77
+ rb-fsevent (~> 0.10, >= 0.10.3)
78
+ rb-inotify (~> 0.9, >= 0.9.10)
79
+ logger (1.7.0)
80
+ mini_mime (1.1.5)
81
+ minitest (5.25.5)
76
82
  multi_json (1.15.0)
77
- multipart-post (2.1.1)
78
- os (1.1.1)
79
- overcommit (0.58.0)
80
- childprocess (>= 0.6.3, < 5)
83
+ mutex_m (0.3.0)
84
+ net-http (0.6.0)
85
+ uri
86
+ os (1.1.4)
87
+ overcommit (0.67.1)
88
+ childprocess (>= 0.6.3, < 6)
81
89
  iniparse (~> 1.4)
82
- rexml (~> 3.2)
83
- parallel (1.20.1)
84
- parser (3.0.1.1)
90
+ rexml (>= 3.3.9)
91
+ parallel (1.27.0)
92
+ parser (3.3.8.0)
85
93
  ast (~> 2.4.1)
86
- public_suffix (4.0.6)
87
- rainbow (3.0.0)
88
- rake (13.0.3)
89
- regexp_parser (2.1.1)
90
- representable (3.1.1)
94
+ racc
95
+ prism (1.4.0)
96
+ public_suffix (6.0.2)
97
+ racc (1.8.1)
98
+ rainbow (3.1.1)
99
+ rake (13.3.0)
100
+ rb-fsevent (0.11.2)
101
+ rb-inotify (0.11.1)
102
+ ffi (~> 1.0)
103
+ rbs (3.9.4)
104
+ logger
105
+ regexp_parser (2.10.0)
106
+ representable (3.2.0)
91
107
  declarative (< 0.1.0)
92
108
  trailblazer-option (>= 0.1.1, < 0.2.0)
93
109
  uber (< 0.2.0)
94
110
  retriable (3.1.2)
95
- rexml (3.2.5)
96
- rubocop (0.93.1)
111
+ rexml (3.4.1)
112
+ rubocop (1.75.8)
113
+ json (~> 2.3)
114
+ language_server-protocol (~> 3.17.0.2)
115
+ lint_roller (~> 1.1.0)
97
116
  parallel (~> 1.10)
98
- parser (>= 2.7.1.5)
117
+ parser (>= 3.3.0.2)
99
118
  rainbow (>= 2.2.2, < 4.0)
100
- regexp_parser (>= 1.8)
101
- rexml
102
- rubocop-ast (>= 0.6.0)
119
+ regexp_parser (>= 2.9.3, < 3.0)
120
+ rubocop-ast (>= 1.44.0, < 2.0)
103
121
  ruby-progressbar (~> 1.7)
104
- unicode-display_width (>= 1.4.0, < 2.0)
105
- rubocop-ast (1.7.0)
106
- parser (>= 3.0.1.1)
107
- ruby-progressbar (1.11.0)
108
- ruby2_keywords (0.0.5)
109
- signet (0.15.0)
110
- addressable (~> 2.3)
111
- faraday (>= 0.17.3, < 2.0)
122
+ unicode-display_width (>= 2.4.0, < 4.0)
123
+ rubocop-ast (1.44.1)
124
+ parser (>= 3.3.7.2)
125
+ prism (~> 1.4)
126
+ ruby-progressbar (1.13.0)
127
+ securerandom (0.4.1)
128
+ signet (0.20.0)
129
+ addressable (~> 2.8)
130
+ faraday (>= 0.17.5, < 3.a)
112
131
  jwt (>= 1.5, < 3.0)
113
132
  multi_json (~> 1.10)
114
- thor (1.1.0)
115
- trailblazer-option (0.1.1)
116
- tzinfo (2.0.4)
133
+ steep (1.5.3)
134
+ activesupport (>= 5.1)
135
+ concurrent-ruby (>= 1.1.10)
136
+ csv (>= 3.0.9)
137
+ fileutils (>= 1.1.0)
138
+ json (>= 2.1.0)
139
+ language_server-protocol (>= 3.15, < 4.0)
140
+ listen (~> 3.0)
141
+ logger (>= 1.3.0)
142
+ parser (>= 3.1)
143
+ rainbow (>= 2.2.2, < 4.0)
144
+ rbs (>= 3.1.0)
145
+ securerandom (>= 0.1)
146
+ strscan (>= 1.0.0)
147
+ terminal-table (>= 2, < 4)
148
+ strscan (3.1.5)
149
+ terminal-table (3.0.2)
150
+ unicode-display_width (>= 1.1.1, < 3)
151
+ trailblazer-option (0.1.2)
152
+ tzinfo (2.0.6)
117
153
  concurrent-ruby (~> 1.0)
118
154
  uber (0.1.0)
119
- unicode-display_width (1.7.0)
120
- webrick (1.7.0)
121
- zeitwerk (2.4.2)
155
+ unicode-display_width (2.6.0)
156
+ uri (1.0.3)
122
157
 
123
158
  PLATFORMS
124
- ruby
159
+ aarch64-linux
160
+ x86_64-linux
125
161
 
126
162
  DEPENDENCIES
127
- bundler (~> 1.16)
163
+ bundler (~> 2.4)
128
164
  lt-google-api!
129
165
  overcommit (~> 0.57)
130
166
  rake (~> 13)
131
- rubocop (~> 0.93.1)
167
+ rubocop (~> 1)
168
+ steep (~> 1.5.3)
132
169
 
133
170
  BUNDLED WITH
134
- 1.17.3
171
+ 2.4.6
data/README.md CHANGED
@@ -25,16 +25,36 @@ $ gem install lt-google-api
25
25
 
26
26
  ## Usage
27
27
 
28
- | Name | Description |
29
- |------|-------------|
30
- |GOOGLE_OAUTH2_CLIENT_ID||
31
- |GOOGLE_OAUTH2_CLIENT_SECRET||
28
+ | Name | Description |
29
+ |-----------------------------|-------------|
30
+ | GOOGLE_OAUTH2_CLIENT_ID | |
31
+ | GOOGLE_OAUTH2_CLIENT_SECRET | |
32
32
 
33
33
  ## Development
34
34
 
35
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
35
+ ```shell
36
+ docker buildx build --platform linux/arm64/v8,linux/amd64 -t learningtapestry/lt-google-api:legacy --push .
37
+ ```
38
+
39
+ ### Type checking
40
+
41
+ Install existing collections:
42
+
43
+ ```shell
44
+ rbs collection install
45
+ ```
36
46
 
37
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
47
+ Validate installation
48
+
49
+ ```shell
50
+ rbs validate
51
+ ```
52
+
53
+ Check types
54
+
55
+ ```shell
56
+ steep check
57
+ ```
38
58
 
39
59
  ## Contributing
40
60
 
data/Steepfile ADDED
@@ -0,0 +1,30 @@
1
+ # D = Steep::Diagnostic
2
+ #
3
+ target :lib do
4
+ signature "sig"
5
+
6
+ check "lib" # Directory name
7
+ # check "Gemfile" # File name
8
+ # check "app/models/**/*.rb" # Glob
9
+ # # ignore "lib/templates/*.rb"
10
+ #
11
+ # # library "pathname" # Standard libraries
12
+ # # library "strong_json" # Gems
13
+ library "json", "rbs"
14
+ #
15
+ # # configure_code_diagnostics(D::Ruby.default) # `default` diagnostics setting (applies by default)
16
+ # # configure_code_diagnostics(D::Ruby.strict) # `strict` diagnostics setting
17
+ # # configure_code_diagnostics(D::Ruby.lenient) # `lenient` diagnostics setting
18
+ # # configure_code_diagnostics(D::Ruby.silent) # `silent` diagnostics setting
19
+ # # configure_code_diagnostics do |hash| # You can setup everything yourself
20
+ # # hash[D::Ruby::NoMethod] = :information
21
+ # # end
22
+ end
23
+
24
+ # target :test do
25
+ # signature "sig", "sig-private"
26
+ #
27
+ # check "test"
28
+ #
29
+ # # library "pathname" # Standard libraries
30
+ # end
@@ -0,0 +1,8 @@
1
+ version: '3.8'
2
+
3
+ services:
4
+ app:
5
+ image: learningtapestry/lt-google-api:legacy
6
+ command: bash -c "bundle install && tail -f /dev/null"
7
+ volumes:
8
+ - .:/app
@@ -16,7 +16,8 @@ module Lt
16
16
  def authorizer_for(callback_path)
17
17
  @authorizer_for ||= begin
18
18
  client_id =
19
- ::Google::Auth::ClientId.new(ENV['GOOGLE_OAUTH2_CLIENT_ID'], ENV['GOOGLE_OAUTH2_CLIENT_SECRET'])
19
+ ::Google::Auth::ClientId.new(ENV.fetch('GOOGLE_OAUTH2_CLIENT_ID', nil),
20
+ ENV.fetch('GOOGLE_OAUTH2_CLIENT_SECRET', nil))
20
21
  token_store ||= ::Google::Auth::Stores::RedisTokenStore.new(redis: redis)
21
22
  scope = %w(https://www.googleapis.com/auth/drive)
22
23
  ::Google::Auth::WebUserAuthorizer.new(client_id, scope, token_store, callback_path)
@@ -64,7 +65,11 @@ module Lt
64
65
  end
65
66
 
66
67
  def remove_expired_token
67
- data = JSON(redis.get(user_token)) rescue nil
68
+ data = begin
69
+ ::JSON.parse(redis.get(user_token))
70
+ rescue StandardError
71
+ nil
72
+ end
68
73
  return unless data
69
74
 
70
75
  expires_at = data['expiration_time_millis'].to_i / 1_000
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'google/apis/drive_v3'
4
+
3
5
  module Lt
4
6
  module Google
5
7
  module Api
@@ -97,7 +99,7 @@ module Lt
97
99
  case f.mime_type
98
100
  when mime_type then result << f.id
99
101
  when MIME_FOLDER
100
- result.concat(list_file_ids_in f.id, mime_type: mime_type) if with_subfolders
102
+ result.concat(list_file_ids_in(f.id, mime_type: mime_type)) if with_subfolders
101
103
  end
102
104
  end
103
105
 
@@ -3,7 +3,7 @@
3
3
  module Lt
4
4
  module Google
5
5
  module Api
6
- VERSION = '0.2.4'
6
+ VERSION = '0.3.2'
7
7
  end
8
8
  end
9
9
  end
@@ -7,15 +7,15 @@ require 'lt/google/api/version'
7
7
  Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
8
8
  spec.name = 'lt-google-api'
9
9
  spec.version = Lt::Google::Api::VERSION
10
- spec.authors = ['Alexander Kuznetsov']
11
- spec.email = %w(alexander@learningtapeestry.com paranoic.san@gmail.com)
10
+ spec.authors = ['Alexander Kuznetsov', 'Oksana Melnikova']
11
+ spec.email = %w(paranoic.san@gmail.com oksana.melnikova@gmail.com)
12
12
 
13
13
  spec.homepage = 'https://github.com/learningtapestry/lt-google-api'
14
14
  spec.summary = 'Provides the set of classes to simplify work with Google services'
15
15
  spec.description = ''
16
16
  spec.license = 'Apache-2.0'
17
17
 
18
- spec.required_ruby_version = '>= 2.6'
18
+ spec.required_ruby_version = '>= 2.7'
19
19
 
20
20
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
21
21
  # to allow pushing to a single host or delete this section to allow pushing to any host.
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
23
23
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
24
24
  else
25
25
  raise 'RubyGems 2.0 or newer is required to protect against ' \
26
- 'public gem pushes.'
26
+ 'public gem pushes.'
27
27
  end
28
28
 
29
29
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -33,11 +33,13 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
33
33
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
34
  spec.require_paths = ['lib']
35
35
 
36
- spec.add_dependency 'google-api-client', '~> 0.46'
37
- spec.add_dependency 'googleauth', '~> 0.14'
36
+ spec.add_dependency 'google-apis-drive_v3', '~> 0.63.0'
37
+ spec.add_dependency 'googleauth', '~> 1.11.2'
38
38
 
39
- spec.add_development_dependency 'bundler', '~> 1.16'
39
+ spec.add_development_dependency 'bundler', '~> 2.4'
40
40
  spec.add_development_dependency 'overcommit', '~> 0.57'
41
41
  spec.add_development_dependency 'rake', '~> 13'
42
- spec.add_development_dependency 'rubocop', '~> 0.93.1'
42
+ spec.add_development_dependency 'rubocop', '~> 1'
43
+ spec.add_development_dependency 'steep', '~> 1.5.3'
44
+ spec.metadata['rubygems_mfa_required'] = 'true'
43
45
  end
@@ -0,0 +1,198 @@
1
+ ---
2
+ sources:
3
+ - type: git
4
+ name: ruby/gem_rbs_collection
5
+ revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
6
+ remote: https://github.com/ruby/gem_rbs_collection.git
7
+ repo_dir: gems
8
+ path: ".gem_rbs_collection"
9
+ gems:
10
+ - name: activesupport
11
+ version: '6.0'
12
+ source:
13
+ type: git
14
+ name: ruby/gem_rbs_collection
15
+ revision: 5666e737d2b27a8425b4e3855c1a38cae54989f7
16
+ remote: https://github.com/ruby/gem_rbs_collection.git
17
+ repo_dir: gems
18
+ - name: addressable
19
+ version: '2.8'
20
+ source:
21
+ type: git
22
+ name: ruby/gem_rbs_collection
23
+ revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
24
+ remote: https://github.com/ruby/gem_rbs_collection.git
25
+ repo_dir: gems
26
+ - name: ast
27
+ version: '2.4'
28
+ source:
29
+ type: git
30
+ name: ruby/gem_rbs_collection
31
+ revision: 5666e737d2b27a8425b4e3855c1a38cae54989f7
32
+ remote: https://github.com/ruby/gem_rbs_collection.git
33
+ repo_dir: gems
34
+ - name: base64
35
+ version: '0'
36
+ source:
37
+ type: stdlib
38
+ - name: concurrent-ruby
39
+ version: '1.1'
40
+ source:
41
+ type: git
42
+ name: ruby/gem_rbs_collection
43
+ revision: 5666e737d2b27a8425b4e3855c1a38cae54989f7
44
+ remote: https://github.com/ruby/gem_rbs_collection.git
45
+ repo_dir: gems
46
+ - name: date
47
+ version: '0'
48
+ source:
49
+ type: stdlib
50
+ - name: erb
51
+ version: '0'
52
+ source:
53
+ type: stdlib
54
+ - name: faraday
55
+ version: '2.5'
56
+ source:
57
+ type: git
58
+ name: ruby/gem_rbs_collection
59
+ revision: 5666e737d2b27a8425b4e3855c1a38cae54989f7
60
+ remote: https://github.com/ruby/gem_rbs_collection.git
61
+ repo_dir: gems
62
+ - name: fileutils
63
+ version: '0'
64
+ source:
65
+ type: stdlib
66
+ - name: forwardable
67
+ version: '0'
68
+ source:
69
+ type: stdlib
70
+ - name: httpclient
71
+ version: '2.8'
72
+ source:
73
+ type: git
74
+ name: ruby/gem_rbs_collection
75
+ revision: 5666e737d2b27a8425b4e3855c1a38cae54989f7
76
+ remote: https://github.com/ruby/gem_rbs_collection.git
77
+ repo_dir: gems
78
+ - name: i18n
79
+ version: '1.10'
80
+ source:
81
+ type: git
82
+ name: ruby/gem_rbs_collection
83
+ revision: 5666e737d2b27a8425b4e3855c1a38cae54989f7
84
+ remote: https://github.com/ruby/gem_rbs_collection.git
85
+ repo_dir: gems
86
+ - name: json
87
+ version: '0'
88
+ source:
89
+ type: stdlib
90
+ - name: jwt
91
+ version: '2.5'
92
+ source:
93
+ type: git
94
+ name: ruby/gem_rbs_collection
95
+ revision: 5666e737d2b27a8425b4e3855c1a38cae54989f7
96
+ remote: https://github.com/ruby/gem_rbs_collection.git
97
+ repo_dir: gems
98
+ - name: logger
99
+ version: '0'
100
+ source:
101
+ type: stdlib
102
+ - name: minitest
103
+ version: '0'
104
+ source:
105
+ type: stdlib
106
+ - name: monitor
107
+ version: '0'
108
+ source:
109
+ type: stdlib
110
+ - name: mutex_m
111
+ version: '0'
112
+ source:
113
+ type: stdlib
114
+ - name: parallel
115
+ version: '1.20'
116
+ source:
117
+ type: git
118
+ name: ruby/gem_rbs_collection
119
+ revision: 5666e737d2b27a8425b4e3855c1a38cae54989f7
120
+ remote: https://github.com/ruby/gem_rbs_collection.git
121
+ repo_dir: gems
122
+ - name: parser
123
+ version: '3.2'
124
+ source:
125
+ type: git
126
+ name: ruby/gem_rbs_collection
127
+ revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
128
+ remote: https://github.com/ruby/gem_rbs_collection.git
129
+ repo_dir: gems
130
+ - name: pathname
131
+ version: '0'
132
+ source:
133
+ type: stdlib
134
+ - name: rainbow
135
+ version: '3.0'
136
+ source:
137
+ type: git
138
+ name: ruby/gem_rbs_collection
139
+ revision: 5666e737d2b27a8425b4e3855c1a38cae54989f7
140
+ remote: https://github.com/ruby/gem_rbs_collection.git
141
+ repo_dir: gems
142
+ - name: rake
143
+ version: '13.0'
144
+ source:
145
+ type: git
146
+ name: ruby/gem_rbs_collection
147
+ revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
148
+ remote: https://github.com/ruby/gem_rbs_collection.git
149
+ repo_dir: gems
150
+ - name: regexp_parser
151
+ version: '2.8'
152
+ source:
153
+ type: git
154
+ name: ruby/gem_rbs_collection
155
+ revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
156
+ remote: https://github.com/ruby/gem_rbs_collection.git
157
+ repo_dir: gems
158
+ - name: rubocop
159
+ version: '1.57'
160
+ source:
161
+ type: git
162
+ name: ruby/gem_rbs_collection
163
+ revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
164
+ remote: https://github.com/ruby/gem_rbs_collection.git
165
+ repo_dir: gems
166
+ - name: rubocop-ast
167
+ version: '1.30'
168
+ source:
169
+ type: git
170
+ name: ruby/gem_rbs_collection
171
+ revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
172
+ remote: https://github.com/ruby/gem_rbs_collection.git
173
+ repo_dir: gems
174
+ - name: securerandom
175
+ version: '0'
176
+ source:
177
+ type: stdlib
178
+ - name: singleton
179
+ version: '0'
180
+ source:
181
+ type: stdlib
182
+ - name: thor
183
+ version: '1.2'
184
+ source:
185
+ type: git
186
+ name: ruby/gem_rbs_collection
187
+ revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
188
+ remote: https://github.com/ruby/gem_rbs_collection.git
189
+ repo_dir: gems
190
+ - name: time
191
+ version: '0'
192
+ source:
193
+ type: stdlib
194
+ - name: uri
195
+ version: '0'
196
+ source:
197
+ type: stdlib
198
+ gemfile_lock_path: Gemfile.lock
@@ -0,0 +1,22 @@
1
+ # Download sources
2
+ sources:
3
+ - type: git
4
+ name: ruby/gem_rbs_collection
5
+ remote: https://github.com/ruby/gem_rbs_collection.git
6
+ revision: main
7
+ repo_dir: gems
8
+
9
+ # You can specify local directories as sources also.
10
+ # - type: local
11
+ # path: path/to/your/local/repository
12
+
13
+ # A directory to install the downloaded RBSs
14
+ path: .gem_rbs_collection
15
+
16
+ gems:
17
+ # Skip loading rbs gem's RBS.
18
+ # It's unnecessary if you don't use rbs as a library.
19
+ - name: rbs
20
+ ignore: true
21
+ - name: steep
22
+ ignore: true
@@ -0,0 +1,22 @@
1
+ module Lt
2
+ module Google
3
+ module Api
4
+ module Auth
5
+ class Cli
6
+ self.@authorizer: untyped
7
+
8
+ @credentials: untyped
9
+
10
+ CONFIG_SECRET_FILE: untyped
11
+ CONFIG_TOKEN_FILE: untyped
12
+ SCOPE: ::Array["https://www.googleapis.com/auth/drive" | "https://www.googleapis.com/auth/documents"]
13
+ USER_ID: "default"
14
+
15
+ def self.authorizer: -> untyped
16
+ def authorizer: -> untyped
17
+ def credentials: -> untyped
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,28 @@
1
+ module Lt
2
+ module Google
3
+ module Api
4
+ module Auth
5
+ module Credentials
6
+ interface _ActionController_Redirecting
7
+ def redirect_to: (String | Symbol | untyped options) -> untyped
8
+ end
9
+ include _ActionController_Redirecting
10
+
11
+ @google_auth_options: untyped
12
+ @google_credentials: untyped
13
+ @service: untyped
14
+
15
+ extend ActiveSupport::Concern
16
+
17
+ attr_reader google_credentials: untyped
18
+
19
+ def obtain_google_credentials: (?::Hash[untyped, untyped] options) -> untyped
20
+
21
+ private
22
+
23
+ def service: -> untyped
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,36 @@
1
+ module Lt
2
+ module Google
3
+ module Api
4
+ module Auth
5
+ class Service
6
+ self.@authorizer_for: untyped
7
+
8
+ @context: untyped
9
+ @options: untyped
10
+ @credentials: untyped
11
+ @user_id: untyped
12
+ @user_token: untyped
13
+
14
+ REDIS_PREFIX: "lt-google-api"
15
+
16
+ def self.authorizer_for: (untyped callback_path) -> untyped
17
+ def self.redis: -> untyped
18
+
19
+ attr_reader context: untyped
20
+
21
+ def initialize: (untyped context, ?::Hash[untyped, untyped] options) -> void
22
+ def authorization_url: -> untyped
23
+ def authorizer: -> untyped
24
+ def credentials: -> untyped
25
+ def user_id: -> untyped
26
+
27
+ private
28
+
29
+ def redis: -> untyped
30
+ def remove_expired_token: -> (nil | untyped)
31
+ def user_token: -> untyped
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,30 @@
1
+ module Lt
2
+ module Google
3
+ module Api
4
+ class Drive
5
+ @service: untyped
6
+
7
+ FOLDER_RE: ::Regexp
8
+ MIME_FILE: "application/vnd.google-apps.document"
9
+ MIME_FOLDER: "application/vnd.google-apps.folder"
10
+
11
+ attr_reader service: untyped
12
+
13
+ def self.build: (untyped credentials) -> untyped
14
+ def self.file_url_for: (untyped file_id) -> ::String
15
+ def self.folder_id_for: (untyped url) -> untyped
16
+
17
+ def initialize: (untyped credentials) -> void
18
+ def copy: (untyped file_ids, untyped folder_id) -> untyped
19
+ def copy_files: (untyped folder_id, untyped target_id) -> untyped
20
+ def create_folder: (untyped name, ?untyped? parent_id) -> untyped
21
+ def list_file_ids_in: (untyped folder_id, ?mime_type: untyped, ?with_subfolders: bool) -> untyped
22
+ def fetch_folders: (untyped name, untyped folder_id) -> untyped
23
+
24
+ private
25
+
26
+ def list: (untyped folder_id) -> untyped
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,7 @@
1
+ module Lt
2
+ module Google
3
+ module Api
4
+ VERSION: "0.2.4"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ module Lt
2
+ module Google
3
+ module Api
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,15 @@
1
+ module Google
2
+ module Apis
3
+ # RateLimitError: untyped
4
+
5
+ module DriveV3
6
+ class DriveService
7
+ def initialize: (*untyped?) -> untyped
8
+ end
9
+
10
+ class File
11
+ def initialize: (*untyped?) -> untyped
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,31 @@
1
+ module Google
2
+ module Auth
3
+ class ClientId
4
+ def self.from_file: (*untyped?) -> untyped
5
+ def initialize: (*untyped?) -> untyped
6
+ end
7
+
8
+ class TokenStore
9
+ end
10
+
11
+ class UserAuthorizer
12
+ def initialize: (*untyped?) -> untyped
13
+ end
14
+
15
+ class WebUserAuthorizer
16
+ def initialize: (*untyped?) -> untyped
17
+ end
18
+
19
+ module Stores
20
+ class FileTokenStore
21
+ def initialize: (*untyped?) -> untyped
22
+ end
23
+
24
+ class RedisTokenStore < TokenStore
25
+ DEFAULT_KEY_PREFIX: untyped
26
+
27
+ def initialize: (*untyped?) -> untyped
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,5 @@
1
+ module Rails
2
+ def self.application: -> untyped
3
+ def self.logger: -> untyped
4
+ def self.root: -> untyped
5
+ end
metadata CHANGED
@@ -1,57 +1,58 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lt-google-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kuznetsov
8
- autorequire:
8
+ - Oksana Melnikova
9
+ autorequire:
9
10
  bindir: exe
10
11
  cert_chain: []
11
- date: 2021-07-16 00:00:00.000000000 Z
12
+ date: 2025-06-21 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
- name: google-api-client
15
+ name: google-apis-drive_v3
15
16
  requirement: !ruby/object:Gem::Requirement
16
17
  requirements:
17
18
  - - "~>"
18
19
  - !ruby/object:Gem::Version
19
- version: '0.46'
20
+ version: 0.63.0
20
21
  type: :runtime
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
25
  - - "~>"
25
26
  - !ruby/object:Gem::Version
26
- version: '0.46'
27
+ version: 0.63.0
27
28
  - !ruby/object:Gem::Dependency
28
29
  name: googleauth
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
32
  - - "~>"
32
33
  - !ruby/object:Gem::Version
33
- version: '0.14'
34
+ version: 1.11.2
34
35
  type: :runtime
35
36
  prerelease: false
36
37
  version_requirements: !ruby/object:Gem::Requirement
37
38
  requirements:
38
39
  - - "~>"
39
40
  - !ruby/object:Gem::Version
40
- version: '0.14'
41
+ version: 1.11.2
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: bundler
43
44
  requirement: !ruby/object:Gem::Requirement
44
45
  requirements:
45
46
  - - "~>"
46
47
  - !ruby/object:Gem::Version
47
- version: '1.16'
48
+ version: '2.4'
48
49
  type: :development
49
50
  prerelease: false
50
51
  version_requirements: !ruby/object:Gem::Requirement
51
52
  requirements:
52
53
  - - "~>"
53
54
  - !ruby/object:Gem::Version
54
- version: '1.16'
55
+ version: '2.4'
55
56
  - !ruby/object:Gem::Dependency
56
57
  name: overcommit
57
58
  requirement: !ruby/object:Gem::Requirement
@@ -86,38 +87,56 @@ dependencies:
86
87
  requirements:
87
88
  - - "~>"
88
89
  - !ruby/object:Gem::Version
89
- version: 0.93.1
90
+ version: '1'
90
91
  type: :development
91
92
  prerelease: false
92
93
  version_requirements: !ruby/object:Gem::Requirement
93
94
  requirements:
94
95
  - - "~>"
95
96
  - !ruby/object:Gem::Version
96
- version: 0.93.1
97
+ version: '1'
98
+ - !ruby/object:Gem::Dependency
99
+ name: steep
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: 1.5.3
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: 1.5.3
97
112
  description: ''
98
113
  email:
99
- - alexander@learningtapeestry.com
100
114
  - paranoic.san@gmail.com
115
+ - oksana.melnikova@gmail.com
101
116
  executables: []
102
117
  extensions: []
103
118
  extra_rdoc_files: []
104
119
  files:
105
120
  - ".codeclimate.yml"
106
- - ".github/workflows/rubocop-analysis.yml"
121
+ - ".dockerignore"
122
+ - ".github/workflows/.keep"
107
123
  - ".gitignore"
108
124
  - ".overcommit.yml"
109
125
  - ".rubocop.yml"
110
126
  - ".ruby-gemset"
111
127
  - ".ruby-version"
112
128
  - CHANGELOG.md
129
+ - Dockerfile
113
130
  - Gemfile
114
131
  - Gemfile.lock
115
132
  - LICENSE
116
133
  - README.md
117
134
  - Rakefile
135
+ - Steepfile
118
136
  - bin/console
119
137
  - bin/overcommit
120
138
  - bin/setup
139
+ - docker-compose.yml
121
140
  - lib/lt/google/api.rb
122
141
  - lib/lt/google/api/auth/cli.rb
123
142
  - lib/lt/google/api/auth/credentials.rb
@@ -125,12 +144,24 @@ files:
125
144
  - lib/lt/google/api/drive.rb
126
145
  - lib/lt/google/api/version.rb
127
146
  - lt-google-api.gemspec
147
+ - rbs_collection.lock.yaml
148
+ - rbs_collection.yaml
149
+ - sig/lib/lt/google/api.rbs
150
+ - sig/lib/lt/google/api/auth/cli.rbs
151
+ - sig/lib/lt/google/api/auth/credentials.rbs
152
+ - sig/lib/lt/google/api/auth/service.rbs
153
+ - sig/lib/lt/google/api/drive.rbs
154
+ - sig/lib/lt/google/api/version.rbs
155
+ - sig/polifill/google-api-clients.rbs
156
+ - sig/polifill/googleauth.rbs
157
+ - sig/polifill/rails.rbs
128
158
  homepage: https://github.com/learningtapestry/lt-google-api
129
159
  licenses:
130
160
  - Apache-2.0
131
161
  metadata:
132
162
  allowed_push_host: https://rubygems.org
133
- post_install_message:
163
+ rubygems_mfa_required: 'true'
164
+ post_install_message:
134
165
  rdoc_options: []
135
166
  require_paths:
136
167
  - lib
@@ -138,15 +169,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
169
  requirements:
139
170
  - - ">="
140
171
  - !ruby/object:Gem::Version
141
- version: '2.6'
172
+ version: '2.7'
142
173
  required_rubygems_version: !ruby/object:Gem::Requirement
143
174
  requirements:
144
175
  - - ">="
145
176
  - !ruby/object:Gem::Version
146
177
  version: '0'
147
178
  requirements: []
148
- rubygems_version: 3.2.21
149
- signing_key:
179
+ rubygems_version: 3.1.6
180
+ signing_key:
150
181
  specification_version: 4
151
182
  summary: Provides the set of classes to simplify work with Google services
152
183
  test_files: []
@@ -1,42 +0,0 @@
1
- name: "Rubocop"
2
-
3
- on: pull_request
4
-
5
- jobs:
6
- rubocop:
7
- runs-on: ubuntu-latest
8
- strategy:
9
- fail-fast: false
10
-
11
- steps:
12
- - name: Checkout repository
13
- uses: actions/checkout@v2
14
-
15
- # If running on a self-hosted runner, check it meets the requirements
16
- # listed at https://github.com/ruby/setup-ruby#using-self-hosted-runners
17
- - name: Set up Ruby
18
- uses: ruby/setup-ruby@v1
19
- with:
20
- ruby-version: 2.6
21
-
22
- - name: Intall legacy bundler version
23
- run: gem install bundler -v 1.17.3
24
-
25
- # This step is not necessary if you add the gem to your Gemfile
26
- - name: Install Code Scanning integration
27
- run: bundle _1.17.3_ add code-scanning-rubocop --version 0.4.0 --skip-install
28
-
29
- - name: Install dependencies
30
- run: bundle _1.17.3_ install
31
-
32
- - name: Rubocop run
33
- run: |
34
- bash -c "
35
- bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
36
- [[ $? -ne 2 ]]
37
- "
38
-
39
- - name: Upload Sarif output
40
- uses: github/codeql-action/upload-sarif@v1
41
- with:
42
- sarif_file: rubocop.sarif