rbs_heuristic_prototype 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/Gemfile.lock +7 -7
- data/README.md +6 -3
- data/Steepfile +2 -3
- data/lib/generators/rbs_heuristic_prototype/install_generator.rb +1 -1
- data/lib/rbs_heuristic_prototype/filters/active_model_validations_filter.rb +9 -4
- data/lib/rbs_heuristic_prototype/filters/base.rb +3 -2
- data/lib/rbs_heuristic_prototype/filters/deep_module_filter.rb +90 -0
- data/lib/rbs_heuristic_prototype/filters/symbol_array_constants_filter.rb +2 -4
- data/lib/rbs_heuristic_prototype/rake_task.rb +1 -0
- data/lib/rbs_heuristic_prototype/version.rb +1 -1
- data/lib/rbs_heuristic_prototype.rb +1 -0
- data/rbs_collection.lock.yaml +20 -16
- data/sig/rbs_heuristic_prototype/filters/active_model_validations_filter.rbs +3 -1
- data/sig/rbs_heuristic_prototype/filters/base.rbs +1 -1
- data/sig/rbs_heuristic_prototype/filters/deep_module_filter.rbs +15 -0
- data/sig/rbs_heuristic_prototype/filters/symbol_array_constants_filter.rbs +5 -5
- data/sig/shims/active_model.rbs +5 -0
- data/sig/shims/thor.rbs +5 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a959d3a8d268d1bf8392251cfb4842beb01c5e6d3da0edc6f7bcc6d6927b886c
|
4
|
+
data.tar.gz: a4d88cd1eb8409d6928b9d2f472d9fbfe0d6035b0d08a74f5e6884f73e5cbd87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c78ccdeb69f4014349df67263be3ca63dbeca09884837260e42565926e357d2e14197b2b2bdc676096d3879c5cfd661cc51998238df7630317c11e7954bdc7ef
|
7
|
+
data.tar.gz: 4bfa69e3b3bf36c16bdb5f1a3ef8e18446f0cd91e09b056b1e6d5f70de564ec8b06d7134ce7dd9842dbf883cb45b4c0c7b7b009ac1839758e7874163a3f06d07
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rbs_heuristic_prototype (0.
|
4
|
+
rbs_heuristic_prototype (0.3.0)
|
5
5
|
rbs
|
6
6
|
|
7
7
|
GEM
|
@@ -35,7 +35,7 @@ GEM
|
|
35
35
|
coderay (1.1.3)
|
36
36
|
concurrent-ruby (1.2.2)
|
37
37
|
crass (1.0.6)
|
38
|
-
csv (3.2.
|
38
|
+
csv (3.2.7)
|
39
39
|
diff-lcs (1.5.0)
|
40
40
|
erubi (1.12.0)
|
41
41
|
ffi (1.15.5)
|
@@ -87,7 +87,7 @@ GEM
|
|
87
87
|
rb-fsevent (0.11.2)
|
88
88
|
rb-inotify (0.10.1)
|
89
89
|
ffi (~> 1.0)
|
90
|
-
rbs (3.1.
|
90
|
+
rbs (3.1.1)
|
91
91
|
regexp_parser (2.8.1)
|
92
92
|
rexml (3.2.5)
|
93
93
|
rspec (3.12.0)
|
@@ -106,7 +106,7 @@ GEM
|
|
106
106
|
diff-lcs (>= 1.2.0, < 2.0)
|
107
107
|
rspec-support (~> 3.12.0)
|
108
108
|
rspec-support (3.12.0)
|
109
|
-
rubocop (1.54.
|
109
|
+
rubocop (1.54.2)
|
110
110
|
json (~> 2.3)
|
111
111
|
language_server-protocol (>= 3.17.0)
|
112
112
|
parallel (~> 1.10)
|
@@ -121,9 +121,9 @@ GEM
|
|
121
121
|
parser (>= 3.2.1.0)
|
122
122
|
ruby-progressbar (1.13.0)
|
123
123
|
securerandom (0.2.2)
|
124
|
-
steep (1.
|
124
|
+
steep (1.5.1)
|
125
125
|
activesupport (>= 5.1)
|
126
|
-
concurrent-ruby (>= 1.
|
126
|
+
concurrent-ruby (>= 1.1.10)
|
127
127
|
csv (>= 3.0.9)
|
128
128
|
fileutils (>= 1.1.0)
|
129
129
|
json (>= 2.1.0)
|
@@ -132,7 +132,7 @@ GEM
|
|
132
132
|
logger (>= 1.3.0)
|
133
133
|
parser (>= 3.1)
|
134
134
|
rainbow (>= 2.2.2, < 4.0)
|
135
|
-
rbs (>=
|
135
|
+
rbs (>= 3.1.0)
|
136
136
|
securerandom (>= 0.1)
|
137
137
|
strscan (>= 1.0.0)
|
138
138
|
terminal-table (>= 2, < 4)
|
data/README.md
CHANGED
@@ -29,7 +29,7 @@ gems:
|
|
29
29
|
## Usage
|
30
30
|
|
31
31
|
1. Run `rbs prototype rb` or `rbs prototype runtime` first
|
32
|
-
2. Run `rbs:prototype:heuristic`
|
32
|
+
2. Run `rbs:prototype:heuristic:apply`
|
33
33
|
|
34
34
|
Then rbs_heuristic_prototype will update the prototype signature files generated
|
35
35
|
by `rbs prototype` according to the heuristic rules.
|
@@ -40,6 +40,11 @@ by `rbs prototype` according to the heuristic rules.
|
|
40
40
|
* Convert a constant annotated with Array of Union of symbols (ex. `Array[:sym1 | :sym2 | ...]`) to a constant annotated with `Array[Symbol]`
|
41
41
|
* This is useful to avoid `Ruby::IncompatibleAssignment` warning when right hand value uses `#freeze` method
|
42
42
|
* ref: https://github.com/soutaro/steep/issues/363
|
43
|
+
* Rule 3:
|
44
|
+
* Convert a callback method of ActiveModel subclass to a method returning "void" (ex. `before_save` callback)
|
45
|
+
* Rule 4:
|
46
|
+
* Convert a scoped module/class definition (ex. `Foo::Bar::Baz`) to the nested definitions
|
47
|
+
* This is useful to define intermediate modules automatically like what Rails and zeitwerk does.
|
43
48
|
|
44
49
|
## Development
|
45
50
|
|
@@ -64,7 +69,5 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
64
69
|
|
65
70
|
## Code of Conduct
|
66
71
|
|
67
|
-
|
68
|
-
|
69
72
|
Everyone interacting in the RbsHeuristicPrototype project's codebases, issue trackers is
|
70
73
|
expected to follow the [code of conduct](https://github.com/tk0miya/rbs_heuristic_prototype/blob/main/CODE_OF_CONDUCT.md).
|
data/Steepfile
CHANGED
@@ -5,8 +5,7 @@ D = Steep::Diagnostic
|
|
5
5
|
target :lib do
|
6
6
|
signature "sig"
|
7
7
|
|
8
|
-
check "lib"
|
9
|
-
check "Gemfile" # File name
|
8
|
+
check "lib"
|
10
9
|
|
11
|
-
configure_code_diagnostics(D::Ruby.lenient)
|
10
|
+
configure_code_diagnostics(D::Ruby.lenient)
|
12
11
|
end
|
@@ -7,7 +7,7 @@ module RbsHeuristicPrototype
|
|
7
7
|
def create_raketask
|
8
8
|
create_file "lib/tasks/rbs_heuristic_prototype.rake", <<~RUBY
|
9
9
|
begin
|
10
|
-
require 'rbs_heuristic_prototype
|
10
|
+
require 'rbs_heuristic_prototype'
|
11
11
|
RbsHeuristicPrototype::RakeTask.new
|
12
12
|
rescue LoadError
|
13
13
|
# failed to load rbs_heuristic_prototype. Skip to load rbs_heuristic_prototype tasks.
|
@@ -8,11 +8,16 @@ module RbsHeuristicPrototype
|
|
8
8
|
attr_reader :klass
|
9
9
|
|
10
10
|
def process_class(decl)
|
11
|
-
|
11
|
+
klass = const_get(decl)
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
if klass&.ancestors&.include?(ActiveModel::Validations)
|
14
|
+
@klass = klass
|
15
|
+
super
|
16
|
+
else
|
17
|
+
decl
|
18
|
+
end
|
19
|
+
ensure
|
20
|
+
@klass = nil
|
16
21
|
end
|
17
22
|
|
18
23
|
def process_member(member)
|
@@ -84,8 +84,9 @@ module RbsHeuristicPrototype
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def const_get(decl)
|
87
|
-
|
88
|
-
|
87
|
+
init = Kernel # : singleton(Class)?
|
88
|
+
decl.name.to_namespace.path.inject(init) do |const, mod|
|
89
|
+
const&.const_get(mod)
|
89
90
|
end
|
90
91
|
rescue StandardError
|
91
92
|
nil
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "base"
|
4
|
+
|
5
|
+
module RbsHeuristicPrototype
|
6
|
+
module Filters
|
7
|
+
class DeepModuleFilter < Base
|
8
|
+
attr_reader :stack
|
9
|
+
|
10
|
+
def initialize(env)
|
11
|
+
super
|
12
|
+
@stack = [::Kernel]
|
13
|
+
end
|
14
|
+
|
15
|
+
def process_module(decl) # rubocop:disable Metrics/AbcSize
|
16
|
+
if decl.name.namespace.empty?
|
17
|
+
namespaces = []
|
18
|
+
stack << const_get(decl)
|
19
|
+
super
|
20
|
+
else
|
21
|
+
namespaces = namespace_to_decl!(decl.name.namespace)
|
22
|
+
decl = decl.dup
|
23
|
+
decl.instance_eval { @name = RBS::TypeName.new(name: name.name, namespace: RBS::Namespace.empty) }
|
24
|
+
(_ = namespaces.last).members << super
|
25
|
+
namespaces.first or raise
|
26
|
+
end
|
27
|
+
ensure
|
28
|
+
namespaces.size.succ.times { stack.pop }
|
29
|
+
end
|
30
|
+
|
31
|
+
def process_class(decl) # rubocop:disable Metrics/AbcSize
|
32
|
+
if decl.name.namespace.empty?
|
33
|
+
namespaces = []
|
34
|
+
stack << const_get(decl)
|
35
|
+
super
|
36
|
+
else
|
37
|
+
namespaces = namespace_to_decl!(decl.name.namespace)
|
38
|
+
decl = decl.dup
|
39
|
+
decl.instance_eval { @name = RBS::TypeName.new(name: name.name, namespace: RBS::Namespace.empty) }
|
40
|
+
stack << stack.last&.const_get(decl.name.name)
|
41
|
+
(_ = namespaces.last).members << super
|
42
|
+
namespaces.first or raise
|
43
|
+
end
|
44
|
+
ensure
|
45
|
+
namespaces.size.succ.times { stack.pop }
|
46
|
+
end
|
47
|
+
|
48
|
+
def namespace_to_decl!(namespace)
|
49
|
+
namespaces = []
|
50
|
+
namespace.path.each do |path|
|
51
|
+
obj = stack.last&.const_get(path)
|
52
|
+
stack << obj
|
53
|
+
decl = obj_to_decl(obj)
|
54
|
+
namespaces.last.members << decl unless namespaces.empty?
|
55
|
+
namespaces << decl
|
56
|
+
end
|
57
|
+
namespaces
|
58
|
+
end
|
59
|
+
|
60
|
+
def obj_to_decl(obj) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
61
|
+
if obj.is_a?(Class)
|
62
|
+
if (superclass = obj.superclass)
|
63
|
+
super_class = RBS::AST::Declarations::Class::Super.new(name: TypeName(superclass.name.to_s),
|
64
|
+
args: [],
|
65
|
+
location: nil)
|
66
|
+
end
|
67
|
+
RBS::AST::Declarations::Class.new(
|
68
|
+
name: TypeName(obj.name.to_s.split("::").last.to_s),
|
69
|
+
type_params: [],
|
70
|
+
super_class:,
|
71
|
+
members: [],
|
72
|
+
annotations: [],
|
73
|
+
location: nil,
|
74
|
+
comment: nil
|
75
|
+
)
|
76
|
+
else
|
77
|
+
RBS::AST::Declarations::Module.new(
|
78
|
+
name: TypeName(obj.name.to_s.split("::").last.to_s),
|
79
|
+
type_params: [],
|
80
|
+
members: [],
|
81
|
+
self_types: [],
|
82
|
+
annotations: [],
|
83
|
+
location: nil,
|
84
|
+
comment: nil
|
85
|
+
)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -19,11 +19,9 @@ module RbsHeuristicPrototype
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def process_constant_type(type)
|
22
|
-
# @type var location: untyped
|
23
22
|
name = RBS::TypeName.new(namespace: RBS::Namespace.root, name: :Symbol)
|
24
|
-
|
25
|
-
|
26
|
-
RBS::Types::ClassInstance.new(name: type.name, args: [symbol], location:)
|
23
|
+
symbol = RBS::Types::Alias.new(name:, args: [], location: type.location)
|
24
|
+
RBS::Types::ClassInstance.new(name: type.name, args: [symbol], location: type.location)
|
27
25
|
end
|
28
26
|
|
29
27
|
def symbol_array?(type)
|
@@ -9,6 +9,7 @@ module RbsHeuristicPrototype
|
|
9
9
|
FILTERS = {
|
10
10
|
active_model_validations: Filters::ActiveModelValidationsFilter,
|
11
11
|
boolean_methods: Filters::BooleanMethodsFilter,
|
12
|
+
deep_module: Filters::DeepModuleFilter,
|
12
13
|
symbol_array_constants: Filters::SymbolArrayConstantsFilter
|
13
14
|
}.freeze
|
14
15
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative "rbs_heuristic_prototype/filters/active_model_validations_filter"
|
4
4
|
require_relative "rbs_heuristic_prototype/filters/boolean_methods_filter"
|
5
|
+
require_relative "rbs_heuristic_prototype/filters/deep_module_filter"
|
5
6
|
require_relative "rbs_heuristic_prototype/filters/symbol_array_constants_filter"
|
6
7
|
require_relative "rbs_heuristic_prototype/rake_task"
|
7
8
|
require_relative "rbs_heuristic_prototype/version"
|
data/rbs_collection.lock.yaml
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
sources:
|
3
3
|
- type: git
|
4
4
|
name: ruby/gem_rbs_collection
|
5
|
-
revision:
|
5
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
6
6
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
7
7
|
repo_dir: gems
|
8
8
|
path: ".gem_rbs_collection"
|
@@ -16,7 +16,7 @@ gems:
|
|
16
16
|
source:
|
17
17
|
type: git
|
18
18
|
name: ruby/gem_rbs_collection
|
19
|
-
revision:
|
19
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
20
20
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
21
21
|
repo_dir: gems
|
22
22
|
- name: actionview
|
@@ -24,7 +24,7 @@ gems:
|
|
24
24
|
source:
|
25
25
|
type: git
|
26
26
|
name: ruby/gem_rbs_collection
|
27
|
-
revision:
|
27
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
28
28
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
29
29
|
repo_dir: gems
|
30
30
|
- name: activemodel
|
@@ -32,7 +32,7 @@ gems:
|
|
32
32
|
source:
|
33
33
|
type: git
|
34
34
|
name: ruby/gem_rbs_collection
|
35
|
-
revision:
|
35
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
36
36
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
37
37
|
repo_dir: gems
|
38
38
|
- name: activerecord
|
@@ -40,7 +40,7 @@ gems:
|
|
40
40
|
source:
|
41
41
|
type: git
|
42
42
|
name: ruby/gem_rbs_collection
|
43
|
-
revision:
|
43
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
44
44
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
45
45
|
repo_dir: gems
|
46
46
|
- name: activesupport
|
@@ -48,7 +48,7 @@ gems:
|
|
48
48
|
source:
|
49
49
|
type: git
|
50
50
|
name: ruby/gem_rbs_collection
|
51
|
-
revision:
|
51
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
52
52
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
53
53
|
repo_dir: gems
|
54
54
|
- name: ast
|
@@ -56,7 +56,7 @@ gems:
|
|
56
56
|
source:
|
57
57
|
type: git
|
58
58
|
name: ruby/gem_rbs_collection
|
59
|
-
revision:
|
59
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
60
60
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
61
61
|
repo_dir: gems
|
62
62
|
- name: cgi
|
@@ -68,7 +68,7 @@ gems:
|
|
68
68
|
source:
|
69
69
|
type: git
|
70
70
|
name: ruby/gem_rbs_collection
|
71
|
-
revision:
|
71
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
72
72
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
73
73
|
repo_dir: gems
|
74
74
|
- name: date
|
@@ -80,7 +80,7 @@ gems:
|
|
80
80
|
source:
|
81
81
|
type: git
|
82
82
|
name: ruby/gem_rbs_collection
|
83
|
-
revision:
|
83
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
84
84
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
85
85
|
repo_dir: gems
|
86
86
|
- name: json
|
@@ -108,7 +108,7 @@ gems:
|
|
108
108
|
source:
|
109
109
|
type: git
|
110
110
|
name: ruby/gem_rbs_collection
|
111
|
-
revision:
|
111
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
112
112
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
113
113
|
repo_dir: gems
|
114
114
|
- name: optparse
|
@@ -120,7 +120,7 @@ gems:
|
|
120
120
|
source:
|
121
121
|
type: git
|
122
122
|
name: ruby/gem_rbs_collection
|
123
|
-
revision:
|
123
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
124
124
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
125
125
|
repo_dir: gems
|
126
126
|
- name: pathname
|
@@ -132,7 +132,7 @@ gems:
|
|
132
132
|
source:
|
133
133
|
type: git
|
134
134
|
name: ruby/gem_rbs_collection
|
135
|
-
revision:
|
135
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
136
136
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
137
137
|
repo_dir: gems
|
138
138
|
- name: rails-dom-testing
|
@@ -140,7 +140,7 @@ gems:
|
|
140
140
|
source:
|
141
141
|
type: git
|
142
142
|
name: ruby/gem_rbs_collection
|
143
|
-
revision:
|
143
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
144
144
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
145
145
|
repo_dir: gems
|
146
146
|
- name: railties
|
@@ -148,7 +148,7 @@ gems:
|
|
148
148
|
source:
|
149
149
|
type: git
|
150
150
|
name: ruby/gem_rbs_collection
|
151
|
-
revision:
|
151
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
152
152
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
153
153
|
repo_dir: gems
|
154
154
|
- name: rainbow
|
@@ -156,17 +156,21 @@ gems:
|
|
156
156
|
source:
|
157
157
|
type: git
|
158
158
|
name: ruby/gem_rbs_collection
|
159
|
-
revision:
|
159
|
+
revision: aeede7258d020bfd509541e0c8075ce833292409
|
160
160
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
161
161
|
repo_dir: gems
|
162
162
|
- name: rbs
|
163
|
-
version: 3.1.
|
163
|
+
version: 3.1.1
|
164
164
|
source:
|
165
165
|
type: rubygems
|
166
166
|
- name: rdoc
|
167
167
|
version: '0'
|
168
168
|
source:
|
169
169
|
type: stdlib
|
170
|
+
- name: securerandom
|
171
|
+
version: '0'
|
172
|
+
source:
|
173
|
+
type: stdlib
|
170
174
|
- name: singleton
|
171
175
|
version: '0'
|
172
176
|
source:
|
@@ -1,7 +1,9 @@
|
|
1
1
|
module RbsHeuristicPrototype
|
2
2
|
module Filters
|
3
3
|
class ActiveModelValidationsFilter < Base
|
4
|
-
|
4
|
+
attr_reader klass: singleton(ActiveModel::Validations)?
|
5
|
+
|
6
|
+
@klass: singleton(ActiveModel::Validations)?
|
5
7
|
|
6
8
|
def process_class: (RBS::AST::Declarations::Class decl) -> RBS::AST::Declarations::Class
|
7
9
|
def process_member: (RBS::AST::Members::t member) -> RBS::AST::Members::t
|
@@ -10,7 +10,7 @@ module RbsHeuristicPrototype
|
|
10
10
|
def process_class: (RBS::AST::Declarations::Class decl) -> RBS::AST::Declarations::Class
|
11
11
|
def process_constant: (RBS::AST::Declarations::Constant member) -> RBS::AST::Declarations::Constant
|
12
12
|
def process_member: (RBS::AST::Members::t member) -> RBS::AST::Members::t
|
13
|
-
def const_get: (RBS::AST::Declarations::
|
13
|
+
def const_get: (RBS::AST::Declarations::Class | RBS::AST::Declarations::Module decl) -> singleton(Class)?
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module RbsHeuristicPrototype
|
2
|
+
module Filters
|
3
|
+
class DeepModuleFilter < Base
|
4
|
+
attr_reader stack: Array[Module | Class | nil]
|
5
|
+
|
6
|
+
@stack: Array[Module | Class | nil]
|
7
|
+
|
8
|
+
def initialize: (RBS::Environment env) -> void
|
9
|
+
def process_module: (RBS::AST::Declarations::Module decl) -> RBS::AST::Declarations::t
|
10
|
+
def process_class: (RBS::AST::Declarations::Class decl) -> RBS::AST::Declarations::t
|
11
|
+
def namespace_to_decl!: (RBS::Namespace namespace) -> Array[RBS::AST::Declarations::Module | RBS::AST::Declarations::Class]
|
12
|
+
def obj_to_decl: (Module | Class obj) -> (RBS::AST::Declarations::Module | RBS::AST::Declarations::Class)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -2,11 +2,11 @@ module RbsHeuristicPrototype
|
|
2
2
|
module Filters
|
3
3
|
class SymbolArrayConstantsFilter < Base
|
4
4
|
def process_constant: (RBS::AST::Declarations::Constant constant) -> RBS::AST::Declarations::Constant
|
5
|
-
def process_constant_type: (
|
6
|
-
def symbol_array?: (
|
7
|
-
def array?: (
|
8
|
-
def symbol_union?: (
|
9
|
-
def symbol?: (
|
5
|
+
def process_constant_type: (untyped type) -> RBS::Types::ClassInstance
|
6
|
+
def symbol_array?: (untyped type) -> bool
|
7
|
+
def array?: (untyped type) -> bool
|
8
|
+
def symbol_union?: (untyped type) -> bool
|
9
|
+
def symbol?: (untyped type) -> bool
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
data/sig/shims/thor.rbs
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbs_heuristic_prototype
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takeshi KOMIYA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbs
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- lib/rbs_heuristic_prototype/filters/active_model_validations_filter.rb
|
48
48
|
- lib/rbs_heuristic_prototype/filters/base.rb
|
49
49
|
- lib/rbs_heuristic_prototype/filters/boolean_methods_filter.rb
|
50
|
+
- lib/rbs_heuristic_prototype/filters/deep_module_filter.rb
|
50
51
|
- lib/rbs_heuristic_prototype/filters/symbol_array_constants_filter.rb
|
51
52
|
- lib/rbs_heuristic_prototype/rake_task.rb
|
52
53
|
- lib/rbs_heuristic_prototype/version.rb
|
@@ -59,8 +60,11 @@ files:
|
|
59
60
|
- sig/rbs_heuristic_prototype/filters/active_model_validations_filter.rbs
|
60
61
|
- sig/rbs_heuristic_prototype/filters/base.rbs
|
61
62
|
- sig/rbs_heuristic_prototype/filters/boolean_methods_filter.rbs
|
63
|
+
- sig/rbs_heuristic_prototype/filters/deep_module_filter.rbs
|
62
64
|
- sig/rbs_heuristic_prototype/filters/symbol_array_constants_filter.rbs
|
63
65
|
- sig/rbs_heuristic_prototype/rake_task.rbs
|
66
|
+
- sig/shims/active_model.rbs
|
67
|
+
- sig/shims/thor.rbs
|
64
68
|
homepage: https://github.com/tk0miya/rbs_heuristic_prototype
|
65
69
|
licenses:
|
66
70
|
- MIT
|