lt-google-api 0.2.3 → 0.3.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: 49e7855c5ab40fb80281ba58f130333ad81631cbaa24dd9b5d64b79d40fc8bc8
4
- data.tar.gz: fb1393d24c6a05c168da9cd43bc460a4439424cdbb9f233f86b7df274aca474a
3
+ metadata.gz: 6ef6072dcd14c9155a6862c96e7297c3404bfa4650c0ffa96f3a5a51cfe6fcc2
4
+ data.tar.gz: 84db76b71530c838107cd7299a593ce0cc303746c8137b54a882991ebe845157
5
5
  SHA512:
6
- metadata.gz: cec024f4b0490b44dccaf9232dbebac79c466fab348ac4b0bd16e61b2fbda688c57d32c998938c2abf6c3638ed39fa039ac186706358112c26f31569380f089d
7
- data.tar.gz: 3d100192c9e212ed8046c44b657f8660e42e0a0b839ae57a988c08b060e8ed1ae290e97cbc9469040d09fbd67f399bf768dba73f99674c8ed5e17801c7d1f1ec
6
+ metadata.gz: fb20c295a3d7b200e0f141825e21834d0b04b6d538fea872768cc6586856e0bbda68c3864c7ea59c973aa7ce9640e5400682a9fad9e33fcc4d9089436a23baca
7
+ data.tar.gz: 8e66041fe64bcbfda26cabbce165a608cb2dee3bbf2877879e5e100b8f2c6e21636bf7056019a3299ea93b383e28005d7757b0ccc552f62e806f52cab912a552
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,6 @@
10
10
  # Ignore IDE specific files
11
11
  .idea/
12
12
 
13
+ # Misc
13
14
  .DS_Store
