rbs_shrine 1.0.0 → 1.1.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 +4 -4
- data/.rubocop.yml +4 -0
- data/.vscode/settings.json +2 -1
- data/Steepfile +1 -0
- data/lib/generators/rbs_shrine/install_generator.rb +1 -1
- data/lib/rbs_shrine/rake_task.rb +8 -5
- data/lib/rbs_shrine/shrine.rb +25 -25
- data/lib/rbs_shrine/utils.rb +28 -0
- data/lib/rbs_shrine/version.rb +1 -1
- data/lib/rbs_shrine.rb +1 -0
- data/rbs_collection.lock.yaml +79 -35
- data/sig/generators/rbs_shrine/install_generator.rbs +2 -0
- data/sig/rbs_shrine/rake_task.rbs +9 -1
- data/sig/rbs_shrine/shrine.rbs +12 -1
- data/sig/rbs_shrine/utils.rbs +11 -0
- data/sig/rbs_shrine/version.rbs +5 -0
- data/sig/rbs_shrine.rbs +4 -2
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4915a29bc5824c560fb449a827c22dd836432dd7482e731d97d9c85c05781dd1
|
4
|
+
data.tar.gz: f7df519eb4d94e875d8349c7e34673c20b757bbcc4774c5db567b597ae4ddfb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2de089582c9b63666e3c7ef84d2748f6af7c2a67de581ff8a0729b5e943736184a2e4640c33693a2d46696c554c9f06bd1b43fda3f9caf834044186bd09bd98
|
7
|
+
data.tar.gz: 3f8f783da20ef38c65b5a37531ec3744f2c80dd219dedd348b2dcc5aea5585d9f0acad21cfa12d70b176f31aa5b83d18d3186bbeae380df2390cb4dcaaeded9d
|
data/.rubocop.yml
CHANGED
data/.vscode/settings.json
CHANGED
data/Steepfile
CHANGED
data/lib/rbs_shrine/rake_task.rb
CHANGED
@@ -4,9 +4,12 @@ require "rake/tasklib"
|
|
4
4
|
|
5
5
|
module RbsShrine
|
6
6
|
class RakeTask < Rake::TaskLib
|
7
|
-
attr_accessor :name
|
7
|
+
attr_accessor :name #: Symbol
|
8
|
+
attr_accessor :signature_root_dir #: Pathname
|
8
9
|
|
9
|
-
|
10
|
+
# @rbs name: Symbol
|
11
|
+
# @rbs &block: ?(RakeTask) -> void
|
12
|
+
def initialize(name = :'rbs:shrine', &block) #: void
|
10
13
|
super()
|
11
14
|
|
12
15
|
@name = name
|
@@ -19,21 +22,21 @@ module RbsShrine
|
|
19
22
|
define_setup_task
|
20
23
|
end
|
21
24
|
|
22
|
-
def define_setup_task
|
25
|
+
def define_setup_task #: void
|
23
26
|
desc "Run all tasks of rbs_shrine"
|
24
27
|
|
25
28
|
deps = [:"#{name}:clean", :"#{name}:generate"]
|
26
29
|
task("#{name}:setup" => deps)
|
27
30
|
end
|
28
31
|
|
29
|
-
def define_clean_task
|
32
|
+
def define_clean_task #: void
|
30
33
|
desc "Clean RBS files for shrine models"
|
31
34
|
task "#{name}:clean" do
|
32
35
|
signature_root_dir.rmtree if signature_root_dir.exist?
|
33
36
|
end
|
34
37
|
end
|
35
38
|
|
36
|
-
def define_generate_task
|
39
|
+
def define_generate_task #: void
|
37
40
|
desc "Generate RBS files for shrine models"
|
38
41
|
task("#{name}:generate": :environment) do
|
39
42
|
require "rbs_shrine/shrine" # load RbsShrine lazily
|
data/lib/rbs_shrine/shrine.rb
CHANGED
@@ -1,27 +1,35 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "rbs"
|
4
|
+
require_relative "utils"
|
4
5
|
|
5
6
|
module RbsShrine
|
6
7
|
module Shrine
|
7
|
-
def self.all
|
8
|
+
def self.all #: Array[singleton(ActiveRecord::Base)]
|
8
9
|
ActiveRecord::Base.descendants.select { |model| model.ancestors.any?(::Shrine::Attachment) }
|
9
10
|
end
|
10
11
|
|
11
|
-
|
12
|
+
# @rbs klass: singleton(ActiveRecord::Base)
|
13
|
+
def self.class_to_rbs(klass) #: String
|
12
14
|
Generator.new(klass).generate
|
13
15
|
end
|
14
16
|
|
15
17
|
class Generator
|
16
|
-
|
18
|
+
include Utils
|
17
19
|
|
18
|
-
|
20
|
+
attr_reader :klass #: singleton(ActiveRecord::Base)
|
21
|
+
attr_reader :klass_name #: String
|
22
|
+
|
23
|
+
# @rbs klass: singleton(ActiveRecord::Base)
|
24
|
+
def initialize(klass) #: void
|
19
25
|
@klass = klass
|
20
26
|
@klass_name = klass.name || ""
|
21
27
|
end
|
22
28
|
|
23
|
-
def generate
|
29
|
+
def generate #: String
|
24
30
|
format <<~RBS
|
31
|
+
# resolve-type-names: false
|
32
|
+
|
25
33
|
#{header}
|
26
34
|
#{methods}
|
27
35
|
#{footer}
|
@@ -30,50 +38,42 @@ module RbsShrine
|
|
30
38
|
|
31
39
|
private
|
32
40
|
|
33
|
-
def
|
34
|
-
|
35
|
-
|
36
|
-
RBS::Writer.new(out:).write(parsed[1] + parsed[2])
|
37
|
-
end.string
|
38
|
-
end
|
39
|
-
|
40
|
-
def header
|
41
|
-
namespace = +""
|
42
|
-
klass_name.split("::").map do |mod_name|
|
43
|
-
namespace += "::#{mod_name}"
|
44
|
-
mod_object = Object.const_get(namespace)
|
41
|
+
def header #: String
|
42
|
+
klass_to_names(klass).map do |name|
|
43
|
+
mod_object = Object.const_get(name.to_s)
|
45
44
|
case mod_object
|
46
45
|
when Class
|
47
46
|
# @type var superclass: Class
|
48
47
|
superclass = _ = mod_object.superclass
|
49
48
|
superclass_name = superclass.name || "Object"
|
50
49
|
|
51
|
-
"class #{
|
50
|
+
"class #{name} < ::#{superclass_name}"
|
52
51
|
when Module
|
53
|
-
"module #{
|
52
|
+
"module #{name}"
|
54
53
|
else
|
55
54
|
raise "unreachable"
|
56
55
|
end
|
57
56
|
end.join("\n")
|
58
57
|
end
|
59
58
|
|
60
|
-
def footer
|
59
|
+
def footer #: String
|
61
60
|
"end\n" * klass.module_parents.size
|
62
61
|
end
|
63
62
|
|
64
|
-
def methods
|
63
|
+
def methods #: String
|
65
64
|
attachments.reverse.map do |attachment|
|
66
65
|
name = attachment.attachment_name
|
67
66
|
<<~RBS
|
68
|
-
def #{name}: () -> Shrine::UploadedFile
|
69
|
-
def #{name}=: (IO | String | Hash[untyped, untyped]) -> Shrine::UploadedFile
|
67
|
+
def #{name}: () -> ::Shrine::UploadedFile
|
68
|
+
def #{name}=: (::IO | ::String | ::Hash[untyped, untyped]) -> ::Shrine::UploadedFile
|
69
|
+
def #{name}_attacher: () -> ::Shrine::Attacher
|
70
70
|
def #{name}_changed: () -> bool
|
71
|
-
def #{name}_url: () -> String
|
71
|
+
def #{name}_url: () -> ::String
|
72
72
|
RBS
|
73
73
|
end.join("\n")
|
74
74
|
end
|
75
75
|
|
76
|
-
def attachments
|
76
|
+
def attachments #: Array[::Shrine::Attachment]
|
77
77
|
@klass.ancestors.filter_map { |mod| mod if mod.is_a? ::Shrine::Attachment }
|
78
78
|
end
|
79
79
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rbs"
|
4
|
+
|
5
|
+
module RbsShrine
|
6
|
+
module Utils
|
7
|
+
# @rbs rbs: String
|
8
|
+
def format(rbs) #: String
|
9
|
+
parsed = RBS::Parser.parse_signature(rbs)
|
10
|
+
StringIO.new.tap do |out|
|
11
|
+
RBS::Writer.new(out:).write(parsed[1] + parsed[2])
|
12
|
+
end.string
|
13
|
+
end
|
14
|
+
|
15
|
+
# @rbs klass_name: singleton(Object)
|
16
|
+
def klass_to_names(klass) #: Array[RBS::TypeName]
|
17
|
+
type_name = RBS::TypeName.parse("::#{klass.name}")
|
18
|
+
|
19
|
+
names = [type_name] #: Array[RBS::TypeName]
|
20
|
+
namespace = type_name.namespace
|
21
|
+
until namespace.empty?
|
22
|
+
names << namespace.to_type_name
|
23
|
+
namespace = namespace.parent
|
24
|
+
end
|
25
|
+
names.reverse
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/rbs_shrine/version.rb
CHANGED
data/lib/rbs_shrine.rb
CHANGED
data/rbs_collection.lock.yaml
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
path: ".gem_rbs_collection"
|
3
3
|
gems:
|
4
4
|
- name: actionpack
|
5
|
-
version: '
|
5
|
+
version: '7.2'
|
6
6
|
source:
|
7
7
|
type: git
|
8
8
|
name: ruby/gem_rbs_collection
|
9
|
-
revision:
|
9
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
10
10
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
11
11
|
repo_dir: gems
|
12
12
|
- name: actionview
|
@@ -14,23 +14,23 @@ gems:
|
|
14
14
|
source:
|
15
15
|
type: git
|
16
16
|
name: ruby/gem_rbs_collection
|
17
|
-
revision:
|
17
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
18
18
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
19
19
|
repo_dir: gems
|
20
20
|
- name: activemodel
|
21
|
-
version: '7.
|
21
|
+
version: '7.1'
|
22
22
|
source:
|
23
23
|
type: git
|
24
24
|
name: ruby/gem_rbs_collection
|
25
|
-
revision:
|
25
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
26
26
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
27
27
|
repo_dir: gems
|
28
28
|
- name: activerecord
|
29
|
-
version: '
|
29
|
+
version: '8.0'
|
30
30
|
source:
|
31
31
|
type: git
|
32
32
|
name: ruby/gem_rbs_collection
|
33
|
-
revision:
|
33
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
34
34
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
35
35
|
repo_dir: gems
|
36
36
|
- name: activesupport
|
@@ -38,7 +38,7 @@ gems:
|
|
38
38
|
source:
|
39
39
|
type: git
|
40
40
|
name: ruby/gem_rbs_collection
|
41
|
-
revision:
|
41
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
42
42
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
43
43
|
repo_dir: gems
|
44
44
|
- name: addressable
|
@@ -46,7 +46,7 @@ gems:
|
|
46
46
|
source:
|
47
47
|
type: git
|
48
48
|
name: ruby/gem_rbs_collection
|
49
|
-
revision:
|
49
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
50
50
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
51
51
|
repo_dir: gems
|
52
52
|
- name: ast
|
@@ -54,17 +54,29 @@ gems:
|
|
54
54
|
source:
|
55
55
|
type: git
|
56
56
|
name: ruby/gem_rbs_collection
|
57
|
-
revision:
|
57
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
58
58
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
59
59
|
repo_dir: gems
|
60
60
|
- name: base64
|
61
|
+
version: '0.1'
|
62
|
+
source:
|
63
|
+
type: git
|
64
|
+
name: ruby/gem_rbs_collection
|
65
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
66
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
67
|
+
repo_dir: gems
|
68
|
+
- name: benchmark
|
61
69
|
version: '0'
|
62
70
|
source:
|
63
71
|
type: stdlib
|
64
72
|
- name: bigdecimal
|
65
|
-
version: '
|
73
|
+
version: '3.1'
|
66
74
|
source:
|
67
|
-
type:
|
75
|
+
type: git
|
76
|
+
name: ruby/gem_rbs_collection
|
77
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
78
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
79
|
+
repo_dir: gems
|
68
80
|
- name: cgi
|
69
81
|
version: '0'
|
70
82
|
source:
|
@@ -74,7 +86,7 @@ gems:
|
|
74
86
|
source:
|
75
87
|
type: git
|
76
88
|
name: ruby/gem_rbs_collection
|
77
|
-
revision:
|
89
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
78
90
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
79
91
|
repo_dir: gems
|
80
92
|
- name: connection_pool
|
@@ -82,14 +94,18 @@ gems:
|
|
82
94
|
source:
|
83
95
|
type: git
|
84
96
|
name: ruby/gem_rbs_collection
|
85
|
-
revision:
|
97
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
86
98
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
87
99
|
repo_dir: gems
|
88
100
|
- name: date
|
89
101
|
version: '0'
|
90
102
|
source:
|
91
103
|
type: stdlib
|
92
|
-
- name:
|
104
|
+
- name: delegate
|
105
|
+
version: '0'
|
106
|
+
source:
|
107
|
+
type: stdlib
|
108
|
+
- name: digest
|
93
109
|
version: '0'
|
94
110
|
source:
|
95
111
|
type: stdlib
|
@@ -106,7 +122,7 @@ gems:
|
|
106
122
|
source:
|
107
123
|
type: git
|
108
124
|
name: ruby/gem_rbs_collection
|
109
|
-
revision:
|
125
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
110
126
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
111
127
|
repo_dir: gems
|
112
128
|
- name: io-console
|
@@ -122,9 +138,13 @@ gems:
|
|
122
138
|
source:
|
123
139
|
type: stdlib
|
124
140
|
- name: minitest
|
125
|
-
version: '
|
141
|
+
version: '5.25'
|
126
142
|
source:
|
127
|
-
type:
|
143
|
+
type: git
|
144
|
+
name: ruby/gem_rbs_collection
|
145
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
146
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
147
|
+
repo_dir: gems
|
128
148
|
- name: monitor
|
129
149
|
version: '0'
|
130
150
|
source:
|
@@ -138,9 +158,13 @@ gems:
|
|
138
158
|
source:
|
139
159
|
type: git
|
140
160
|
name: ruby/gem_rbs_collection
|
141
|
-
revision:
|
161
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
142
162
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
143
163
|
repo_dir: gems
|
164
|
+
- name: openssl
|
165
|
+
version: '0'
|
166
|
+
source:
|
167
|
+
type: stdlib
|
144
168
|
- name: optparse
|
145
169
|
version: '0'
|
146
170
|
source:
|
@@ -150,7 +174,7 @@ gems:
|
|
150
174
|
source:
|
151
175
|
type: git
|
152
176
|
name: ruby/gem_rbs_collection
|
153
|
-
revision:
|
177
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
154
178
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
155
179
|
repo_dir: gems
|
156
180
|
- name: parser
|
@@ -158,18 +182,18 @@ gems:
|
|
158
182
|
source:
|
159
183
|
type: git
|
160
184
|
name: ruby/gem_rbs_collection
|
161
|
-
revision:
|
185
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
162
186
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
163
187
|
repo_dir: gems
|
164
188
|
- name: pathname
|
165
189
|
version: '0'
|
166
190
|
source:
|
167
191
|
type: stdlib
|
168
|
-
- name:
|
192
|
+
- name: pp
|
169
193
|
version: '0'
|
170
194
|
source:
|
171
195
|
type: stdlib
|
172
|
-
- name:
|
196
|
+
- name: prettyprint
|
173
197
|
version: '0'
|
174
198
|
source:
|
175
199
|
type: stdlib
|
@@ -178,7 +202,7 @@ gems:
|
|
178
202
|
source:
|
179
203
|
type: git
|
180
204
|
name: ruby/gem_rbs_collection
|
181
|
-
revision:
|
205
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
182
206
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
183
207
|
repo_dir: gems
|
184
208
|
- name: rails-dom-testing
|
@@ -186,7 +210,15 @@ gems:
|
|
186
210
|
source:
|
187
211
|
type: git
|
188
212
|
name: ruby/gem_rbs_collection
|
189
|
-
revision:
|
213
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
214
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
215
|
+
repo_dir: gems
|
216
|
+
- name: rails-html-sanitizer
|
217
|
+
version: '1.6'
|
218
|
+
source:
|
219
|
+
type: git
|
220
|
+
name: ruby/gem_rbs_collection
|
221
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
190
222
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
191
223
|
repo_dir: gems
|
192
224
|
- name: railties
|
@@ -194,7 +226,7 @@ gems:
|
|
194
226
|
source:
|
195
227
|
type: git
|
196
228
|
name: ruby/gem_rbs_collection
|
197
|
-
revision:
|
229
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
198
230
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
199
231
|
repo_dir: gems
|
200
232
|
- name: rainbow
|
@@ -202,7 +234,7 @@ gems:
|
|
202
234
|
source:
|
203
235
|
type: git
|
204
236
|
name: ruby/gem_rbs_collection
|
205
|
-
revision:
|
237
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
206
238
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
207
239
|
repo_dir: gems
|
208
240
|
- name: rake
|
@@ -210,11 +242,11 @@ gems:
|
|
210
242
|
source:
|
211
243
|
type: git
|
212
244
|
name: ruby/gem_rbs_collection
|
213
|
-
revision:
|
245
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
214
246
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
215
247
|
repo_dir: gems
|
216
248
|
- name: rbs
|
217
|
-
version: 3.
|
249
|
+
version: 3.9.0
|
218
250
|
source:
|
219
251
|
type: rubygems
|
220
252
|
- name: rdoc
|
@@ -226,7 +258,7 @@ gems:
|
|
226
258
|
source:
|
227
259
|
type: git
|
228
260
|
name: ruby/gem_rbs_collection
|
229
|
-
revision:
|
261
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
230
262
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
231
263
|
repo_dir: gems
|
232
264
|
- name: rubocop
|
@@ -234,7 +266,7 @@ gems:
|
|
234
266
|
source:
|
235
267
|
type: git
|
236
268
|
name: ruby/gem_rbs_collection
|
237
|
-
revision:
|
269
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
238
270
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
239
271
|
repo_dir: gems
|
240
272
|
- name: rubocop-ast
|
@@ -242,7 +274,7 @@ gems:
|
|
242
274
|
source:
|
243
275
|
type: git
|
244
276
|
name: ruby/gem_rbs_collection
|
245
|
-
revision:
|
277
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
246
278
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
247
279
|
repo_dir: gems
|
248
280
|
- name: securerandom
|
@@ -254,14 +286,18 @@ gems:
|
|
254
286
|
source:
|
255
287
|
type: git
|
256
288
|
name: ruby/gem_rbs_collection
|
257
|
-
revision:
|
289
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
258
290
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
259
291
|
repo_dir: gems
|
260
292
|
- name: singleton
|
261
293
|
version: '0'
|
262
294
|
source:
|
263
295
|
type: stdlib
|
264
|
-
- name:
|
296
|
+
- name: socket
|
297
|
+
version: '0'
|
298
|
+
source:
|
299
|
+
type: stdlib
|
300
|
+
- name: stringio
|
265
301
|
version: '0'
|
266
302
|
source:
|
267
303
|
type: stdlib
|
@@ -274,7 +310,7 @@ gems:
|
|
274
310
|
source:
|
275
311
|
type: git
|
276
312
|
name: ruby/gem_rbs_collection
|
277
|
-
revision:
|
313
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
278
314
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
279
315
|
repo_dir: gems
|
280
316
|
- name: time
|
@@ -289,6 +325,14 @@ gems:
|
|
289
325
|
version: '0'
|
290
326
|
source:
|
291
327
|
type: stdlib
|
328
|
+
- name: tzinfo
|
329
|
+
version: '2.0'
|
330
|
+
source:
|
331
|
+
type: git
|
332
|
+
name: ruby/gem_rbs_collection
|
333
|
+
revision: 3a1e2f1a9163afb35ef518b0ad67ab7f18c37b5a
|
334
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
335
|
+
repo_dir: gems
|
292
336
|
- name: uri
|
293
337
|
version: '0'
|
294
338
|
source:
|
@@ -1,11 +1,19 @@
|
|
1
|
+
# Generated from lib/rbs_shrine/rake_task.rb with RBS::Inline
|
2
|
+
|
1
3
|
module RbsShrine
|
2
4
|
class RakeTask < Rake::TaskLib
|
3
5
|
attr_accessor name: Symbol
|
6
|
+
|
4
7
|
attr_accessor signature_root_dir: Pathname
|
5
8
|
|
6
|
-
|
9
|
+
# @rbs name: Symbol
|
10
|
+
# @rbs &block: ?(RakeTask) -> void
|
11
|
+
def initialize: (?Symbol name) ?{ (RakeTask) -> void } -> void
|
12
|
+
|
7
13
|
def define_setup_task: () -> void
|
14
|
+
|
8
15
|
def define_clean_task: () -> void
|
16
|
+
|
9
17
|
def define_generate_task: () -> void
|
10
18
|
end
|
11
19
|
end
|
data/sig/rbs_shrine/shrine.rbs
CHANGED
@@ -1,21 +1,32 @@
|
|
1
|
+
# Generated from lib/rbs_shrine/shrine.rb with RBS::Inline
|
2
|
+
|
1
3
|
module RbsShrine
|
2
4
|
module Shrine
|
3
5
|
def self.all: () -> Array[singleton(ActiveRecord::Base)]
|
6
|
+
|
7
|
+
# @rbs klass: singleton(ActiveRecord::Base)
|
4
8
|
def self.class_to_rbs: (singleton(ActiveRecord::Base) klass) -> String
|
5
9
|
|
6
10
|
class Generator
|
11
|
+
include Utils
|
12
|
+
|
7
13
|
attr_reader klass: singleton(ActiveRecord::Base)
|
14
|
+
|
8
15
|
attr_reader klass_name: String
|
9
16
|
|
17
|
+
# @rbs klass: singleton(ActiveRecord::Base)
|
10
18
|
def initialize: (singleton(ActiveRecord::Base) klass) -> void
|
19
|
+
|
11
20
|
def generate: () -> String
|
12
21
|
|
13
22
|
private
|
14
23
|
|
15
|
-
def format: (String rbs) -> String
|
16
24
|
def header: () -> String
|
25
|
+
|
17
26
|
def footer: () -> String
|
27
|
+
|
18
28
|
def methods: () -> String
|
29
|
+
|
19
30
|
def attachments: () -> Array[::Shrine::Attachment]
|
20
31
|
end
|
21
32
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Generated from lib/rbs_shrine/utils.rb with RBS::Inline
|
2
|
+
|
3
|
+
module RbsShrine
|
4
|
+
module Utils
|
5
|
+
# @rbs rbs: String
|
6
|
+
def format: (String rbs) -> String
|
7
|
+
|
8
|
+
# @rbs klass_name: singleton(Object)
|
9
|
+
def klass_to_names: (untyped klass) -> Array[RBS::TypeName]
|
10
|
+
end
|
11
|
+
end
|
data/sig/rbs_shrine.rbs
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbs_shrine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takeshi KOMIYA
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- lib/rbs_shrine.rb
|
86
86
|
- lib/rbs_shrine/rake_task.rb
|
87
87
|
- lib/rbs_shrine/shrine.rb
|
88
|
+
- lib/rbs_shrine/utils.rb
|
88
89
|
- lib/rbs_shrine/version.rb
|
89
90
|
- rbs_collection.lock.yaml
|
90
91
|
- rbs_collection.yaml
|
@@ -93,6 +94,8 @@ files:
|
|
93
94
|
- sig/rbs_shrine.rbs
|
94
95
|
- sig/rbs_shrine/rake_task.rbs
|
95
96
|
- sig/rbs_shrine/shrine.rbs
|
97
|
+
- sig/rbs_shrine/utils.rbs
|
98
|
+
- sig/rbs_shrine/version.rbs
|
96
99
|
homepage: https://github.com/tk0miya/rbs_shrine
|
97
100
|
licenses:
|
98
101
|
- MIT
|
@@ -100,7 +103,7 @@ metadata:
|
|
100
103
|
homepage_uri: https://github.com/tk0miya/rbs_shrine
|
101
104
|
source_code_uri: https://github.com/tk0miya/rbs_shrine
|
102
105
|
changelog_uri: https://github.com/tk0miya/rbs_shrine
|
103
|
-
post_install_message:
|
106
|
+
post_install_message:
|
104
107
|
rdoc_options: []
|
105
108
|
require_paths:
|
106
109
|
- lib
|
@@ -115,8 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
118
|
- !ruby/object:Gem::Version
|
116
119
|
version: '0'
|
117
120
|
requirements: []
|
118
|
-
rubygems_version: 3.5.
|
119
|
-
signing_key:
|
121
|
+
rubygems_version: 3.5.22
|
122
|
+
signing_key:
|
120
123
|
specification_version: 4
|
121
124
|
summary: A RBS files generator for shrine gem
|
122
125
|
test_files: []
|