lt-lcms 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +15 -0
  3. data/.github/workflows/.keep +0 -0
  4. data/.gitignore +1 -0
  5. data/.overcommit.yml +5 -0
  6. data/.rubocop.yml +5 -2
  7. data/.ruby-version +1 -1
  8. data/CHANGELOG.md +13 -1
  9. data/Dockerfile +17 -0
  10. data/Gemfile.lock +83 -75
  11. data/README.md +26 -0
  12. data/Steepfile +30 -0
  13. data/docker-entrypoint.sh +3 -0
  14. data/lib/lt/lcms/lesson/downloader/base.rb +2 -0
  15. data/lib/lt/lcms/lesson/downloader/gdoc.rb +4 -4
  16. data/lib/lt/lcms/lesson/uploader/gdoc.rb +1 -1
  17. data/lib/lt/lcms/version.rb +1 -1
  18. data/lt-lcms.gemspec +8 -6
  19. data/rbs_collection.lock.yaml +218 -0
  20. data/rbs_collection.yaml +24 -0
  21. data/sig/lt/lcms/lesson/downloader/base.rbs +33 -0
  22. data/sig/lt/lcms/lesson/downloader/gdoc.rbs +34 -0
  23. data/sig/lt/lcms/lesson/downloader/gslide.rbs +19 -0
  24. data/sig/lt/lcms/lesson/downloader/gspreadsheet.rbs +17 -0
  25. data/sig/lt/lcms/lesson/downloader/pdf.rbs +15 -0
  26. data/sig/lt/lcms/lesson/downloader.rbs +8 -0
  27. data/sig/lt/lcms/lesson/uploader/gdoc.rbs +17 -0
  28. data/sig/lt/lcms/version.rbs +5 -0
  29. data/sig/lt/lcms.rbs +4 -0
  30. data/sig/polifill/google-api-client.rbs +5 -0
  31. data/sig/polifill/httparty.rbs +5 -0
  32. data/vendor/rbs/lt-google-api/lib/lt/google/api/auth/cli.rbs +22 -0
  33. data/vendor/rbs/lt-google-api/lib/lt/google/api/auth/credentials.rbs +28 -0
  34. data/vendor/rbs/lt-google-api/lib/lt/google/api/auth/service.rbs +36 -0
  35. data/vendor/rbs/lt-google-api/lib/lt/google/api/drive.rbs +30 -0
  36. data/vendor/rbs/lt-google-api/lib/lt/google/api/version.rbs +7 -0
  37. data/vendor/rbs/lt-google-api/lib/lt/google/api.rbs +6 -0
  38. data/vendor/rbs/lt-google-api/polifill/google-api-clients.rbs +15 -0
  39. data/vendor/rbs/lt-google-api/polifill/googleauth.rbs +31 -0
  40. data/vendor/rbs/lt-google-api/polifill/rails.rbs +5 -0
  41. metadata +61 -20
  42. data/.github/workflows/rubocop-analysis.yml +0 -38