15
+ .gem_rbs_collection/
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.3...HEAD)
7
+ ## [Unreleased](https://github.com/learningtapestry/lt-google-api/compare/v0.3.0...HEAD)
8
+
9
+ ## [0.3.0](https://github.com/learningtapestry/lt-lcms/compare/v0.2.4...v0.3.0) - 2023-12-23
10
+ ### Added
11
+
12
+ - Added Docker support [@paranoicsan](https://github.com/paranoicsan)
13
+ - Added RBS support [@paranoicsan](https://github.com/paranoicsan)
14
+
15
+ ### Changed
16
+
17
+ - Updated dependencies [@paranoicsan](https://github.com/paranoicsan)
18
+ - Ruby updated to 3.2.1 [@paranoicsan](https://github.com/paranoicsan), will be at separate branch ruby-3-upgrade
19
+ - Ruby updated to 2.7.7 [@shlag3n](https://github.com/shlag3n) at the main branch
20
+ - Upgraded google-api to 0.11 [@shlag3n](https://github.com/shlag3n)
21
+
22
+ ## [0.2.4](https://github.com/learningtapestry/lt-lcms/compare/v0.2.3...v0.2.4) - 2021-07-16
23
+
24
+ ### Fixed
25
+
26
+ - Fix for Google Query ([#13](https://github.com/learningtapestry/lt-google-api/pull/13))
8
27
 
9
28
  ## [0.2.3](https://github.com/learningtapestry/lt-lcms/compare/v0.2.2...v0.2.3) - 2021-07-02
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,43 +1,34 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lt-google-api (0.2.3)
5
- google-api-client (~> 0.46)
6
- googleauth (~> 0.14)
4
+ lt-google-api (0.3.0)
5
+ google-apis-drive_v3 (~> 0.46)
6
+ googleauth (~> 1.9)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (6.1.4)
11
+ activesupport (7.0.7.2)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
13
  i18n (>= 1.6, < 2)
14
14
  minitest (>= 5.1)
15
15
  tzinfo (~> 2.0)
16
- zeitwerk (~> 2.3)
17
- addressable (2.7.0)
18
- public_suffix (>= 2.0.2, < 5.0)
16
+ addressable (2.8.6)
17
+ public_suffix (>= 2.0.2, < 6.0)
19
18
  ast (2.4.2)
19
+ base64 (0.1.1)
20
20
  childprocess (4.1.0)
21
- concurrent-ruby (1.1.9)
21
+ concurrent-ruby (1.2.2)
22
+ csv (3.2.7)
22
23
  declarative (0.0.20)
23
- faraday (1.4.3)
24
- faraday-em_http (~> 1.0)
25
- faraday-em_synchrony (~> 1.0)
26
- faraday-excon (~> 1.1)
27
- faraday-net_http (~> 1.0)
28
- faraday-net_http_persistent (~> 1.1)
29
- multipart-post (>= 1.2, < 3)
24
+ faraday (2.7.12)
25
+ base64
26
+ faraday-net_http (>= 2.0, < 3.1)
30
27
  ruby2_keywords (>= 0.0.4)
31
- faraday-em_http (1.0.0)
32
- faraday-em_synchrony (1.0.0)
33
- faraday-excon (1.1.0)
34
- faraday-net_http (1.0.1)
35
- faraday-net_http_persistent (1.1.0)
36
- gems (1.2.0)
37
- google-api-client (0.53.0)
38
- google-apis-core (~> 0.1)
39
- google-apis-generator (~> 0.1)
40
- google-apis-core (0.4.0)
28
+ faraday-net_http (3.0.2)
29
+ ffi (1.15.5)
30
+ fileutils (1.7.1)
31
+ google-apis-core (0.11.2)
41
32
  addressable (~> 2.5, >= 2.5.1)
42
33
  googleauth (>= 0.16.2, < 2.a)
43
34
  httpclient (>= 2.8.1, < 3.a)
@@ -46,85 +37,112 @@ GEM
46
37
  retriable (>= 2.0, < 4.a)
47
38
  rexml
48
39
  webrick
49
- google-apis-discovery_v1 (0.5.0)
50
- google-apis-core (>= 0.3, < 2.a)
51
- google-apis-generator (0.4.0)
52
- activesupport (>= 5.0)
53
- gems (~> 1.2)
54
- google-apis-core (>= 0.4, < 2.a)
55
- google-apis-discovery_v1 (~> 0.5)
56
- thor (>= 0.20, < 2.a)
57
- googleauth (0.16.2)
58
- faraday (>= 0.17.3, < 2.0)
40
+ google-apis-drive_v3 (0.46.0)
41
+ google-apis-core (>= 0.11.0, < 2.a)
42
+ google-cloud-env (2.1.0)
43
+ faraday (>= 1.0, < 3.a)
44
+ googleauth (1.9.1)
45
+ faraday (>= 1.0, < 3.a)
46
+ google-cloud-env (~> 2.1)
59
47
  jwt (>= 1.4, < 3.0)
60
- memoist (~> 0.16)
61
48
  multi_json (~> 1.11)
62
49
  os (>= 0.9, < 2.0)
63
- signet (~> 0.14)
50
+ signet (>= 0.16, < 2.a)
64
51
  httpclient (2.8.3)
65
- i18n (1.8.10)
52
+ i18n (1.14.1)
66
53
  concurrent-ruby (~> 1.0)
67
54
  iniparse (1.5.0)
68
- jwt (2.2.3)
69
- memoist (0.16.2)
70
- mini_mime (1.1.0)
71
- minitest (5.14.4)
55
+ json (2.6.3)
56
+ jwt (2.7.1)
57
+ language_server-protocol (3.17.0.3)
58
+ listen (3.8.0)
59
+ rb-fsevent (~> 0.10, >= 0.10.3)
60
+ rb-inotify (~> 0.9, >= 0.9.10)
61
+ logger (1.5.3)
62
+ mini_mime (1.1.5)
63
+ minitest (5.19.0)
72
64
  multi_json (1.15.0)
73
- multipart-post (2.1.1)
74
- os (1.1.1)
75
- overcommit (0.58.0)
65
+ os (1.1.4)
66
+ overcommit (0.60.0)
76
67
  childprocess (>= 0.6.3, < 5)
77
68
  iniparse (~> 1.4)
78
69
  rexml (~> 3.2)
79
- parallel (1.20.1)
80
- parser (3.0.1.1)
70
+ parallel (1.23.0)
71
+ parser (3.2.2.3)
81
72
  ast (~> 2.4.1)
82
- public_suffix (4.0.6)
83
- rainbow (3.0.0)
84
- rake (13.0.3)
85
- regexp_parser (2.1.1)
86
- representable (3.1.1)
73
+ racc
74
+ public_suffix (5.0.4)
75
+ racc (1.7.1)
76
+ rainbow (3.1.1)
77
+ rake (13.0.6)
78
+ rb-fsevent (0.11.2)
79
+ rb-inotify (0.10.1)
80
+ ffi (~> 1.0)
81
+ rbs (3.1.3)
82
+ regexp_parser (2.8.1)
83
+ representable (3.2.0)
87
84
  declarative (< 0.1.0)
88
85
  trailblazer-option (>= 0.1.1, < 0.2.0)
89
86
  uber (< 0.2.0)
90
87
  retriable (3.1.2)
91
- rexml (3.2.5)
92
- rubocop (0.93.1)
88
+ rexml (3.2.6)
89
+ rubocop (1.56.2)
90
+ base64 (~> 0.1.1)
91
+ json (~> 2.3)
92
+ language_server-protocol (>= 3.17.0)
93
93
  parallel (~> 1.10)
94
- parser (>= 2.7.1.5)
94
+ parser (>= 3.2.2.3)
95
95
  rainbow (>= 2.2.2, < 4.0)
96
- regexp_parser (>= 1.8)
97
- rexml
98
- rubocop-ast (>= 0.6.0)
96
+ regexp_parser (>= 1.8, < 3.0)
97
+ rexml (>= 3.2.5, < 4.0)
98
+ rubocop-ast (>= 1.28.1, < 2.0)
99
99
  ruby-progressbar (~> 1.7)
100
- unicode-display_width (>= 1.4.0, < 2.0)
101
- rubocop-ast (1.7.0)
102
- parser (>= 3.0.1.1)
103
- ruby-progressbar (1.11.0)
104
- ruby2_keywords (0.0.4)
105
- signet (0.15.0)
106
- addressable (~> 2.3)
107
- faraday (>= 0.17.3, < 2.0)
100
+ unicode-display_width (>= 2.4.0, < 3.0)
101
+ rubocop-ast (1.29.0)
102
+ parser (>= 3.2.1.0)
103
+ ruby-progressbar (1.13.0)
104
+ ruby2_keywords (0.0.5)
105
+ securerandom (0.2.2)
106
+ signet (0.18.0)
107
+ addressable (~> 2.8)
108
+ faraday (>= 0.17.5, < 3.a)
108
109
  jwt (>= 1.5, < 3.0)
109
110
  multi_json (~> 1.10)
110
- thor (1.1.0)
111
- trailblazer-option (0.1.1)
112
- tzinfo (2.0.4)
111
+ steep (1.5.3)
112
+ activesupport (>= 5.1)
113
+ concurrent-ruby (>= 1.1.10)
114
+ csv (>= 3.0.9)
115
+ fileutils (>= 1.1.0)
116
+ json (>= 2.1.0)
117
+ language_server-protocol (>= 3.15, < 4.0)
118
+ listen (~> 3.0)
119
+ logger (>= 1.3.0)
120
+ parser (>= 3.1)
121
+ rainbow (>= 2.2.2, < 4.0)
122
+ rbs (>= 3.1.0)
123
+ securerandom (>= 0.1)
124
+ strscan (>= 1.0.0)
125
+ terminal-table (>= 2, < 4)
126
+ strscan (3.0.6)
127
+ terminal-table (3.0.2)
128
+ unicode-display_width (>= 1.1.1, < 3)
129
+ trailblazer-option (0.1.2)
130
+ tzinfo (2.0.6)
113
131
  concurrent-ruby (~> 1.0)
114
132
  uber (0.1.0)
115
- unicode-display_width (1.7.0)
116
- webrick (1.7.0)
117
- zeitwerk (2.4.2)
133
+ unicode-display_width (2.4.2)
134
+ webrick (1.8.1)
118
135
 
119
136
  PLATFORMS
120
- ruby
137
+ x86_64-linux
121
138
 
122
139
  DEPENDENCIES
123
- bundler (~> 1.16)
140
+ bundler (~> 2.4)
124
141
  lt-google-api!
125
142
  overcommit (~> 0.57)
126
143
  rake (~> 13)
127
- rubocop (~> 0.93.1)
144
+ rubocop (~> 1)
145
+ steep (~> 1.5.3)
128
146
 
129
147
  BUNDLED WITH
130
- 1.17.3
148
+ 2.4.22
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 --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
@@ -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,7 @@ module Lt
64
65
  end
65
66
 
66
67
  def remove_expired_token
67
- data = JSON(redis.get(user_token)) rescue nil
68
+ data = ::JSON.parse(redis.get(user_token)) rescue nil
68
69
  return unless data
69
70
 
70
71
  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
@@ -85,7 +87,7 @@ module Lt
85
87
  page_token = nil
86
88
  loop do
87
89
  response = service.list_files(
88
- q: %("#{folder_id}" in parents and trashed = false"),
90
+ q: %("#{folder_id}" in parents and trashed = false),
89
91
  fields: 'files(id, mime_type), nextPageToken',
90
92
  page_token: page_token.to_s,
91
93
  include_items_from_all_drives: true,
@@ -3,7 +3,7 @@
3
3
  module Lt
4
4
  module Google
5
5
  module Api
6
- VERSION = '0.2.3'
6
+ VERSION = '0.3.0'
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.46'
37
+ spec.add_dependency 'googleauth', '~> 1.9'
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,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lt-google-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
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-02 00:00:00.000000000 Z
12
+ date: 2023-12-23 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
  - - "~>"
@@ -30,28 +31,28 @@ dependencies:
30
31
  requirements:
31
32
  - - "~>"
32
33
  - !ruby/object:Gem::Version
33
- version: '0.14'
34
+ version: '1.9'
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.9'
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,35 +87,52 @@ 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
@@ -125,12 +143,24 @@ files:
125
143
  - lib/lt/google/api/drive.rb
126
144
  - lib/lt/google/api/version.rb
127
145
  - lt-google-api.gemspec
146
+ - rbs_collection.lock.yaml
147
+ - rbs_collection.yaml
148
+ - sig/lib/lt/google/api.rbs
149
+ - sig/lib/lt/google/api/auth/cli.rbs
150
+ - sig/lib/lt/google/api/auth/credentials.rbs
151
+ - sig/lib/lt/google/api/auth/service.rbs
152
+ - sig/lib/lt/google/api/drive.rbs
153
+ - sig/lib/lt/google/api/version.rbs
154
+ - sig/polifill/google-api-clients.rbs
155
+ - sig/polifill/googleauth.rbs
156
+ - sig/polifill/rails.rbs
128
157
  homepage: https://github.com/learningtapestry/lt-google-api
129
158
  licenses:
130
159
  - Apache-2.0
131
160
  metadata:
132
161
  allowed_push_host: https://rubygems.org
133
- post_install_message:
162
+ rubygems_mfa_required: 'true'
163
+ post_install_message:
134
164
  rdoc_options: []
135
165
  require_paths:
136
166
  - lib
@@ -138,15 +168,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
168
  requirements:
139
169
  - - ">="
140
170
  - !ruby/object:Gem::Version
141
- version: '2.6'
171
+ version: '2.7'
142
172
  required_rubygems_version: !ruby/object:Gem::Requirement
143
173
  requirements:
144
174
  - - ">="
145
175
  - !ruby/object:Gem::Version
146
176
  version: '0'
147
177
  requirements: []
148
- rubygems_version: 3.0.9
149
- signing_key:
178
+ rubygems_version: 3.0.3.1
179
+ signing_key:
150
180
  specification_version: 4
151
181
  summary: Provides the set of classes to simplify work with Google services
152
182
  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