packwerk 3.2.0 → 3.2.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 +4 -4
- data/lib/packwerk/association_inspector.rb +17 -4
- data/lib/packwerk/checker.rb +3 -3
- data/lib/packwerk/configuration.rb +4 -0
- data/lib/packwerk/const_node_inspector.rb +2 -2
- data/lib/packwerk/constant_name_inspector.rb +2 -2
- data/lib/packwerk/offenses_formatter.rb +3 -3
- data/lib/packwerk/package.rb +1 -1
- data/lib/packwerk/package_todo.rb +1 -4
- data/lib/packwerk/parsers/factory.rb +3 -3
- data/lib/packwerk/parsers/ruby.rb +7 -0
- data/lib/packwerk/reference_extractor.rb +29 -1
- data/lib/packwerk/reference_offense.rb +1 -1
- data/lib/packwerk/run_context.rb +15 -4
- data/lib/packwerk/validator.rb +3 -3
- data/lib/packwerk/version.rb +1 -1
- data/lib/packwerk.rb +1 -0
- data/sorbet/config +1 -0
- data/sorbet/rbi/gems/actionpack@7.0.3.1.rbi +3280 -3450
- data/sorbet/rbi/gems/actionview@7.0.3.1.rbi +2322 -1782
- data/sorbet/rbi/gems/activesupport@7.0.3.1.rbi +2654 -3268
- data/sorbet/rbi/gems/ast@2.4.2.rbi +535 -6
- data/sorbet/rbi/gems/better_html@2.0.1.rbi +529 -0
- data/sorbet/rbi/gems/builder@3.2.4.rbi +4 -4
- data/sorbet/rbi/gems/byebug@11.1.3.rbi +32 -4
- data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +1750 -1840
- data/sorbet/rbi/gems/constant_resolver@0.2.0.rbi +15 -15
- data/sorbet/rbi/gems/crass@1.0.6.rbi +489 -5
- data/sorbet/rbi/gems/erubi@1.11.0.rbi +24 -21
- data/sorbet/rbi/gems/i18n@1.12.0.rbi +395 -395
- data/sorbet/rbi/gems/json@2.6.2.rbi +70 -77
- data/sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi +1 -1
- data/sorbet/rbi/gems/loofah@2.18.0.rbi +134 -134
- data/sorbet/rbi/gems/m@1.6.0.rbi +60 -60
- data/sorbet/rbi/gems/method_source@1.1.0.rbi +303 -0
- data/sorbet/rbi/gems/minitest-focus@1.3.1.rbi +22 -28
- data/sorbet/rbi/gems/minitest@5.16.2.rbi +384 -396
- data/sorbet/rbi/gems/mocha@1.14.0.rbi +589 -589
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +37 -32
- data/sorbet/rbi/gems/nokogiri@1.15.3.rbi +962 -946
- data/sorbet/rbi/gems/{parallel@1.22.1.rbi → parallel@1.24.0.rbi} +85 -82
- data/sorbet/rbi/gems/{parser@3.2.2.0.rbi → parser@3.3.1.0.rbi} +1679 -1609
- data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +1 -1
- data/sorbet/rbi/gems/{prism@0.24.0.rbi → prism@0.27.0.rbi} +13473 -6472
- data/sorbet/rbi/gems/{racc@1.6.0.rbi → racc@1.7.1.rbi} +42 -33
- data/sorbet/rbi/gems/rack-test@2.0.2.rbi +148 -338
- data/sorbet/rbi/gems/rack@2.2.4.rbi +1079 -1130
- data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +354 -22
- data/sorbet/rbi/gems/rails-html-sanitizer@1.4.3.rbi +113 -259
- data/sorbet/rbi/gems/railties@7.0.3.1.rbi +642 -638
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +109 -99
- data/sorbet/rbi/gems/rake@13.0.6.rbi +714 -599
- data/sorbet/rbi/gems/{rbi@0.0.15.rbi → rbi@0.1.12.rbi} +865 -801
- data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +853 -870
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +480 -477
- data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +1621 -1622
- data/sorbet/rbi/gems/rubocop-performance@1.14.3.rbi +507 -526
- data/sorbet/rbi/gems/rubocop-shopify@2.9.0.rbi +1 -1
- data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +186 -203
- data/sorbet/rbi/gems/rubocop@1.34.1.rbi +8126 -8367
- data/sorbet/rbi/gems/{ruby-lsp@0.2.1.rbi → ruby-lsp@0.2.3.rbi} +2 -2
- data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +1235 -4
- data/sorbet/rbi/gems/smart_properties@1.17.0.rbi +90 -90
- data/sorbet/rbi/gems/spoom@1.3.2.rbi +4420 -0
- data/sorbet/rbi/gems/spring@4.0.0.rbi +104 -104
- data/sorbet/rbi/gems/syntax_tree@3.3.0.rbi +1 -1
- data/sorbet/rbi/gems/{tapioca@0.9.2.rbi → tapioca@0.13.3.rbi} +1596 -1253
- data/sorbet/rbi/gems/{thor@1.2.1.rbi → thor@1.3.1.rbi} +1047 -652
- data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +531 -513
- data/sorbet/rbi/gems/unicode-display_width@2.2.0.rbi +13 -13
- data/sorbet/rbi/gems/{yard-sorbet@0.6.1.rbi → yard-sorbet@0.8.1.rbi} +132 -92
- data/sorbet/rbi/gems/{yard@0.9.28.rbi → yard@0.9.36.rbi} +3158 -3067
- data/sorbet/rbi/gems/zeitwerk@2.6.4.rbi +149 -145
- metadata +22 -94
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -27
- data/.github/pull_request_template.md +0 -28
- data/.github/workflows/ci.yml +0 -93
- data/.github/workflows/cla.yml +0 -22
- data/.gitignore +0 -13
- data/.rubocop.yml +0 -75
- data/.ruby-version +0 -1
- data/CODEOWNERS +0 -1
- data/CODE_OF_CONDUCT.md +0 -76
- data/CONTRIBUTING.md +0 -17
- data/Gemfile +0 -27
- data/Gemfile.lock +0 -206
- data/RESOLVING_VIOLATIONS.md +0 -76
- data/Rakefile +0 -22
- data/TROUBLESHOOT.md +0 -44
- data/UPGRADING.md +0 -66
- data/USAGE.md +0 -364
- data/bin/console +0 -15
- data/bin/m +0 -29
- data/bin/rake +0 -29
- data/bin/rubocop +0 -29
- data/bin/setup +0 -8
- data/bin/srb +0 -29
- data/bin/tapioca +0 -29
- data/dev.yml +0 -32
- data/docs/cohesion.png +0 -0
- data/gemfiles/Gemfile-rails-6-0 +0 -22
- data/gemfiles/Gemfile-rails-6-1 +0 -22
- data/packwerk.gemspec +0 -59
- data/shipit.rubygems.yml +0 -5
- data/sorbet/rbi/gems/actioncable@7.0.3.1.rbi +0 -2754
- data/sorbet/rbi/gems/actionmailbox@7.0.3.1.rbi +0 -1496
- data/sorbet/rbi/gems/actionmailer@7.0.3.1.rbi +0 -2362
- data/sorbet/rbi/gems/actiontext@7.0.3.1.rbi +0 -1569
- data/sorbet/rbi/gems/activejob@7.0.3.1.rbi +0 -2553
- data/sorbet/rbi/gems/activemodel@7.0.3.1.rbi +0 -5999
- data/sorbet/rbi/gems/activerecord@7.0.3.1.rbi +0 -37832
- data/sorbet/rbi/gems/activestorage@7.0.3.1.rbi +0 -2321
- data/sorbet/rbi/gems/better_html@1.0.16.rbi +0 -317
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +0 -8
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +0 -1079
- data/sorbet/rbi/gems/digest@3.1.0.rbi +0 -189
- data/sorbet/rbi/gems/globalid@1.0.0.rbi +0 -572
- data/sorbet/rbi/gems/mail@2.7.1.rbi +0 -2490
- data/sorbet/rbi/gems/marcel@1.0.2.rbi +0 -220
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +0 -76
- data/sorbet/rbi/gems/mini_mime@1.1.2.rbi +0 -170
- data/sorbet/rbi/gems/net-imap@0.2.3.rbi +0 -2147
- data/sorbet/rbi/gems/net-pop@0.1.1.rbi +0 -926
- data/sorbet/rbi/gems/net-protocol@0.1.3.rbi +0 -11
- data/sorbet/rbi/gems/net-smtp@0.3.1.rbi +0 -1108
- data/sorbet/rbi/gems/nio4r@2.5.8.rbi +0 -292
- data/sorbet/rbi/gems/pry@0.14.1.rbi +0 -8
- data/sorbet/rbi/gems/rails@7.0.3.1.rbi +0 -8
- data/sorbet/rbi/gems/spoom@1.1.11.rbi +0 -2181
- data/sorbet/rbi/gems/strscan@3.0.4.rbi +0 -8
- data/sorbet/rbi/gems/timeout@0.3.0.rbi +0 -142
- data/sorbet/rbi/gems/unparser@0.6.5.rbi +0 -4529
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +0 -2582
- data/sorbet/rbi/gems/websocket-driver@0.7.5.rbi +0 -993
- data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +0 -71
data/sorbet/rbi/gems/m@1.6.0.rbi
CHANGED
|
@@ -7,251 +7,251 @@
|
|
|
7
7
|
# Runners are in charge of running your tests, depending on the framework
|
|
8
8
|
# Instead of slamming all of this junk in an `M` class, it's here instead.
|
|
9
9
|
#
|
|
10
|
-
# source://m
|
|
10
|
+
# source://m//lib/m/version.rb#1
|
|
11
11
|
module M
|
|
12
12
|
class << self
|
|
13
13
|
# Accept arguments coming from bin/m and run tests, then bail out immediately.
|
|
14
14
|
#
|
|
15
|
-
# source://m
|
|
15
|
+
# source://m//lib/m.rb#9
|
|
16
16
|
def run(argv); end
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
# source://m
|
|
20
|
+
# source://m//lib/m/executor.rb#8
|
|
21
21
|
class M::Executor
|
|
22
22
|
# @return [Executor] a new instance of Executor
|
|
23
23
|
#
|
|
24
|
-
# source://m
|
|
24
|
+
# source://m//lib/m/executor.rb#9
|
|
25
25
|
def initialize(testable); end
|
|
26
26
|
|
|
27
|
-
# source://m
|
|
27
|
+
# source://m//lib/m/executor.rb#13
|
|
28
28
|
def execute; end
|
|
29
29
|
|
|
30
30
|
private
|
|
31
31
|
|
|
32
|
-
# source://m
|
|
32
|
+
# source://m//lib/m/executor.rb#96
|
|
33
33
|
def runner; end
|
|
34
34
|
|
|
35
35
|
# Finds all test suites in this test file, with test methods included.
|
|
36
36
|
#
|
|
37
|
-
# source://m
|
|
37
|
+
# source://m//lib/m/executor.rb#72
|
|
38
38
|
def suites; end
|
|
39
39
|
|
|
40
40
|
# Returns the value of attribute testable.
|
|
41
41
|
#
|
|
42
|
-
# source://m
|
|
42
|
+
# source://m//lib/m/executor.rb#50
|
|
43
43
|
def testable; end
|
|
44
44
|
|
|
45
45
|
# Shoves tests together in our custom container and collection classes.
|
|
46
46
|
# Memoize it since it's unnecessary to do this more than one for a given file.
|
|
47
47
|
#
|
|
48
|
-
# source://m
|
|
48
|
+
# source://m//lib/m/executor.rb#54
|
|
49
49
|
def tests; end
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
# source://m
|
|
52
|
+
# source://m//lib/m/frameworks.rb#2
|
|
53
53
|
class M::Frameworks
|
|
54
|
-
# source://m
|
|
54
|
+
# source://m//lib/m/frameworks.rb#7
|
|
55
55
|
def framework_runner; end
|
|
56
56
|
|
|
57
57
|
private
|
|
58
58
|
|
|
59
59
|
# @return [Boolean]
|
|
60
60
|
#
|
|
61
|
-
# source://m
|
|
61
|
+
# source://m//lib/m/frameworks.rb#25
|
|
62
62
|
def minitest4?; end
|
|
63
63
|
|
|
64
64
|
# @return [Boolean]
|
|
65
65
|
#
|
|
66
|
-
# source://m
|
|
66
|
+
# source://m//lib/m/frameworks.rb#21
|
|
67
67
|
def minitest5?; end
|
|
68
68
|
|
|
69
69
|
# @return [Boolean]
|
|
70
70
|
#
|
|
71
|
-
# source://m
|
|
71
|
+
# source://m//lib/m/frameworks.rb#29
|
|
72
72
|
def test_unit?; end
|
|
73
73
|
|
|
74
74
|
class << self
|
|
75
|
-
# source://m
|
|
75
|
+
# source://m//lib/m/frameworks.rb#3
|
|
76
76
|
def framework_runner; end
|
|
77
77
|
|
|
78
78
|
# @return [Boolean]
|
|
79
79
|
#
|
|
80
|
-
# source://m
|
|
80
|
+
# source://m//lib/m/frameworks.rb#41
|
|
81
81
|
def minitest4?; end
|
|
82
82
|
|
|
83
83
|
# @return [Boolean]
|
|
84
84
|
#
|
|
85
|
-
# source://m
|
|
85
|
+
# source://m//lib/m/frameworks.rb#37
|
|
86
86
|
def minitest5?; end
|
|
87
87
|
|
|
88
|
-
# source://m
|
|
88
|
+
# source://m//lib/m/frameworks.rb#33
|
|
89
89
|
def minitest_version_major; end
|
|
90
90
|
|
|
91
91
|
# @return [Boolean]
|
|
92
92
|
#
|
|
93
|
-
# source://m
|
|
93
|
+
# source://m//lib/m/frameworks.rb#45
|
|
94
94
|
def test_unit?; end
|
|
95
95
|
end
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
-
# source://m
|
|
98
|
+
# source://m//lib/m/parser.rb#4
|
|
99
99
|
class M::Parser
|
|
100
100
|
# @return [Parser] a new instance of Parser
|
|
101
101
|
#
|
|
102
|
-
# source://m
|
|
102
|
+
# source://m//lib/m/parser.rb#5
|
|
103
103
|
def initialize(argv); end
|
|
104
104
|
|
|
105
|
-
# source://m
|
|
105
|
+
# source://m//lib/m/parser.rb#10
|
|
106
106
|
def parse; end
|
|
107
107
|
|
|
108
108
|
private
|
|
109
109
|
|
|
110
110
|
# Returns the value of attribute argv.
|
|
111
111
|
#
|
|
112
|
-
# source://m
|
|
112
|
+
# source://m//lib/m/parser.rb#56
|
|
113
113
|
def argv; end
|
|
114
114
|
|
|
115
|
-
# source://m
|
|
115
|
+
# source://m//lib/m/parser.rb#58
|
|
116
116
|
def parse_options!(argv); end
|
|
117
117
|
|
|
118
118
|
# Returns the value of attribute testable.
|
|
119
119
|
#
|
|
120
|
-
# source://m
|
|
120
|
+
# source://m//lib/m/parser.rb#56
|
|
121
121
|
def testable; end
|
|
122
122
|
|
|
123
|
-
# source://m
|
|
123
|
+
# source://m//lib/m/parser.rb#89
|
|
124
124
|
def wildcard(type); end
|
|
125
125
|
end
|
|
126
126
|
|
|
127
|
-
# source://m
|
|
127
|
+
# source://m//lib/m/runner.rb#7
|
|
128
128
|
class M::Runner
|
|
129
129
|
# @return [Runner] a new instance of Runner
|
|
130
130
|
#
|
|
131
|
-
# source://m
|
|
131
|
+
# source://m//lib/m/runner.rb#8
|
|
132
132
|
def initialize(argv); end
|
|
133
133
|
|
|
134
134
|
# There's two steps to running our tests:
|
|
135
135
|
# 1. Parsing the given input for the tests we need to find (or groups of tests)
|
|
136
136
|
# 2. Run those tests we found that match what you wanted
|
|
137
137
|
#
|
|
138
|
-
# source://m
|
|
138
|
+
# source://m//lib/m/runner.rb#15
|
|
139
139
|
def run; end
|
|
140
140
|
end
|
|
141
141
|
|
|
142
|
-
# source://m
|
|
142
|
+
# source://m//lib/m/runners/base.rb#2
|
|
143
143
|
module M::Runners; end
|
|
144
144
|
|
|
145
|
-
# source://m
|
|
145
|
+
# source://m//lib/m/runners/base.rb#3
|
|
146
146
|
class M::Runners::Base
|
|
147
|
-
# source://m
|
|
147
|
+
# source://m//lib/m/runners/base.rb#8
|
|
148
148
|
def run(_test_arguments); end
|
|
149
149
|
|
|
150
|
-
# source://m
|
|
150
|
+
# source://m//lib/m/runners/base.rb#4
|
|
151
151
|
def suites; end
|
|
152
152
|
|
|
153
|
-
# source://m
|
|
153
|
+
# source://m//lib/m/runners/base.rb#12
|
|
154
154
|
def test_methods(suite_class); end
|
|
155
155
|
end
|
|
156
156
|
|
|
157
|
-
# source://m
|
|
157
|
+
# source://m//lib/m/runners/minitest_4.rb#3
|
|
158
158
|
class M::Runners::Minitest4 < ::M::Runners::Base
|
|
159
|
-
# source://m
|
|
159
|
+
# source://m//lib/m/runners/minitest_4.rb#8
|
|
160
160
|
def run(test_arguments); end
|
|
161
161
|
|
|
162
|
-
# source://m
|
|
162
|
+
# source://m//lib/m/runners/minitest_4.rb#4
|
|
163
163
|
def suites; end
|
|
164
164
|
end
|
|
165
165
|
|
|
166
|
-
# source://m
|
|
166
|
+
# source://m//lib/m/runners/minitest_5.rb#3
|
|
167
167
|
class M::Runners::Minitest5 < ::M::Runners::Base
|
|
168
|
-
# source://m
|
|
168
|
+
# source://m//lib/m/runners/minitest_5.rb#8
|
|
169
169
|
def run(test_arguments); end
|
|
170
170
|
|
|
171
|
-
# source://m
|
|
171
|
+
# source://m//lib/m/runners/minitest_5.rb#4
|
|
172
172
|
def suites; end
|
|
173
173
|
|
|
174
|
-
# source://m
|
|
174
|
+
# source://m//lib/m/runners/minitest_5.rb#14
|
|
175
175
|
def test_methods(suite_class); end
|
|
176
176
|
end
|
|
177
177
|
|
|
178
|
-
# source://m
|
|
178
|
+
# source://m//lib/m/runners/test_unit.rb#3
|
|
179
179
|
class M::Runners::TestUnit < ::M::Runners::Base
|
|
180
|
-
# source://m
|
|
180
|
+
# source://m//lib/m/runners/test_unit.rb#12
|
|
181
181
|
def run(test_arguments); end
|
|
182
182
|
|
|
183
|
-
# source://m
|
|
183
|
+
# source://m//lib/m/runners/test_unit.rb#4
|
|
184
184
|
def suites; end
|
|
185
185
|
|
|
186
|
-
# source://m
|
|
186
|
+
# source://m//lib/m/runners/test_unit.rb#16
|
|
187
187
|
def test_methods(suite_class); end
|
|
188
188
|
end
|
|
189
189
|
|
|
190
|
-
# source://m
|
|
190
|
+
# source://m//lib/m/runners/unsupported_framework.rb#3
|
|
191
191
|
class M::Runners::UnsupportedFramework < ::M::Runners::Base
|
|
192
|
-
# source://m
|
|
192
|
+
# source://m//lib/m/runners/unsupported_framework.rb#9
|
|
193
193
|
def run(_test_arguments); end
|
|
194
194
|
|
|
195
|
-
# source://m
|
|
195
|
+
# source://m//lib/m/runners/unsupported_framework.rb#4
|
|
196
196
|
def suites; end
|
|
197
197
|
|
|
198
198
|
private
|
|
199
199
|
|
|
200
|
-
# source://m
|
|
200
|
+
# source://m//lib/m/runners/unsupported_framework.rb#15
|
|
201
201
|
def not_supported; end
|
|
202
202
|
end
|
|
203
203
|
|
|
204
|
-
# source://m
|
|
204
|
+
# source://m//lib/m/testable.rb#2
|
|
205
205
|
class M::Testable
|
|
206
206
|
# @return [Testable] a new instance of Testable
|
|
207
207
|
#
|
|
208
|
-
# source://m
|
|
208
|
+
# source://m//lib/m/testable.rb#6
|
|
209
209
|
def initialize(file = T.unsafe(nil), lines = T.unsafe(nil), recursive = T.unsafe(nil)); end
|
|
210
210
|
|
|
211
211
|
# Returns the value of attribute file.
|
|
212
212
|
#
|
|
213
|
-
# source://m
|
|
213
|
+
# source://m//lib/m/testable.rb#3
|
|
214
214
|
def file; end
|
|
215
215
|
|
|
216
216
|
# Sets the attribute file
|
|
217
217
|
#
|
|
218
218
|
# @param value the value to set the attribute file to.
|
|
219
219
|
#
|
|
220
|
-
# source://m
|
|
220
|
+
# source://m//lib/m/testable.rb#3
|
|
221
221
|
def file=(_arg0); end
|
|
222
222
|
|
|
223
223
|
# Returns the value of attribute lines.
|
|
224
224
|
#
|
|
225
|
-
# source://m
|
|
225
|
+
# source://m//lib/m/testable.rb#4
|
|
226
226
|
def lines; end
|
|
227
227
|
|
|
228
|
-
# source://m
|
|
228
|
+
# source://m//lib/m/testable.rb#13
|
|
229
229
|
def lines=(lines); end
|
|
230
230
|
|
|
231
231
|
# Returns the value of attribute passthrough_options.
|
|
232
232
|
#
|
|
233
|
-
# source://m
|
|
233
|
+
# source://m//lib/m/testable.rb#3
|
|
234
234
|
def passthrough_options; end
|
|
235
235
|
|
|
236
236
|
# Sets the attribute passthrough_options
|
|
237
237
|
#
|
|
238
238
|
# @param value the value to set the attribute passthrough_options to.
|
|
239
239
|
#
|
|
240
|
-
# source://m
|
|
240
|
+
# source://m//lib/m/testable.rb#3
|
|
241
241
|
def passthrough_options=(_arg0); end
|
|
242
242
|
|
|
243
243
|
# Returns the value of attribute recursive.
|
|
244
244
|
#
|
|
245
|
-
# source://m
|
|
245
|
+
# source://m//lib/m/testable.rb#3
|
|
246
246
|
def recursive; end
|
|
247
247
|
|
|
248
248
|
# Sets the attribute recursive
|
|
249
249
|
#
|
|
250
250
|
# @param value the value to set the attribute recursive to.
|
|
251
251
|
#
|
|
252
|
-
# source://m
|
|
252
|
+
# source://m//lib/m/testable.rb#3
|
|
253
253
|
def recursive=(_arg0); end
|
|
254
254
|
end
|
|
255
255
|
|
|
256
|
-
# source://m
|
|
256
|
+
# source://m//lib/m/version.rb#2
|
|
257
257
|
M::VERSION = T.let(T.unsafe(nil), String)
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
|
|
3
|
+
# DO NOT EDIT MANUALLY
|
|
4
|
+
# This is an autogenerated file for types exported from the `method_source` gem.
|
|
5
|
+
# Please instead update this file by running `bin/tapioca gem method_source`.
|
|
6
|
+
|
|
7
|
+
# source://method_source//lib/method_source.rb#163
|
|
8
|
+
class Method
|
|
9
|
+
include ::MethodSource::SourceLocation::MethodExtensions
|
|
10
|
+
include ::MethodSource::MethodExtensions
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# source://method_source//lib/method_source/version.rb#1
|
|
14
|
+
module MethodSource
|
|
15
|
+
extend ::MethodSource::CodeHelpers
|
|
16
|
+
|
|
17
|
+
class << self
|
|
18
|
+
# Clear cache.
|
|
19
|
+
#
|
|
20
|
+
# source://method_source//lib/method_source.rb#59
|
|
21
|
+
def clear_cache; end
|
|
22
|
+
|
|
23
|
+
# Helper method responsible for opening source file and buffering up
|
|
24
|
+
# the comments for a specified method. Defined here to avoid polluting
|
|
25
|
+
# `Method` class.
|
|
26
|
+
#
|
|
27
|
+
# @param source_location [Array] The array returned by Method#source_location
|
|
28
|
+
# @param method_name [String]
|
|
29
|
+
# @raise [SourceNotFoundError]
|
|
30
|
+
# @return [String] The comments up to the point of the method.
|
|
31
|
+
#
|
|
32
|
+
# source://method_source//lib/method_source.rb#38
|
|
33
|
+
def comment_helper(source_location, name = T.unsafe(nil)); end
|
|
34
|
+
|
|
35
|
+
# @deprecated — use MethodSource::CodeHelpers#expression_at
|
|
36
|
+
#
|
|
37
|
+
# source://method_source//lib/method_source.rb#71
|
|
38
|
+
def extract_code(source_location); end
|
|
39
|
+
|
|
40
|
+
# Load a memoized copy of the lines in a file.
|
|
41
|
+
#
|
|
42
|
+
# @param file_name [String]
|
|
43
|
+
# @param method_name [String]
|
|
44
|
+
# @raise [SourceNotFoundError]
|
|
45
|
+
# @return [Array<String>] the contents of the file
|
|
46
|
+
#
|
|
47
|
+
# source://method_source//lib/method_source.rb#51
|
|
48
|
+
def lines_for(file_name, name = T.unsafe(nil)); end
|
|
49
|
+
|
|
50
|
+
# Helper method responsible for extracting method body.
|
|
51
|
+
# Defined here to avoid polluting `Method` class.
|
|
52
|
+
#
|
|
53
|
+
# @param source_location [Array] The array returned by Method#source_location
|
|
54
|
+
# @param method_name [String]
|
|
55
|
+
# @return [String] The method body
|
|
56
|
+
#
|
|
57
|
+
# source://method_source//lib/method_source.rb#23
|
|
58
|
+
def source_helper(source_location, name = T.unsafe(nil)); end
|
|
59
|
+
|
|
60
|
+
# @deprecated — use MethodSource::CodeHelpers#complete_expression?
|
|
61
|
+
# @return [Boolean]
|
|
62
|
+
#
|
|
63
|
+
# source://method_source//lib/method_source.rb#64
|
|
64
|
+
def valid_expression?(str); end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# source://method_source//lib/method_source/code_helpers.rb#3
|
|
69
|
+
module MethodSource::CodeHelpers
|
|
70
|
+
# Retrieve the comment describing the expression on the given line of the given file.
|
|
71
|
+
#
|
|
72
|
+
# This is useful to get module or method documentation.
|
|
73
|
+
#
|
|
74
|
+
# @param file [Array<String>, File, String] The file to parse, either as a File or as
|
|
75
|
+
# a String or an Array of lines.
|
|
76
|
+
# @param line_number [Integer] The line number at which to look.
|
|
77
|
+
# NOTE: The first line in a file is line 1!
|
|
78
|
+
# @return [String] The comment
|
|
79
|
+
#
|
|
80
|
+
# source://method_source//lib/method_source/code_helpers.rb#52
|
|
81
|
+
def comment_describing(file, line_number); end
|
|
82
|
+
|
|
83
|
+
# Determine if a string of code is a complete Ruby expression.
|
|
84
|
+
#
|
|
85
|
+
# @example
|
|
86
|
+
# complete_expression?("class Hello") #=> false
|
|
87
|
+
# complete_expression?("class Hello; end") #=> true
|
|
88
|
+
# complete_expression?("class 123") #=> SyntaxError: unexpected tINTEGER
|
|
89
|
+
# @param code [String] The code to validate.
|
|
90
|
+
# @raise [SyntaxError] Any SyntaxError that does not represent incompleteness.
|
|
91
|
+
# @return [Boolean] Whether or not the code is a complete Ruby expression.
|
|
92
|
+
#
|
|
93
|
+
# source://method_source//lib/method_source/code_helpers.rb#66
|
|
94
|
+
def complete_expression?(str); end
|
|
95
|
+
|
|
96
|
+
# Retrieve the first expression starting on the given line of the given file.
|
|
97
|
+
#
|
|
98
|
+
# This is useful to get module or method source code.
|
|
99
|
+
#
|
|
100
|
+
# line 1!
|
|
101
|
+
#
|
|
102
|
+
# @option options
|
|
103
|
+
# @option options
|
|
104
|
+
# @param file [Array<String>, File, String] The file to parse, either as a File or as
|
|
105
|
+
# @param line_number [Integer] The line number at which to look.
|
|
106
|
+
# NOTE: The first line in a file is
|
|
107
|
+
# @param options [Hash] The optional configuration parameters.
|
|
108
|
+
# @raise [SyntaxError] If the first complete expression can't be identified
|
|
109
|
+
# @return [String] The first complete expression
|
|
110
|
+
#
|
|
111
|
+
# source://method_source//lib/method_source/code_helpers.rb#20
|
|
112
|
+
def expression_at(file, line_number, options = T.unsafe(nil)); end
|
|
113
|
+
|
|
114
|
+
private
|
|
115
|
+
|
|
116
|
+
# Get the first expression from the input.
|
|
117
|
+
#
|
|
118
|
+
# @param lines [Array<String>]
|
|
119
|
+
# @param consume [Integer] A number of lines to automatically
|
|
120
|
+
# consume (add to the expression buffer) without checking for validity.
|
|
121
|
+
# @raise [SyntaxError]
|
|
122
|
+
# @return [String] a valid ruby expression
|
|
123
|
+
# @yield a clean-up function to run before checking for complete_expression
|
|
124
|
+
#
|
|
125
|
+
# source://method_source//lib/method_source/code_helpers.rb#92
|
|
126
|
+
def extract_first_expression(lines, consume = T.unsafe(nil), &block); end
|
|
127
|
+
|
|
128
|
+
# Get the last comment from the input.
|
|
129
|
+
#
|
|
130
|
+
# @param lines [Array<String>]
|
|
131
|
+
# @return [String]
|
|
132
|
+
#
|
|
133
|
+
# source://method_source//lib/method_source/code_helpers.rb#106
|
|
134
|
+
def extract_last_comment(lines); end
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# An exception matcher that matches only subsets of SyntaxErrors that can be
|
|
138
|
+
# fixed by adding more input to the buffer.
|
|
139
|
+
#
|
|
140
|
+
# source://method_source//lib/method_source/code_helpers.rb#124
|
|
141
|
+
module MethodSource::CodeHelpers::IncompleteExpression
|
|
142
|
+
class << self
|
|
143
|
+
# source://method_source//lib/method_source/code_helpers.rb#137
|
|
144
|
+
def ===(ex); end
|
|
145
|
+
|
|
146
|
+
# @return [Boolean]
|
|
147
|
+
#
|
|
148
|
+
# source://method_source//lib/method_source/code_helpers.rb#149
|
|
149
|
+
def rbx?; end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# source://method_source//lib/method_source/code_helpers.rb#125
|
|
154
|
+
MethodSource::CodeHelpers::IncompleteExpression::GENERIC_REGEXPS = T.let(T.unsafe(nil), Array)
|
|
155
|
+
|
|
156
|
+
# source://method_source//lib/method_source/code_helpers.rb#133
|
|
157
|
+
MethodSource::CodeHelpers::IncompleteExpression::RBX_ONLY_REGEXPS = T.let(T.unsafe(nil), Array)
|
|
158
|
+
|
|
159
|
+
# This module is to be included by `Method` and `UnboundMethod` and
|
|
160
|
+
# provides the `#source` functionality
|
|
161
|
+
#
|
|
162
|
+
# source://method_source//lib/method_source.rb#77
|
|
163
|
+
module MethodSource::MethodExtensions
|
|
164
|
+
# Return the comments associated with the method class/module.
|
|
165
|
+
#
|
|
166
|
+
# @example
|
|
167
|
+
# MethodSource::MethodExtensions.method(:included).module_comment
|
|
168
|
+
# =>
|
|
169
|
+
# # This module is to be included by `Method` and `UnboundMethod` and
|
|
170
|
+
# # provides the `#source` functionality
|
|
171
|
+
# @raise SourceNotFoundException
|
|
172
|
+
# @return [String] The method's comments as a string
|
|
173
|
+
#
|
|
174
|
+
# source://method_source//lib/method_source.rb#139
|
|
175
|
+
def class_comment; end
|
|
176
|
+
|
|
177
|
+
# Return the comments associated with the method as a string.
|
|
178
|
+
#
|
|
179
|
+
# @example
|
|
180
|
+
# Set.instance_method(:clear).comment.display
|
|
181
|
+
# =>
|
|
182
|
+
# # Removes all elements and returns self.
|
|
183
|
+
# @raise SourceNotFoundException
|
|
184
|
+
# @return [String] The method's comments as a string
|
|
185
|
+
#
|
|
186
|
+
# source://method_source//lib/method_source.rb#126
|
|
187
|
+
def comment; end
|
|
188
|
+
|
|
189
|
+
# Return the comments associated with the method class/module.
|
|
190
|
+
#
|
|
191
|
+
# @example
|
|
192
|
+
# MethodSource::MethodExtensions.method(:included).module_comment
|
|
193
|
+
# =>
|
|
194
|
+
# # This module is to be included by `Method` and `UnboundMethod` and
|
|
195
|
+
# # provides the `#source` functionality
|
|
196
|
+
# @raise SourceNotFoundException
|
|
197
|
+
# @return [String] The method's comments as a string
|
|
198
|
+
#
|
|
199
|
+
# source://method_source//lib/method_source.rb#139
|
|
200
|
+
def module_comment; end
|
|
201
|
+
|
|
202
|
+
# Return the sourcecode for the method as a string
|
|
203
|
+
#
|
|
204
|
+
# @example
|
|
205
|
+
# Set.instance_method(:clear).source.display
|
|
206
|
+
# =>
|
|
207
|
+
# def clear
|
|
208
|
+
# @hash.clear
|
|
209
|
+
# self
|
|
210
|
+
# end
|
|
211
|
+
# @raise SourceNotFoundException
|
|
212
|
+
# @return [String] The method sourcecode as a string
|
|
213
|
+
#
|
|
214
|
+
# source://method_source//lib/method_source.rb#114
|
|
215
|
+
def source; end
|
|
216
|
+
|
|
217
|
+
class << self
|
|
218
|
+
# We use the included hook to patch Method#source on rubinius.
|
|
219
|
+
# We need to use the included hook as Rubinius defines a `source`
|
|
220
|
+
# on Method so including a module will have no effect (as it's
|
|
221
|
+
# higher up the MRO).
|
|
222
|
+
#
|
|
223
|
+
# @param klass [Class] The class that includes the module.
|
|
224
|
+
#
|
|
225
|
+
# source://method_source//lib/method_source.rb#84
|
|
226
|
+
def included(klass); end
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# source://method_source//lib/method_source/source_location.rb#2
|
|
231
|
+
module MethodSource::ReeSourceLocation
|
|
232
|
+
# Ruby enterprise edition provides all the information that's
|
|
233
|
+
# needed, in a slightly different way.
|
|
234
|
+
#
|
|
235
|
+
# source://method_source//lib/method_source/source_location.rb#5
|
|
236
|
+
def source_location; end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# source://method_source//lib/method_source/source_location.rb#10
|
|
240
|
+
module MethodSource::SourceLocation; end
|
|
241
|
+
|
|
242
|
+
# source://method_source//lib/method_source/source_location.rb#11
|
|
243
|
+
module MethodSource::SourceLocation::MethodExtensions
|
|
244
|
+
# Return the source location of a method for Ruby 1.8.
|
|
245
|
+
#
|
|
246
|
+
# @return [Array] A two element array. First element is the
|
|
247
|
+
# file, second element is the line in the file where the
|
|
248
|
+
# method definition is found.
|
|
249
|
+
#
|
|
250
|
+
# source://method_source//lib/method_source/source_location.rb#40
|
|
251
|
+
def source_location; end
|
|
252
|
+
|
|
253
|
+
private
|
|
254
|
+
|
|
255
|
+
# source://method_source//lib/method_source/source_location.rb#26
|
|
256
|
+
def trace_func(event, file, line, id, binding, classname); end
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# source://method_source//lib/method_source/source_location.rb#54
|
|
260
|
+
module MethodSource::SourceLocation::ProcExtensions
|
|
261
|
+
# Return the source location for a Proc (in implementations
|
|
262
|
+
# without Proc#source_location)
|
|
263
|
+
#
|
|
264
|
+
# @return [Array] A two element array. First element is the
|
|
265
|
+
# file, second element is the line in the file where the
|
|
266
|
+
# proc definition is found.
|
|
267
|
+
#
|
|
268
|
+
# source://method_source//lib/method_source/source_location.rb#74
|
|
269
|
+
def source_location; end
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
# source://method_source//lib/method_source/source_location.rb#81
|
|
273
|
+
module MethodSource::SourceLocation::UnboundMethodExtensions
|
|
274
|
+
# Return the source location of an instance method for Ruby 1.8.
|
|
275
|
+
#
|
|
276
|
+
# @return [Array] A two element array. First element is the
|
|
277
|
+
# file, second element is the line in the file where the
|
|
278
|
+
# method definition is found.
|
|
279
|
+
#
|
|
280
|
+
# source://method_source//lib/method_source/source_location.rb#101
|
|
281
|
+
def source_location; end
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# An Exception to mark errors that were raised trying to find the source from
|
|
285
|
+
# a given source_location.
|
|
286
|
+
#
|
|
287
|
+
# source://method_source//lib/method_source.rb#16
|
|
288
|
+
class MethodSource::SourceNotFoundError < ::StandardError; end
|
|
289
|
+
|
|
290
|
+
# source://method_source//lib/method_source/version.rb#2
|
|
291
|
+
MethodSource::VERSION = T.let(T.unsafe(nil), String)
|
|
292
|
+
|
|
293
|
+
# source://method_source//lib/method_source.rb#173
|
|
294
|
+
class Proc
|
|
295
|
+
include ::MethodSource::SourceLocation::ProcExtensions
|
|
296
|
+
include ::MethodSource::MethodExtensions
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# source://method_source//lib/method_source.rb#168
|
|
300
|
+
class UnboundMethod
|
|
301
|
+
include ::MethodSource::SourceLocation::UnboundMethodExtensions
|
|
302
|
+
include ::MethodSource::MethodExtensions
|
|
303
|
+
end
|