@@ -0,0 +1,218 @@
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: '7.0'
12
+ source:
13
+ type: git
14
+ name: ruby/gem_rbs_collection
15
+ revision: b42e4de88058603a34446942143b3ac197b9685c
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: b42e4de88058603a34446942143b3ac197b9685c
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: date
39
+ version: '0'
40
+ source:
41
+ type: stdlib
42
+ - name: erb
43
+ version: '0'
44
+ source:
45
+ type: stdlib
46
+ - name: faraday
47
+ version: '2.5'
48
+ source:
49
+ type: git
50
+ name: ruby/gem_rbs_collection
51
+ revision: b42e4de88058603a34446942143b3ac197b9685c
52
+ remote: https://github.com/ruby/gem_rbs_collection.git
53
+ repo_dir: gems
54
+ - name: fileutils
55
+ version: '0'
56
+ source:
57
+ type: stdlib
58
+ - name: forwardable
59
+ version: '0'
60
+ source:
61
+ type: stdlib
62
+ - name: httparty
63
+ version: '0.18'
64
+ source:
65
+ type: git
66
+ name: ruby/gem_rbs_collection
67
+ revision: b42e4de88058603a34446942143b3ac197b9685c
68
+ remote: https://github.com/ruby/gem_rbs_collection.git
69
+ repo_dir: gems
70
+ - name: httpclient
71
+ version: '2.8'
72
+ source:
73
+ type: git
74
+ name: ruby/gem_rbs_collection
75
+ revision: b42e4de88058603a34446942143b3ac197b9685c
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: b42e4de88058603a34446942143b3ac197b9685c
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: b42e4de88058603a34446942143b3ac197b9685c
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: net-http
115
+ version: '0'
116
+ source:
117
+ type: stdlib
118
+ - name: nokogiri
119
+ version: '1.11'
120
+ source:
121
+ type: git
122
+ name: ruby/gem_rbs_collection
123
+ revision: b42e4de88058603a34446942143b3ac197b9685c
124
+ remote: https://github.com/ruby/gem_rbs_collection.git
125
+ repo_dir: gems
126
+ - name: parallel
127
+ version: '1.20'
128
+ source:
129
+ type: git
130
+ name: ruby/gem_rbs_collection
131
+ revision: b42e4de88058603a34446942143b3ac197b9685c
132
+ remote: https://github.com/ruby/gem_rbs_collection.git
133
+ repo_dir: gems
134
+ - name: parser
135
+ version: '3.2'
136
+ source:
137
+ type: git
138
+ name: ruby/gem_rbs_collection
139
+ revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
140
+ remote: https://github.com/ruby/gem_rbs_collection.git
141
+ repo_dir: gems
142
+ - name: rainbow
143
+ version: '3.0'
144
+ source:
145
+ type: git
146
+ name: ruby/gem_rbs_collection
147
+ revision: b42e4de88058603a34446942143b3ac197b9685c
148
+ remote: https://github.com/ruby/gem_rbs_collection.git
149
+ repo_dir: gems
150
+ - name: rake
151
+ version: '13.0'
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: regexp_parser
159
+ version: '2.8'
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
167
+ version: '1.57'
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: rubocop-ast
175
+ version: '1.30'
176
+ source:
177
+ type: git
178
+ name: ruby/gem_rbs_collection
179
+ revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
180
+ remote: https://github.com/ruby/gem_rbs_collection.git
181
+ repo_dir: gems
182
+ - name: rubyzip
183
+ version: '2.3'
184
+ source:
185
+ type: git
186
+ name: ruby/gem_rbs_collection
187
+ revision: b42e4de88058603a34446942143b3ac197b9685c
188
+ remote: https://github.com/ruby/gem_rbs_collection.git
189
+ repo_dir: gems
190
+ - name: securerandom
191
+ version: '0'
192
+ source:
193
+ type: stdlib
194
+ - name: singleton
195
+ version: '0'
196
+ source:
197
+ type: stdlib
198
+ - name: thor
199
+ version: '1.2'
200
+ source:
201
+ type: git
202
+ name: ruby/gem_rbs_collection
203
+ revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
204
+ remote: https://github.com/ruby/gem_rbs_collection.git
205
+ repo_dir: gems
206
+ - name: time
207
+ version: '0'
208
+ source:
209
+ type: stdlib
210
+ - name: timeout
211
+ version: '0'
212
+ source:
213
+ type: stdlib
214
+ - name: uri
215
+ version: '0'
216
+ source:
217
+ type: stdlib
218
+ gemfile_lock_path: Gemfile.lock
@@ -0,0 +1,24 @@
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
23
+ - name: concurrent-ruby
24
+ ignore: true
@@ -0,0 +1,33 @@
1
+ module Lt
2
+ module Lcms
3
+ module Lesson
4
+ module Downloader
5
+ class Base
6
+ RETRY_DELAYES: ::Array[untyped]
7
+
8
+ MAX_RETRY_COUNT: untyped
9
+
10
+ MIME_TYPE_EXPORT: "text/plain"
11
+
12
+ def self.file_id_for: (untyped url) -> untyped
13
+
14
+ attr_reader content: untyped
15
+
16
+ def initialize: (untyped credentials, untyped file_url, ?::Hash[untyped, untyped] opts) -> void
17
+
18
+ def download: (?mime_type: untyped) ?{ (untyped) -> untyped } -> untyped
19
+
20
+ def file: () -> untyped
21
+
22
+ def file_id: () -> untyped
23
+
24
+ private
25
+
26
+ attr_reader options: untyped
27
+
28
+ def service: () -> untyped
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,34 @@
1
+ module Lt
2
+ module Lcms
3
+ module Lesson
4
+ module Downloader
5
+ class Gdoc < Base
6
+ GOOGLE_DRAWING_RE: ::Regexp
7
+
8
+ GOOGLE_URL_RE: ::Regexp
9
+
10
+ MIME_TYPE: "application/vnd.google-apps.document"
11
+
12
+ MIME_TYPE_EXPORT: "text/html"
13
+
14
+ def self.gdoc_file_url: (untyped id) -> ::String
15
+
16
+ def download: () -> untyped
17
+
18
+ private
19
+
20
+ attr_reader options: untyped
21
+
22
+ BASE_DPI: ::Float
23
+
24
+ def fix_links: (untyped html) -> untyped
25
+
26
+ def handle_google_drawings: (untyped html) -> untyped
27
+
28
+ # Update drawing url w/h parameters to download in better quality than default 72 dpi
29
+ def updated_drawing_url_for: (untyped url) -> untyped
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,19 @@
1
+ module Lt
2
+ module Lcms
3
+ module Lesson
4
+ module Downloader
5
+ class Gslide < Lt::Lcms::Lesson::Downloader::Base
6
+ MIME_TYPE: "application/vnd.google-apps.presentation"
7
+
8
+ MIME_TYPE_EXPORT: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
9
+
10
+ def self.gdoc_file_url: (untyped id) -> ::String
11
+
12
+ def initialize: (untyped credentials, untyped file_url, ?::Hash[untyped, untyped] opts) -> void
13
+
14
+ def file_id: () -> untyped
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,17 @@
1
+ module Lt
2
+ module Lcms
3
+ module Lesson
4
+ module Downloader
5
+ class Gspreadsheet < Lt::Lcms::Lesson::Downloader::Base
6
+ MIME_TYPE: "application/vnd.google-apps.spreadsheet"
7
+
8
+ MIME_TYPE_EXPORT: "application/x-vnd.oasis.opendocument.spreadsheet"
9
+
10
+ def self.gdoc_file_url: (untyped id) -> ::String
11
+
12
+ def download_sheet: (untyped sheet_name) -> untyped
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ module Lt
2
+ module Lcms
3
+ module Lesson
4
+ module Downloader
5
+ class PDF < Base
6
+ MIME_TYPE: "application/pdf"
7
+
8
+ def self.gdoc_file_url: (untyped id) -> ::String
9
+
10
+ def pdf_content: () -> untyped
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,8 @@
1
+ module Lt
2
+ module Lcms
3
+ module Lesson
4
+ module Downloader
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,17 @@
1
+ module Lt
2
+ module Lcms
3
+ module Lesson
4
+ module Uploader
5
+ class Gdoc
6
+ def initialize: (untyped credentials) -> void
7
+
8
+ def upload: (untyped name, untyped content, untyped content_type, ?untyped? parent_folder_id) -> untyped
9
+
10
+ private
11
+
12
+ def service: () -> untyped
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,5 @@
1
+ module Lt
2
+ module Lcms
3
+ VERSION: "0.5.0"
4
+ end
5
+ end
data/sig/lt/lcms.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Lt
2
+ module Lcms
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module Google
2
+ module Apis
3
+ RateLimitError: untyped
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module HTTParty
2
+ class Response
3
+ def content_type: -> String
4
+ end
5
+ end
@@ -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