ruby-paseto 0.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.
Files changed (116) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +8 -0
  3. data/CODE_OF_CONDUCT.md +84 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +549 -0
  6. data/lib/paseto/asn1/algorithm_identifier.rb +17 -0
  7. data/lib/paseto/asn1/curve_private_key.rb +22 -0
  8. data/lib/paseto/asn1/ec_private_key.rb +27 -0
  9. data/lib/paseto/asn1/ecdsa_full_r.rb +26 -0
  10. data/lib/paseto/asn1/ecdsa_sig_value.rb +23 -0
  11. data/lib/paseto/asn1/ecdsa_signature.rb +49 -0
  12. data/lib/paseto/asn1/ed25519_identifier.rb +15 -0
  13. data/lib/paseto/asn1/named_curve.rb +17 -0
  14. data/lib/paseto/asn1/one_asymmetric_key.rb +32 -0
  15. data/lib/paseto/asn1/private_key.rb +17 -0
  16. data/lib/paseto/asn1/private_key_algorithm_identifier.rb +17 -0
  17. data/lib/paseto/asn1/public_key.rb +17 -0
  18. data/lib/paseto/asn1/subject_public_key_info.rb +28 -0
  19. data/lib/paseto/asn1.rb +101 -0
  20. data/lib/paseto/asymmetric_key.rb +100 -0
  21. data/lib/paseto/configuration/box.rb +23 -0
  22. data/lib/paseto/configuration/decode_configuration.rb +68 -0
  23. data/lib/paseto/configuration.rb +18 -0
  24. data/lib/paseto/interface/i_d.rb +23 -0
  25. data/lib/paseto/interface/key.rb +113 -0
  26. data/lib/paseto/interface/pbkd.rb +83 -0
  27. data/lib/paseto/interface/pie.rb +59 -0
  28. data/lib/paseto/interface/pke.rb +86 -0
  29. data/lib/paseto/interface/serializer.rb +19 -0
  30. data/lib/paseto/interface/version.rb +161 -0
  31. data/lib/paseto/interface/wrapper.rb +20 -0
  32. data/lib/paseto/operations/i_d.rb +48 -0
  33. data/lib/paseto/operations/id/i_dv3.rb +20 -0
  34. data/lib/paseto/operations/id/i_dv4.rb +20 -0
  35. data/lib/paseto/operations/pbkd/p_b_k_dv3.rb +85 -0
  36. data/lib/paseto/operations/pbkd/p_b_k_dv4.rb +94 -0
  37. data/lib/paseto/operations/pbkw.rb +73 -0
  38. data/lib/paseto/operations/pke/p_k_ev3.rb +97 -0
  39. data/lib/paseto/operations/pke/p_k_ev4.rb +95 -0
  40. data/lib/paseto/operations/pke.rb +57 -0
  41. data/lib/paseto/operations/wrap.rb +29 -0
  42. data/lib/paseto/paserk.rb +55 -0
  43. data/lib/paseto/paserk_types.rb +46 -0
  44. data/lib/paseto/protocol/version3.rb +100 -0
  45. data/lib/paseto/protocol/version4.rb +99 -0
  46. data/lib/paseto/result.rb +9 -0
  47. data/lib/paseto/serializer/optional_json.rb +30 -0
  48. data/lib/paseto/serializer/raw.rb +23 -0
  49. data/lib/paseto/sodium/curve_25519.rb +46 -0
  50. data/lib/paseto/sodium/safe_ed25519_loader.rb +19 -0
  51. data/lib/paseto/sodium/stream/base.rb +82 -0
  52. data/lib/paseto/sodium/stream/x_cha_cha20_xor.rb +31 -0
  53. data/lib/paseto/sodium.rb +5 -0
  54. data/lib/paseto/symmetric_key.rb +119 -0
  55. data/lib/paseto/token.rb +127 -0
  56. data/lib/paseto/token_types.rb +29 -0
  57. data/lib/paseto/util.rb +105 -0
  58. data/lib/paseto/v3/local.rb +63 -0
  59. data/lib/paseto/v3/public.rb +204 -0
  60. data/lib/paseto/v4/local.rb +56 -0
  61. data/lib/paseto/v4/public.rb +169 -0
  62. data/lib/paseto/validator.rb +154 -0
  63. data/lib/paseto/verifiers/footer.rb +30 -0
  64. data/lib/paseto/verifiers/payload.rb +42 -0
  65. data/lib/paseto/verify.rb +48 -0
  66. data/lib/paseto/version.rb +6 -0
  67. data/lib/paseto/versions.rb +25 -0
  68. data/lib/paseto/wrappers/pie/pie_v3.rb +72 -0
  69. data/lib/paseto/wrappers/pie/pie_v4.rb +72 -0
  70. data/lib/paseto/wrappers/pie.rb +71 -0
  71. data/lib/paseto.rb +99 -0
  72. data/paseto.gemspec +58 -0
  73. data/sorbet/config +3 -0
  74. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  75. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  76. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1083 -0
  77. data/sorbet/rbi/gems/docile@1.4.0.rbi +376 -0
  78. data/sorbet/rbi/gems/ffi@1.15.5.rbi +1994 -0
  79. data/sorbet/rbi/gems/io-console@0.5.11.rbi +8 -0
  80. data/sorbet/rbi/gems/irb@1.5.1.rbi +342 -0
  81. data/sorbet/rbi/gems/json@2.6.3.rbi +1541 -0
  82. data/sorbet/rbi/gems/multi_json@1.15.0.rbi +267 -0
  83. data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
  84. data/sorbet/rbi/gems/oj@3.13.23.rbi +603 -0
  85. data/sorbet/rbi/gems/openssl@3.0.1.rbi +1735 -0
  86. data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
  87. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +407 -0
  88. data/sorbet/rbi/gems/rake@13.0.6.rbi +3021 -0
  89. data/sorbet/rbi/gems/rbnacl@7.1.1.rbi +3218 -0
  90. data/sorbet/rbi/gems/regexp_parser@2.6.1.rbi +3481 -0
  91. data/sorbet/rbi/gems/reline@0.3.1.rbi +8 -0
  92. data/sorbet/rbi/gems/rexml@3.2.5.rbi +4717 -0
  93. data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +10887 -0
  94. data/sorbet/rbi/gems/rspec-expectations@3.12.0.rbi +8090 -0
  95. data/sorbet/rbi/gems/rspec-mocks@3.12.0.rbi +5300 -0
  96. data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +1617 -0
  97. data/sorbet/rbi/gems/rspec@3.12.0.rbi +88 -0
  98. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +1239 -0
  99. data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +219 -0
  100. data/sorbet/rbi/gems/simplecov@0.21.2.rbi +2135 -0
  101. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +8 -0
  102. data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
  103. data/sorbet/rbi/gems/timecop@0.9.6.rbi +350 -0
  104. data/sorbet/rbi/gems/unicode-display_width@2.3.0.rbi +48 -0
  105. data/sorbet/rbi/gems/webrick@1.7.0.rbi +2555 -0
  106. data/sorbet/rbi/gems/yard-sorbet@0.7.0.rbi +391 -0
  107. data/sorbet/rbi/gems/yard@0.9.28.rbi +17816 -0
  108. data/sorbet/rbi/gems/zeitwerk@2.6.6.rbi +950 -0
  109. data/sorbet/rbi/shims/multi_json.rbi +19 -0
  110. data/sorbet/rbi/shims/openssl.rbi +111 -0
  111. data/sorbet/rbi/shims/rbnacl.rbi +65 -0
  112. data/sorbet/rbi/shims/zeitwerk.rbi +6 -0
  113. data/sorbet/rbi/todo.rbi +7 -0
  114. data/sorbet/tapioca/config.yml +30 -0
  115. data/sorbet/tapioca/require.rb +12 -0
  116. metadata +376 -0
@@ -0,0 +1,2135 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `simplecov` gem.
5
+ # Please instead update this file by running `bin/tapioca gem simplecov`.
6
+
7
+ # Code coverage for ruby. Please check out README for a full introduction.
8
+ #
9
+ # source://simplecov//lib/simplecov.rb#22
10
+ module SimpleCov
11
+ extend ::SimpleCov::Configuration
12
+
13
+ class << self
14
+ # source://simplecov//lib/simplecov.rb#174
15
+ def at_exit_behavior; end
16
+
17
+ # Clear out the previously cached .result. Primarily useful in testing
18
+ #
19
+ # source://simplecov//lib/simplecov.rb#170
20
+ def clear_result; end
21
+
22
+ # Collate a series of SimpleCov result files into a single SimpleCov output.
23
+ #
24
+ # You can optionally specify configuration with a block:
25
+ # SimpleCov.collate Dir["simplecov-resultset-*/.resultset.json"]
26
+ # OR
27
+ # SimpleCov.collate Dir["simplecov-resultset-*/.resultset.json"], 'rails' # using rails profile
28
+ # OR
29
+ # SimpleCov.collate Dir["simplecov-resultset-*/.resultset.json"] do
30
+ # add_filter 'test'
31
+ # end
32
+ # OR
33
+ # SimpleCov.collate Dir["simplecov-resultset-*/.resultset.json"], 'rails' do
34
+ # add_filter 'test'
35
+ # end
36
+ #
37
+ # Please check out the RDoc for SimpleCov::Configuration to find about
38
+ # available config options, or checkout the README for more in-depth
39
+ # information about coverage collation
40
+ #
41
+ # By default `collate` ignores the merge_timeout so all results of all files specified will be
42
+ # merged together. If you want to honor the merge_timeout then provide the keyword argument
43
+ # `ignore_timeout: false`.
44
+ #
45
+ # source://simplecov//lib/simplecov.rb#86
46
+ def collate(result_filenames, profile = T.unsafe(nil), ignore_timeout: T.unsafe(nil), &block); end
47
+
48
+ # Thinking: Move this behavior earlier so if there was an error we do nothing?
49
+ #
50
+ # @api private
51
+ #
52
+ # source://simplecov//lib/simplecov.rb#223
53
+ def exit_and_report_previous_error(exit_status); end
54
+
55
+ # Returns the exit status from the exit exception
56
+ #
57
+ # @api private
58
+ #
59
+ # source://simplecov//lib/simplecov.rb#200
60
+ def exit_status_from_exception; end
61
+
62
+ # Basically, should we take care of at_exit behavior or something else?
63
+ # Used by the minitest plugin. See lib/minitest/simplecov_plugin.rb
64
+ #
65
+ # source://simplecov//lib/simplecov.rb#28
66
+ def external_at_exit; end
67
+
68
+ # Basically, should we take care of at_exit behavior or something else?
69
+ # Used by the minitest plugin. See lib/minitest/simplecov_plugin.rb
70
+ #
71
+ # source://simplecov//lib/simplecov.rb#28
72
+ def external_at_exit=(_arg0); end
73
+
74
+ # Basically, should we take care of at_exit behavior or something else?
75
+ # Used by the minitest plugin. See lib/minitest/simplecov_plugin.rb
76
+ #
77
+ # source://simplecov//lib/simplecov.rb#28
78
+ def external_at_exit?; end
79
+
80
+ # Applies the configured filters to the given array of SimpleCov::SourceFile items
81
+ #
82
+ # source://simplecov//lib/simplecov.rb#131
83
+ def filtered(files); end
84
+
85
+ # @api private
86
+ # @return [Boolean]
87
+ #
88
+ # source://simplecov//lib/simplecov.rb#268
89
+ def final_result_process?; end
90
+
91
+ # Applies the configured groups to the given array of SimpleCov::SourceFile items
92
+ #
93
+ # source://simplecov//lib/simplecov.rb#142
94
+ def grouped(files); end
95
+
96
+ # source://simplecov//lib/simplecov.rb#162
97
+ def load_adapter(name); end
98
+
99
+ # Applies the profile of given name on SimpleCov configuration
100
+ #
101
+ # source://simplecov//lib/simplecov.rb#158
102
+ def load_profile(name); end
103
+
104
+ # Returns the value of attribute pid.
105
+ #
106
+ # source://simplecov//lib/simplecov.rb#24
107
+ def pid; end
108
+
109
+ # Sets the attribute pid
110
+ #
111
+ # @param value the value to set the attribute pid to.
112
+ #
113
+ # source://simplecov//lib/simplecov.rb#24
114
+ def pid=(_arg0); end
115
+
116
+ # @api private
117
+ # @return [Boolean]
118
+ #
119
+ # source://simplecov//lib/simplecov.rb#213
120
+ def previous_error?(error_exit_status); end
121
+
122
+ # Usage:
123
+ # exit_status = SimpleCov.process_result(SimpleCov.result, exit_status)
124
+ #
125
+ # @api private
126
+ #
127
+ # source://simplecov//lib/simplecov.rb#248
128
+ def process_result(result); end
129
+
130
+ # source://simplecov//lib/simplecov.rb#233
131
+ def process_results_and_report_error; end
132
+
133
+ # @api private
134
+ # @return [Boolean]
135
+ #
136
+ # source://simplecov//lib/simplecov.rb#229
137
+ def ready_to_process_results?; end
138
+
139
+ # Returns the result for the current coverage run, merging it across test suites
140
+ # from cache using SimpleCov::ResultMerger if use_merging is activated (default)
141
+ #
142
+ # source://simplecov//lib/simplecov.rb#101
143
+ def result; end
144
+
145
+ # Returns nil if the result has not been computed
146
+ # Otherwise, returns the result
147
+ #
148
+ # @return [Boolean]
149
+ #
150
+ # source://simplecov//lib/simplecov.rb#124
151
+ def result?; end
152
+
153
+ # source://simplecov//lib/simplecov.rb#256
154
+ def result_exit_status(result); end
155
+
156
+ # Rounding down to be extra strict, see #679
157
+ #
158
+ # @api private
159
+ #
160
+ # source://simplecov//lib/simplecov.rb#296
161
+ def round_coverage(coverage); end
162
+
163
+ # Called from at_exit block
164
+ #
165
+ # @api private
166
+ #
167
+ # source://simplecov//lib/simplecov.rb#186
168
+ def run_exit_tasks!; end
169
+
170
+ # Returns the value of attribute running.
171
+ #
172
+ # source://simplecov//lib/simplecov.rb#24
173
+ def running; end
174
+
175
+ # Sets the attribute running
176
+ #
177
+ # @param value the value to set the attribute running to.
178
+ #
179
+ # source://simplecov//lib/simplecov.rb#24
180
+ def running=(_arg0); end
181
+
182
+ # Sets up SimpleCov to run against your project.
183
+ # You can optionally specify a profile to use as well as configuration with a block:
184
+ # SimpleCov.start
185
+ # OR
186
+ # SimpleCov.start 'rails' # using rails profile
187
+ # OR
188
+ # SimpleCov.start do
189
+ # add_filter 'test'
190
+ # end
191
+ # OR
192
+ # SimpleCov.start 'rails' do
193
+ # add_filter 'test'
194
+ # end
195
+ #
196
+ # Please check out the RDoc for SimpleCov::Configuration to find about available config options
197
+ #
198
+ # source://simplecov//lib/simplecov.rb#48
199
+ def start(profile = T.unsafe(nil), &block); end
200
+
201
+ # @api private
202
+ #
203
+ # source://simplecov//lib/simplecov.rb#276
204
+ def wait_for_other_processes; end
205
+
206
+ # @api private
207
+ #
208
+ # source://simplecov//lib/simplecov.rb#285
209
+ def write_last_run(result); end
210
+
211
+ private
212
+
213
+ # Unite the result so it wouldn't matter what coverage type was called
214
+ #
215
+ # @return [Hash]
216
+ #
217
+ # source://simplecov//lib/simplecov.rb#397
218
+ def adapt_coverage_result; end
219
+
220
+ # Finds files that were to be tracked but were not loaded and initializes
221
+ # the line-by-line coverage to zero (if relevant) or nil (comments / whitespace etc).
222
+ #
223
+ # source://simplecov//lib/simplecov.rb#369
224
+ def add_not_loaded_files(result); end
225
+
226
+ # source://simplecov//lib/simplecov.rb#302
227
+ def initial_setup(profile, &block); end
228
+
229
+ # source://simplecov//lib/simplecov.rb#361
230
+ def lookup_corresponding_ruby_coverage_name(criterion); end
231
+
232
+ # parallel_tests isn't always available, see: https://github.com/grosser/parallel_tests/issues/772
233
+ #
234
+ # source://simplecov//lib/simplecov.rb#423
235
+ def make_parallel_tests_available; end
236
+
237
+ # @return [Boolean]
238
+ #
239
+ # source://simplecov//lib/simplecov.rb#432
240
+ def probably_running_parallel_tests?; end
241
+
242
+ # Call steps that handle process coverage result
243
+ #
244
+ # @return [Hash]
245
+ #
246
+ # source://simplecov//lib/simplecov.rb#386
247
+ def process_coverage_result; end
248
+
249
+ # Filter coverage result
250
+ # The result before filter also has result of coverage for files
251
+ # are not related to the project like loaded gems coverage.
252
+ #
253
+ # @return [Hash]
254
+ #
255
+ # source://simplecov//lib/simplecov.rb#408
256
+ def remove_useless_results; end
257
+
258
+ # Initialize result with files that are not included by coverage
259
+ # and added inside the config block
260
+ #
261
+ # @return [Hash]
262
+ #
263
+ # source://simplecov//lib/simplecov.rb#418
264
+ def result_with_not_loaded_files; end
265
+
266
+ # Trigger Coverage.start depends on given config coverage_criterion
267
+ #
268
+ # With Positive branch it supports all coverage measurement types
269
+ # With Negative branch it supports only line coverage measurement type
270
+ #
271
+ # source://simplecov//lib/simplecov.rb#314
272
+ def start_coverage_measurement; end
273
+
274
+ # source://simplecov//lib/simplecov.rb#349
275
+ def start_coverage_with_criteria; end
276
+ end
277
+ end
278
+
279
+ # source://simplecov//lib/simplecov/filter.rb#77
280
+ class SimpleCov::ArrayFilter < ::SimpleCov::Filter
281
+ # @return [ArrayFilter] a new instance of ArrayFilter
282
+ #
283
+ # source://simplecov//lib/simplecov/filter.rb#78
284
+ def initialize(filter_argument); end
285
+
286
+ # Returns true if any of the filters in the array match the given source file.
287
+ # Configure this Filter like StringFilter.new(['some/path', /^some_regex/, Proc.new {|src_file| ... }])
288
+ #
289
+ # @return [Boolean]
290
+ #
291
+ # source://simplecov//lib/simplecov/filter.rb#88
292
+ def matches?(source_files_list); end
293
+ end
294
+
295
+ # source://simplecov//lib/simplecov/filter.rb#71
296
+ class SimpleCov::BlockFilter < ::SimpleCov::Filter
297
+ # Returns true if the block given when initializing this filter with BlockFilter.new {|src_file| ... }
298
+ # returns true for the given source file.
299
+ #
300
+ # @return [Boolean]
301
+ #
302
+ # source://simplecov//lib/simplecov/filter.rb#72
303
+ def matches?(source_file); end
304
+ end
305
+
306
+ # Functionally for combining coverage results
307
+ #
308
+ # source://simplecov//lib/simplecov/combine.rb#6
309
+ module SimpleCov::Combine
310
+ private
311
+
312
+ # Combine two coverage based on the given combiner_module.
313
+ #
314
+ # Combiners should always be called through this interface,
315
+ # as it takes care of short-circuiting of one of the coverages is nil.
316
+ #
317
+ # @return [Hash]
318
+ #
319
+ # source://simplecov//lib/simplecov/combine.rb#16
320
+ def combine(combiner_module, coverage_a, coverage_b); end
321
+
322
+ # source://simplecov//lib/simplecov/combine.rb#22
323
+ def empty_coverage?(coverage_a, coverage_b); end
324
+
325
+ # source://simplecov//lib/simplecov/combine.rb#26
326
+ def existing_coverage(coverage_a, coverage_b); end
327
+
328
+ class << self
329
+ # Combine two coverage based on the given combiner_module.
330
+ #
331
+ # Combiners should always be called through this interface,
332
+ # as it takes care of short-circuiting of one of the coverages is nil.
333
+ #
334
+ # @return [Hash]
335
+ #
336
+ # source://simplecov//lib/simplecov/combine.rb#16
337
+ def combine(combiner_module, coverage_a, coverage_b); end
338
+
339
+ # @return [Boolean]
340
+ #
341
+ # source://simplecov//lib/simplecov/combine.rb#22
342
+ def empty_coverage?(coverage_a, coverage_b); end
343
+
344
+ # source://simplecov//lib/simplecov/combine.rb#26
345
+ def existing_coverage(coverage_a, coverage_b); end
346
+ end
347
+ end
348
+
349
+ # Combine different branch coverage results on single file.
350
+ #
351
+ # Should be called through `SimpleCov.combine`.
352
+ #
353
+ # source://simplecov//lib/simplecov/combine/branches_combiner.rb#9
354
+ module SimpleCov::Combine::BranchesCombiner
355
+ private
356
+
357
+ # Return merged branches or the existed brach if other is missing.
358
+ #
359
+ # Branches inside files are always same if they exist, the difference only in coverage count.
360
+ # Branch coverage report for any conditional case is built from hash, it's key is a condition and
361
+ # it's body is a hash << keys from condition and value is coverage rate >>.
362
+ # ex: branches =>{ [:if, 3, 8, 6, 8, 36] => {[:then, 4, 8, 6, 8, 12] => 1, [:else, 5, 8, 6, 8, 36]=>2}, other conditions...}
363
+ # We create copy of result and update it values depending on the combined branches coverage values.
364
+ #
365
+ # @return [Hash]
366
+ #
367
+ # source://simplecov//lib/simplecov/combine/branches_combiner.rb#23
368
+ def combine(coverage_a, coverage_b); end
369
+
370
+ class << self
371
+ # Return merged branches or the existed brach if other is missing.
372
+ #
373
+ # Branches inside files are always same if they exist, the difference only in coverage count.
374
+ # Branch coverage report for any conditional case is built from hash, it's key is a condition and
375
+ # it's body is a hash << keys from condition and value is coverage rate >>.
376
+ # ex: branches =>{ [:if, 3, 8, 6, 8, 36] => {[:then, 4, 8, 6, 8, 12] => 1, [:else, 5, 8, 6, 8, 36]=>2}, other conditions...}
377
+ # We create copy of result and update it values depending on the combined branches coverage values.
378
+ #
379
+ # @return [Hash]
380
+ #
381
+ # source://simplecov//lib/simplecov/combine/branches_combiner.rb#23
382
+ def combine(coverage_a, coverage_b); end
383
+ end
384
+ end
385
+
386
+ # Handle combining two coverage results for same file
387
+ #
388
+ # Should be called through `SimpleCov.combine`.
389
+ #
390
+ # source://simplecov//lib/simplecov/combine/files_combiner.rb#9
391
+ module SimpleCov::Combine::FilesCombiner
392
+ private
393
+
394
+ # Combines the results for 2 coverages of a file.
395
+ #
396
+ # @return [Hash]
397
+ #
398
+ # source://simplecov//lib/simplecov/combine/files_combiner.rb#17
399
+ def combine(coverage_a, coverage_b); end
400
+
401
+ class << self
402
+ # Combines the results for 2 coverages of a file.
403
+ #
404
+ # @return [Hash]
405
+ #
406
+ # source://simplecov//lib/simplecov/combine/files_combiner.rb#17
407
+ def combine(coverage_a, coverage_b); end
408
+ end
409
+ end
410
+
411
+ # Combine two different lines coverage results on same file
412
+ #
413
+ # Should be called through `SimpleCov.combine`.
414
+ #
415
+ # source://simplecov//lib/simplecov/combine/lines_combiner.rb#9
416
+ module SimpleCov::Combine::LinesCombiner
417
+ private
418
+
419
+ # source://simplecov//lib/simplecov/combine/lines_combiner.rb#12
420
+ def combine(coverage_a, coverage_b); end
421
+
422
+ # Return depends on coverage in a specific line
423
+ #
424
+ # Logic:
425
+ #
426
+ # => nil + 0 = nil
427
+ # => nil + nil = nil
428
+ # => int + int = int
429
+ #
430
+ # @param first_val [Integer || nil]
431
+ # @param second_val [Integer || nil]
432
+ # @return [Integer || nil]
433
+ #
434
+ # source://simplecov//lib/simplecov/combine/lines_combiner.rb#32
435
+ def merge_line_coverage(first_val, second_val); end
436
+
437
+ class << self
438
+ # source://simplecov//lib/simplecov/combine/lines_combiner.rb#12
439
+ def combine(coverage_a, coverage_b); end
440
+
441
+ # Return depends on coverage in a specific line
442
+ #
443
+ # Logic:
444
+ #
445
+ # => nil + 0 = nil
446
+ # => nil + nil = nil
447
+ # => int + int = int
448
+ #
449
+ # @param first_val [Integer || nil]
450
+ # @param second_val [Integer || nil]
451
+ # @return [Integer || nil]
452
+ #
453
+ # source://simplecov//lib/simplecov/combine/lines_combiner.rb#32
454
+ def merge_line_coverage(first_val, second_val); end
455
+ end
456
+ end
457
+
458
+ # There might be reports from different kinds of tests,
459
+ # e.g. RSpec and Cucumber. We need to combine their results
460
+ # into unified one. This class does that.
461
+ # To unite the results on file basis, it leverages
462
+ # the combine of lines and branches inside each file within given results.
463
+ #
464
+ # source://simplecov//lib/simplecov/combine/results_combiner.rb#10
465
+ module SimpleCov::Combine::ResultsCombiner
466
+ private
467
+
468
+ # Combine process explanation
469
+ # => ResultCombiner: define all present files between results and start combine on file level.
470
+ # ==> FileCombiner: collect result of next combine levels lines and branches.
471
+ # ===> LinesCombiner: combine lines results.
472
+ # ===> BranchesCombiner: combine branches results.
473
+ #
474
+ # @return [Hash]
475
+ #
476
+ # source://simplecov//lib/simplecov/combine/results_combiner.rb#22
477
+ def combine(*results); end
478
+
479
+ # Combine two files coverage results
480
+ #
481
+ # @param coverage_a [Hash]
482
+ # @param coverage_b [Hash]
483
+ # @return [Hash]
484
+ #
485
+ # source://simplecov//lib/simplecov/combine/results_combiner.rb#55
486
+ def combine_file_coverage(coverage_a, coverage_b); end
487
+
488
+ # Manage combining results on files level
489
+ #
490
+ # @param combined_results [Hash]
491
+ # @param result [Hash]
492
+ # @return [Hash]
493
+ #
494
+ # source://simplecov//lib/simplecov/combine/results_combiner.rb#36
495
+ def combine_result_sets(combined_results, result); end
496
+
497
+ class << self
498
+ # Combine process explanation
499
+ # => ResultCombiner: define all present files between results and start combine on file level.
500
+ # ==> FileCombiner: collect result of next combine levels lines and branches.
501
+ # ===> LinesCombiner: combine lines results.
502
+ # ===> BranchesCombiner: combine branches results.
503
+ #
504
+ # @return [Hash]
505
+ #
506
+ # source://simplecov//lib/simplecov/combine/results_combiner.rb#22
507
+ def combine(*results); end
508
+
509
+ # Combine two files coverage results
510
+ #
511
+ # @param coverage_a [Hash]
512
+ # @param coverage_b [Hash]
513
+ # @return [Hash]
514
+ #
515
+ # source://simplecov//lib/simplecov/combine/results_combiner.rb#55
516
+ def combine_file_coverage(coverage_a, coverage_b); end
517
+
518
+ # Manage combining results on files level
519
+ #
520
+ # @param combined_results [Hash]
521
+ # @param result [Hash]
522
+ # @return [Hash]
523
+ #
524
+ # source://simplecov//lib/simplecov/combine/results_combiner.rb#36
525
+ def combine_result_sets(combined_results, result); end
526
+ end
527
+ end
528
+
529
+ # Helper that tries to find out what test suite is running (for SimpleCov.command_name)
530
+ #
531
+ # source://simplecov//lib/simplecov/command_guesser.rb#7
532
+ module SimpleCov::CommandGuesser
533
+ class << self
534
+ # source://simplecov//lib/simplecov/command_guesser.rb#16
535
+ def guess; end
536
+
537
+ # Storage for the original command line call that invoked the test suite.
538
+ # This has got to be stored as early as possible because i.e. rake and test/unit 2
539
+ # have a habit of tampering with ARGV, which makes i.e. the automatic distinction
540
+ # between rails unit/functional/integration tests impossible without this cached
541
+ # item.
542
+ #
543
+ # source://simplecov//lib/simplecov/command_guesser.rb#14
544
+ def original_run_command; end
545
+
546
+ # Storage for the original command line call that invoked the test suite.
547
+ # This has got to be stored as early as possible because i.e. rake and test/unit 2
548
+ # have a habit of tampering with ARGV, which makes i.e. the automatic distinction
549
+ # between rails unit/functional/integration tests impossible without this cached
550
+ # item.
551
+ #
552
+ # source://simplecov//lib/simplecov/command_guesser.rb#14
553
+ def original_run_command=(_arg0); end
554
+
555
+ private
556
+
557
+ # source://simplecov//lib/simplecov/command_guesser.rb#31
558
+ def from_command_line_options; end
559
+
560
+ # source://simplecov//lib/simplecov/command_guesser.rb#46
561
+ def from_defined_constants; end
562
+
563
+ # source://simplecov//lib/simplecov/command_guesser.rb#22
564
+ def from_env; end
565
+ end
566
+ end
567
+
568
+ # Bundles the configuration options used for SimpleCov. All methods
569
+ # defined here are usable from SimpleCov directly. Please check out
570
+ # SimpleCov documentation for further info.
571
+ #
572
+ # source://simplecov//lib/simplecov/configuration.rb#13
573
+ module SimpleCov::Configuration
574
+ # source://simplecov//lib/simplecov/configuration.rb#161
575
+ def adapters; end
576
+
577
+ # Add a filter to the processing chain.
578
+ # There are four ways to define a filter:
579
+ #
580
+ # * as a String that will then be matched against all source files' file paths,
581
+ # SimpleCov.add_filter 'app/models' # will reject all your models
582
+ # * as a block which will be passed the source file in question and should either
583
+ # return a true or false value, depending on whether the file should be removed
584
+ # SimpleCov.add_filter do |src_file|
585
+ # File.basename(src_file.filename) == 'environment.rb'
586
+ # end # Will exclude environment.rb files from the results
587
+ # * as an array of strings that are matched against all sorce files' file
588
+ # paths and then ignored (basically string filter multiple times)
589
+ # SimpleCov.add_filter ['app/models', 'app/helpers'] # ignores both dirs
590
+ # * as an instance of a subclass of SimpleCov::Filter. See the documentation there
591
+ # on how to define your own filter classes
592
+ #
593
+ # source://simplecov//lib/simplecov/configuration.rb#367
594
+ def add_filter(filter_argument = T.unsafe(nil), &filter_proc); end
595
+
596
+ # Define a group for files. Works similar to add_filter, only that the first
597
+ # argument is the desired group name and files PASSING the filter end up in the group
598
+ # (while filters exclude when the filter is applicable).
599
+ #
600
+ # source://simplecov//lib/simplecov/configuration.rb#376
601
+ def add_group(group_name, filter_argument = T.unsafe(nil), &filter_proc); end
602
+
603
+ # Gets or sets the behavior to process coverage results.
604
+ #
605
+ # By default, it will call SimpleCov.result.format!
606
+ #
607
+ # Configure with:
608
+ #
609
+ # SimpleCov.at_exit do
610
+ # puts "Coverage done"
611
+ # SimpleCov.result.format!
612
+ # end
613
+ #
614
+ # source://simplecov//lib/simplecov/configuration.rb#193
615
+ def at_exit(&block); end
616
+
617
+ # Gets or sets the behavior to start a new forked Process.
618
+ #
619
+ # By default, it will add " (Process #{pid})" to the command_name, and start SimpleCov in quiet mode
620
+ #
621
+ # Configure with:
622
+ #
623
+ # SimpleCov.at_fork do |pid|
624
+ # SimpleCov.start do
625
+ # # This needs a unique name so it won't be ovewritten
626
+ # SimpleCov.command_name "#{SimpleCov.command_name} (subprocess: #{pid})"
627
+ # # be quiet, the parent process will be in charge of using the regular formatter and checking coverage totals
628
+ # SimpleCov.print_error_status = false
629
+ # SimpleCov.formatter SimpleCov::Formatter::SimpleFormatter
630
+ # SimpleCov.minimum_coverage 0
631
+ # # start
632
+ # SimpleCov.start
633
+ # end
634
+ # end
635
+ #
636
+ # source://simplecov//lib/simplecov/configuration.rb#233
637
+ def at_fork(&block); end
638
+
639
+ # @return [Boolean]
640
+ #
641
+ # source://simplecov//lib/simplecov/configuration.rb#428
642
+ def branch_coverage?; end
643
+
644
+ # @return [Boolean]
645
+ #
646
+ # source://simplecov//lib/simplecov/configuration.rb#432
647
+ def branch_coverage_supported?; end
648
+
649
+ # source://simplecov//lib/simplecov/configuration.rb#424
650
+ def clear_coverage_criteria; end
651
+
652
+ # The name of the command (a.k.a. Test Suite) currently running. Used for result
653
+ # merging and caching. It first tries to make a guess based upon the command line
654
+ # arguments the current test suite is running on and should automatically detect
655
+ # unit tests, functional tests, integration tests, rpsec and cucumber and label
656
+ # them properly. If it fails to recognize the current command, the command name
657
+ # is set to the shell command that the current suite is running on.
658
+ #
659
+ # You can specify it manually with SimpleCov.command_name("test:units") - please
660
+ # also check out the corresponding section in README.rdoc
661
+ #
662
+ # source://simplecov//lib/simplecov/configuration.rb#87
663
+ def command_name(name = T.unsafe(nil)); end
664
+
665
+ # Allows you to configure simplecov in a block instead of prepending SimpleCov to all config methods
666
+ # you're calling.
667
+ #
668
+ # SimpleCov.configure do
669
+ # add_filter 'foobar'
670
+ # end
671
+ #
672
+ # This is equivalent to SimpleCov.add_filter 'foobar' and thus makes it easier to set a bunch of configure
673
+ # options at once.
674
+ #
675
+ # source://simplecov//lib/simplecov/configuration.rb#177
676
+ def configure(&block); end
677
+
678
+ # source://simplecov//lib/simplecov/configuration.rb#416
679
+ def coverage_criteria; end
680
+
681
+ # Define which coverage criterion should be evaluated.
682
+ #
683
+ # Possible coverage criteria:
684
+ # * :line - coverage based on lines aka has this line been executed?
685
+ # * :branch - coverage based on branches aka has this branch (think conditions) been executed?
686
+ #
687
+ # If not set the default is `:line`
688
+ #
689
+ # @param criterion [Symbol]
690
+ #
691
+ # source://simplecov//lib/simplecov/configuration.rb#393
692
+ def coverage_criterion(criterion = T.unsafe(nil)); end
693
+
694
+ # @return [Boolean]
695
+ #
696
+ # source://simplecov//lib/simplecov/configuration.rb#420
697
+ def coverage_criterion_enabled?(criterion); end
698
+
699
+ # The name of the output and cache directory. Defaults to 'coverage'
700
+ #
701
+ # Configure with SimpleCov.coverage_dir('cov')
702
+ #
703
+ # source://simplecov//lib/simplecov/configuration.rb#34
704
+ def coverage_dir(dir = T.unsafe(nil)); end
705
+
706
+ # Returns the full path to the output directory using SimpleCov.root
707
+ # and SimpleCov.coverage_dir, so you can adjust this by configuring those
708
+ # values. Will create the directory if it's missing
709
+ #
710
+ # source://simplecov//lib/simplecov/configuration.rb#46
711
+ def coverage_path; end
712
+
713
+ # @return [Boolean]
714
+ #
715
+ # source://simplecov//lib/simplecov/configuration.rb#432
716
+ def coverage_start_arguments_supported?; end
717
+
718
+ # source://simplecov//lib/simplecov/configuration.rb#401
719
+ def enable_coverage(criterion); end
720
+
721
+ # gets or sets the enabled_for_subprocess configuration
722
+ # when true, this will inject SimpleCov code into Process.fork
723
+ #
724
+ # source://simplecov//lib/simplecov/configuration.rb#202
725
+ def enable_for_subprocesses(value = T.unsafe(nil)); end
726
+
727
+ # gets the enabled_for_subprocess configuration
728
+ #
729
+ # @return [Boolean]
730
+ #
731
+ # source://simplecov//lib/simplecov/configuration.rb#209
732
+ def enabled_for_subprocesses?; end
733
+
734
+ # Returns the list of configured filters. Add filters using SimpleCov.add_filter.
735
+ #
736
+ # source://simplecov//lib/simplecov/configuration.rb#74
737
+ def filters; end
738
+
739
+ # Sets the attribute filters
740
+ #
741
+ # @param value the value to set the attribute filters to.
742
+ #
743
+ # source://simplecov//lib/simplecov/configuration.rb#14
744
+ def filters=(_arg0); end
745
+
746
+ # Gets or sets the configured formatter.
747
+ #
748
+ # Configure with: SimpleCov.formatter(SimpleCov::Formatter::SimpleFormatter)
749
+ #
750
+ # source://simplecov//lib/simplecov/configuration.rb#98
751
+ def formatter(formatter = T.unsafe(nil)); end
752
+
753
+ # Sets the attribute formatter
754
+ #
755
+ # @param value the value to set the attribute formatter to.
756
+ #
757
+ # source://simplecov//lib/simplecov/configuration.rb#14
758
+ def formatter=(_arg0); end
759
+
760
+ # Gets the configured formatters.
761
+ #
762
+ # source://simplecov//lib/simplecov/configuration.rb#117
763
+ def formatters; end
764
+
765
+ # Sets the configured formatters.
766
+ #
767
+ # source://simplecov//lib/simplecov/configuration.rb#110
768
+ def formatters=(formatters); end
769
+
770
+ # Returns the configured groups. Add groups using SimpleCov.add_group
771
+ #
772
+ # source://simplecov//lib/simplecov/configuration.rb#150
773
+ def groups; end
774
+
775
+ # Sets the attribute groups
776
+ #
777
+ # @param value the value to set the attribute groups to.
778
+ #
779
+ # source://simplecov//lib/simplecov/configuration.rb#14
780
+ def groups=(_arg0); end
781
+
782
+ # Defines the maximum coverage drop at once allowed for the testsuite to pass.
783
+ # SimpleCov will return non-zero if the coverage decreases by more than this threshold.
784
+ #
785
+ # Default is 100% (disabled)
786
+ #
787
+ # source://simplecov//lib/simplecov/configuration.rb#313
788
+ def maximum_coverage_drop(coverage_drop = T.unsafe(nil)); end
789
+
790
+ # Defines the maximum age (in seconds) of a resultset to still be included in merged results.
791
+ # i.e. If you run cucumber features, then later rake test, if the stored cucumber resultset is
792
+ # more seconds ago than specified here, it won't be taken into account when merging (and is also
793
+ # purged from the resultset cache)
794
+ #
795
+ # Of course, this only applies when merging is active (e.g. SimpleCov.use_merging is not false!)
796
+ #
797
+ # Default is 600 seconds (10 minutes)
798
+ #
799
+ # Configure with SimpleCov.merge_timeout(3600) # 1hr
800
+ #
801
+ # source://simplecov//lib/simplecov/configuration.rb#279
802
+ def merge_timeout(seconds = T.unsafe(nil)); end
803
+
804
+ # Defines the minimum overall coverage required for the testsuite to pass.
805
+ # SimpleCov will return non-zero if the current coverage is below this threshold.
806
+ #
807
+ # Default is 0% (disabled)
808
+ #
809
+ # source://simplecov//lib/simplecov/configuration.rb#290
810
+ def minimum_coverage(coverage = T.unsafe(nil)); end
811
+
812
+ # Defines the minimum coverage per file required for the testsuite to pass.
813
+ # SimpleCov will return non-zero if the current coverage of the least covered file
814
+ # is below this threshold.
815
+ #
816
+ # Default is 0% (disabled)
817
+ #
818
+ # source://simplecov//lib/simplecov/configuration.rb#330
819
+ def minimum_coverage_by_file(coverage = T.unsafe(nil)); end
820
+
821
+ # Certain code blocks (i.e. Ruby-implementation specific code) can be excluded from
822
+ # the coverage metrics by wrapping it inside # :nocov: comment blocks. The nocov token
823
+ # can be configured to be any other string using this.
824
+ #
825
+ # Configure with SimpleCov.nocov_token('skip') or it's alias SimpleCov.skip_token('skip')
826
+ #
827
+ # source://simplecov//lib/simplecov/configuration.rb#140
828
+ def nocov_token(nocov_token = T.unsafe(nil)); end
829
+
830
+ # source://simplecov//lib/simplecov/configuration.rb#407
831
+ def primary_coverage(criterion = T.unsafe(nil)); end
832
+
833
+ # Whether we should print non-success status codes. This can be
834
+ # configured with the #print_error_status= method.
835
+ #
836
+ # source://simplecov//lib/simplecov/configuration.rb#129
837
+ def print_error_status; end
838
+
839
+ # Sets the attribute print_error_status
840
+ #
841
+ # @param value the value to set the attribute print_error_status to.
842
+ #
843
+ # source://simplecov//lib/simplecov/configuration.rb#14
844
+ def print_error_status=(_arg0); end
845
+
846
+ # Returns the hash of available profiles
847
+ #
848
+ # source://simplecov//lib/simplecov/configuration.rb#157
849
+ def profiles; end
850
+
851
+ # Returns the project name - currently assuming the last dirname in
852
+ # the SimpleCov.root is this.
853
+ #
854
+ # source://simplecov//lib/simplecov/configuration.rb#251
855
+ def project_name(new_name = T.unsafe(nil)); end
856
+
857
+ # source://simplecov//lib/simplecov/configuration.rb#300
858
+ def raise_on_invalid_coverage(coverage, coverage_setting); end
859
+
860
+ # Refuses any coverage drop. That is, coverage is only allowed to increase.
861
+ # SimpleCov will return non-zero if the coverage decreases.
862
+ #
863
+ # source://simplecov//lib/simplecov/configuration.rb#344
864
+ def refuse_coverage_drop(*criteria); end
865
+
866
+ # The root for the project. This defaults to the
867
+ # current working directory.
868
+ #
869
+ # Configure with SimpleCov.root('/my/project/path')
870
+ #
871
+ # source://simplecov//lib/simplecov/configuration.rb#22
872
+ def root(root = T.unsafe(nil)); end
873
+
874
+ # Certain code blocks (i.e. Ruby-implementation specific code) can be excluded from
875
+ # the coverage metrics by wrapping it inside # :nocov: comment blocks. The nocov token
876
+ # can be configured to be any other string using this.
877
+ #
878
+ # Configure with SimpleCov.nocov_token('skip') or it's alias SimpleCov.skip_token('skip')
879
+ #
880
+ # source://simplecov//lib/simplecov/configuration.rb#140
881
+ def skip_token(nocov_token = T.unsafe(nil)); end
882
+
883
+ # Coverage results will always include files matched by this glob, whether
884
+ # or not they were explicitly required. Without this, un-required files
885
+ # will not be present in the final report.
886
+ #
887
+ # source://simplecov//lib/simplecov/configuration.rb#59
888
+ def track_files(glob); end
889
+
890
+ # Returns the glob that will be used to include files that were not
891
+ # explicitly required.
892
+ #
893
+ # source://simplecov//lib/simplecov/configuration.rb#67
894
+ def tracked_files; end
895
+
896
+ # Defines whether to use result merging so all your test suites (test:units, test:functionals, cucumber, ...)
897
+ # are joined and combined into a single coverage report
898
+ #
899
+ # source://simplecov//lib/simplecov/configuration.rb#262
900
+ def use_merging(use = T.unsafe(nil)); end
901
+
902
+ private
903
+
904
+ # source://simplecov//lib/simplecov/configuration.rb#464
905
+ def minimum_possible_coverage_exceeded(coverage_option); end
906
+
907
+ # The actual filter processor. Not meant for direct use
908
+ #
909
+ # source://simplecov//lib/simplecov/configuration.rb#471
910
+ def parse_filter(filter_argument = T.unsafe(nil), &filter_proc); end
911
+
912
+ # source://simplecov//lib/simplecov/configuration.rb#447
913
+ def raise_if_criterion_disabled(criterion); end
914
+
915
+ # source://simplecov//lib/simplecov/configuration.rb#456
916
+ def raise_if_criterion_unsupported(criterion); end
917
+ end
918
+
919
+ # source://simplecov//lib/simplecov/configuration.rb#381
920
+ SimpleCov::Configuration::DEFAULT_COVERAGE_CRITERION = T.let(T.unsafe(nil), Symbol)
921
+
922
+ # source://simplecov//lib/simplecov/configuration.rb#380
923
+ SimpleCov::Configuration::SUPPORTED_COVERAGE_CRITERIA = T.let(T.unsafe(nil), Array)
924
+
925
+ # Holds the individual data of a coverage result.
926
+ #
927
+ # This is uniform across coverage criteria as they all have:
928
+ #
929
+ # * total - how many things to cover there are (total relevant loc/branches)
930
+ # * covered - how many of the coverables are hit
931
+ # * missed - how many of the coverables are missed
932
+ # * percent - percentage as covered/missed
933
+ # * strength - average hits per/coverable (will not exist for one shot lines format)
934
+ #
935
+ # source://simplecov//lib/simplecov/coverage_statistics.rb#13
936
+ class SimpleCov::CoverageStatistics
937
+ # Requires only covered, missed and strength to be initialized.
938
+ #
939
+ # Other values are computed by this class.
940
+ #
941
+ # @return [CoverageStatistics] a new instance of CoverageStatistics
942
+ #
943
+ # source://simplecov//lib/simplecov/coverage_statistics.rb#34
944
+ def initialize(covered:, missed:, total_strength: T.unsafe(nil)); end
945
+
946
+ # Returns the value of attribute covered.
947
+ #
948
+ # source://simplecov//lib/simplecov/coverage_statistics.rb#14
949
+ def covered; end
950
+
951
+ # Returns the value of attribute missed.
952
+ #
953
+ # source://simplecov//lib/simplecov/coverage_statistics.rb#14
954
+ def missed; end
955
+
956
+ # Returns the value of attribute percent.
957
+ #
958
+ # source://simplecov//lib/simplecov/coverage_statistics.rb#14
959
+ def percent; end
960
+
961
+ # Returns the value of attribute strength.
962
+ #
963
+ # source://simplecov//lib/simplecov/coverage_statistics.rb#14
964
+ def strength; end
965
+
966
+ # Returns the value of attribute total.
967
+ #
968
+ # source://simplecov//lib/simplecov/coverage_statistics.rb#14
969
+ def total; end
970
+
971
+ private
972
+
973
+ # source://simplecov//lib/simplecov/coverage_statistics.rb#44
974
+ def compute_percent(covered, missed, total); end
975
+
976
+ # source://simplecov//lib/simplecov/coverage_statistics.rb#50
977
+ def compute_strength(total_strength, total); end
978
+
979
+ class << self
980
+ # source://simplecov//lib/simplecov/coverage_statistics.rb#16
981
+ def from(coverage_statistics); end
982
+ end
983
+ end
984
+
985
+ # source://simplecov//lib/simplecov/exit_codes.rb#4
986
+ module SimpleCov::ExitCodes; end
987
+
988
+ # source://simplecov//lib/simplecov/exit_codes.rb#6
989
+ SimpleCov::ExitCodes::EXCEPTION = T.let(T.unsafe(nil), Integer)
990
+
991
+ # source://simplecov//lib/simplecov/exit_codes/exit_code_handling.rb#5
992
+ module SimpleCov::ExitCodes::ExitCodeHandling
993
+ private
994
+
995
+ # source://simplecov//lib/simplecov/exit_codes/exit_code_handling.rb#8
996
+ def call(result, coverage_limits:); end
997
+
998
+ # source://simplecov//lib/simplecov/exit_codes/exit_code_handling.rb#20
999
+ def coverage_checks(result, coverage_limits); end
1000
+
1001
+ class << self
1002
+ # source://simplecov//lib/simplecov/exit_codes/exit_code_handling.rb#8
1003
+ def call(result, coverage_limits:); end
1004
+
1005
+ # source://simplecov//lib/simplecov/exit_codes/exit_code_handling.rb#20
1006
+ def coverage_checks(result, coverage_limits); end
1007
+ end
1008
+ end
1009
+
1010
+ # source://simplecov//lib/simplecov/exit_codes.rb#8
1011
+ SimpleCov::ExitCodes::MAXIMUM_COVERAGE_DROP = T.let(T.unsafe(nil), Integer)
1012
+
1013
+ # source://simplecov//lib/simplecov/exit_codes.rb#7
1014
+ SimpleCov::ExitCodes::MINIMUM_COVERAGE = T.let(T.unsafe(nil), Integer)
1015
+
1016
+ # source://simplecov//lib/simplecov/exit_codes/maximum_coverage_drop_check.rb#5
1017
+ class SimpleCov::ExitCodes::MaximumCoverageDropCheck
1018
+ # @return [MaximumCoverageDropCheck] a new instance of MaximumCoverageDropCheck
1019
+ #
1020
+ # source://simplecov//lib/simplecov/exit_codes/maximum_coverage_drop_check.rb#6
1021
+ def initialize(result, maximum_coverage_drop); end
1022
+
1023
+ # source://simplecov//lib/simplecov/exit_codes/maximum_coverage_drop_check.rb#28
1024
+ def exit_code; end
1025
+
1026
+ # @return [Boolean]
1027
+ #
1028
+ # source://simplecov//lib/simplecov/exit_codes/maximum_coverage_drop_check.rb#11
1029
+ def failing?; end
1030
+
1031
+ # source://simplecov//lib/simplecov/exit_codes/maximum_coverage_drop_check.rb#17
1032
+ def report; end
1033
+
1034
+ private
1035
+
1036
+ # source://simplecov//lib/simplecov/exit_codes/maximum_coverage_drop_check.rb#49
1037
+ def compute_coverage_drop_data; end
1038
+
1039
+ # source://simplecov//lib/simplecov/exit_codes/maximum_coverage_drop_check.rb#42
1040
+ def coverage_drop_violations; end
1041
+
1042
+ # source://simplecov//lib/simplecov/exit_codes/maximum_coverage_drop_check.rb#61
1043
+ def drop_percent(criterion); end
1044
+
1045
+ # source://simplecov//lib/simplecov/exit_codes/maximum_coverage_drop_check.rb#73
1046
+ def last_coverage(criterion); end
1047
+
1048
+ # source://simplecov//lib/simplecov/exit_codes/maximum_coverage_drop_check.rb#36
1049
+ def last_run; end
1050
+
1051
+ # Returns the value of attribute maximum_coverage_drop.
1052
+ #
1053
+ # source://simplecov//lib/simplecov/exit_codes/maximum_coverage_drop_check.rb#34
1054
+ def maximum_coverage_drop; end
1055
+
1056
+ # Returns the value of attribute result.
1057
+ #
1058
+ # source://simplecov//lib/simplecov/exit_codes/maximum_coverage_drop_check.rb#34
1059
+ def result; end
1060
+ end
1061
+
1062
+ # if anyone says "max_coverage_drop 0.000000000000000001" I appologize. Please don't.
1063
+ #
1064
+ # source://simplecov//lib/simplecov/exit_codes/maximum_coverage_drop_check.rb#60
1065
+ SimpleCov::ExitCodes::MaximumCoverageDropCheck::MAX_DROP_ACCURACY = T.let(T.unsafe(nil), Integer)
1066
+
1067
+ # source://simplecov//lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb#5
1068
+ class SimpleCov::ExitCodes::MinimumCoverageByFileCheck
1069
+ # @return [MinimumCoverageByFileCheck] a new instance of MinimumCoverageByFileCheck
1070
+ #
1071
+ # source://simplecov//lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb#6
1072
+ def initialize(result, minimum_coverage_by_file); end
1073
+
1074
+ # source://simplecov//lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb#26
1075
+ def exit_code; end
1076
+
1077
+ # @return [Boolean]
1078
+ #
1079
+ # source://simplecov//lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb#11
1080
+ def failing?; end
1081
+
1082
+ # source://simplecov//lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb#15
1083
+ def report; end
1084
+
1085
+ private
1086
+
1087
+ # source://simplecov//lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb#41
1088
+ def compute_minimum_coverage_data; end
1089
+
1090
+ # Returns the value of attribute minimum_coverage_by_file.
1091
+ #
1092
+ # source://simplecov//lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb#32
1093
+ def minimum_coverage_by_file; end
1094
+
1095
+ # source://simplecov//lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb#34
1096
+ def minimum_violations; end
1097
+
1098
+ # Returns the value of attribute result.
1099
+ #
1100
+ # source://simplecov//lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb#32
1101
+ def result; end
1102
+ end
1103
+
1104
+ # source://simplecov//lib/simplecov/exit_codes/minimum_overall_coverage_check.rb#5
1105
+ class SimpleCov::ExitCodes::MinimumOverallCoverageCheck
1106
+ # @return [MinimumOverallCoverageCheck] a new instance of MinimumOverallCoverageCheck
1107
+ #
1108
+ # source://simplecov//lib/simplecov/exit_codes/minimum_overall_coverage_check.rb#6
1109
+ def initialize(result, minimum_coverage); end
1110
+
1111
+ # source://simplecov//lib/simplecov/exit_codes/minimum_overall_coverage_check.rb#26
1112
+ def exit_code; end
1113
+
1114
+ # @return [Boolean]
1115
+ #
1116
+ # source://simplecov//lib/simplecov/exit_codes/minimum_overall_coverage_check.rb#11
1117
+ def failing?; end
1118
+
1119
+ # source://simplecov//lib/simplecov/exit_codes/minimum_overall_coverage_check.rb#15
1120
+ def report; end
1121
+
1122
+ private
1123
+
1124
+ # source://simplecov//lib/simplecov/exit_codes/minimum_overall_coverage_check.rb#38
1125
+ def calculate_minimum_violations; end
1126
+
1127
+ # Returns the value of attribute minimum_coverage.
1128
+ #
1129
+ # source://simplecov//lib/simplecov/exit_codes/minimum_overall_coverage_check.rb#32
1130
+ def minimum_coverage; end
1131
+
1132
+ # source://simplecov//lib/simplecov/exit_codes/minimum_overall_coverage_check.rb#34
1133
+ def minimum_violations; end
1134
+
1135
+ # Returns the value of attribute result.
1136
+ #
1137
+ # source://simplecov//lib/simplecov/exit_codes/minimum_overall_coverage_check.rb#32
1138
+ def result; end
1139
+ end
1140
+
1141
+ # source://simplecov//lib/simplecov/exit_codes.rb#5
1142
+ SimpleCov::ExitCodes::SUCCESS = T.let(T.unsafe(nil), Integer)
1143
+
1144
+ # An array of SimpleCov SourceFile instances with additional collection helper
1145
+ # methods for calculating coverage across them etc.
1146
+ #
1147
+ # source://simplecov//lib/simplecov/file_list.rb#6
1148
+ class SimpleCov::FileList
1149
+ include ::Enumerable
1150
+ extend ::Forwardable
1151
+
1152
+ # @return [FileList] a new instance of FileList
1153
+ #
1154
+ # source://simplecov//lib/simplecov/file_list.rb#22
1155
+ def initialize(files); end
1156
+
1157
+ # source://simplecov//lib/simplecov/file_list.rb#101
1158
+ def branch_covered_percent; end
1159
+
1160
+ # source://forwardable/1.3.2/forwardable.rb#229
1161
+ def count(*args, **_arg1, &block); end
1162
+
1163
+ # source://simplecov//lib/simplecov/file_list.rb#26
1164
+ def coverage_statistics; end
1165
+
1166
+ # source://simplecov//lib/simplecov/file_list.rb#30
1167
+ def coverage_statistics_by_file; end
1168
+
1169
+ # Return total count of covered branches
1170
+ #
1171
+ # source://simplecov//lib/simplecov/file_list.rb#92
1172
+ def covered_branches; end
1173
+
1174
+ # Returns the count of lines that have coverage
1175
+ #
1176
+ # source://simplecov//lib/simplecov/file_list.rb#35
1177
+ def covered_lines; end
1178
+
1179
+ # Computes the coverage based upon lines covered and lines missed
1180
+ #
1181
+ # @return [Float]
1182
+ #
1183
+ # source://simplecov//lib/simplecov/file_list.rb#76
1184
+ def covered_percent; end
1185
+
1186
+ # Computes the coverage based upon lines covered and lines missed for each file
1187
+ # Returns an array with all coverage percentages
1188
+ #
1189
+ # source://simplecov//lib/simplecov/file_list.rb#60
1190
+ def covered_percentages; end
1191
+
1192
+ # Computes the strength (hits / line) based upon lines covered and lines missed
1193
+ #
1194
+ # @return [Float]
1195
+ #
1196
+ # source://simplecov//lib/simplecov/file_list.rb#82
1197
+ def covered_strength; end
1198
+
1199
+ # source://forwardable/1.3.2/forwardable.rb#229
1200
+ def each(*args, **_arg1, &block); end
1201
+
1202
+ # source://forwardable/1.3.2/forwardable.rb#229
1203
+ def empty?(*args, **_arg1, &block); end
1204
+
1205
+ # Finds the least covered file and returns that file's name
1206
+ #
1207
+ # source://simplecov//lib/simplecov/file_list.rb#65
1208
+ def least_covered_file; end
1209
+
1210
+ # source://forwardable/1.3.2/forwardable.rb#229
1211
+ def length(*args, **_arg1, &block); end
1212
+
1213
+ # Returns the overall amount of relevant lines of code across all files in this list
1214
+ #
1215
+ # source://simplecov//lib/simplecov/file_list.rb#70
1216
+ def lines_of_code; end
1217
+
1218
+ # source://forwardable/1.3.2/forwardable.rb#229
1219
+ def map(*args, **_arg1, &block); end
1220
+
1221
+ # Return total count of covered branches
1222
+ #
1223
+ # source://simplecov//lib/simplecov/file_list.rb#97
1224
+ def missed_branches; end
1225
+
1226
+ # Returns the count of lines that have been missed
1227
+ #
1228
+ # source://simplecov//lib/simplecov/file_list.rb#40
1229
+ def missed_lines; end
1230
+
1231
+ # Returns the count of lines that are not relevant for coverage
1232
+ #
1233
+ # source://simplecov//lib/simplecov/file_list.rb#45
1234
+ def never_lines; end
1235
+
1236
+ # source://forwardable/1.3.2/forwardable.rb#229
1237
+ def size(*args, **_arg1, &block); end
1238
+
1239
+ # Returns the count of skipped lines
1240
+ #
1241
+ # source://simplecov//lib/simplecov/file_list.rb#52
1242
+ def skipped_lines; end
1243
+
1244
+ # source://forwardable/1.3.2/forwardable.rb#229
1245
+ def to_a(*args, **_arg1, &block); end
1246
+
1247
+ # source://forwardable/1.3.2/forwardable.rb#229
1248
+ def to_ary(*args, **_arg1, &block); end
1249
+
1250
+ # Return total count of branches in all files
1251
+ #
1252
+ # source://simplecov//lib/simplecov/file_list.rb#87
1253
+ def total_branches; end
1254
+
1255
+ private
1256
+
1257
+ # source://simplecov//lib/simplecov/file_list.rb#114
1258
+ def compute_coverage_statistics; end
1259
+
1260
+ # source://simplecov//lib/simplecov/file_list.rb#107
1261
+ def compute_coverage_statistics_by_file; end
1262
+ end
1263
+
1264
+ # Base filter class. Inherit from this to create custom filters,
1265
+ # and overwrite the passes?(source_file) instance method
1266
+ #
1267
+ # # A sample class that rejects all source files.
1268
+ # class StupidFilter < SimpleCov::Filter
1269
+ # def passes?(source_file)
1270
+ # false
1271
+ # end
1272
+ # end
1273
+ #
1274
+ # source://simplecov//lib/simplecov/filter.rb#15
1275
+ class SimpleCov::Filter
1276
+ # @return [Filter] a new instance of Filter
1277
+ #
1278
+ # source://simplecov//lib/simplecov/filter.rb#18
1279
+ def initialize(filter_argument); end
1280
+
1281
+ # Returns the value of attribute filter_argument.
1282
+ #
1283
+ # source://simplecov//lib/simplecov/filter.rb#16
1284
+ def filter_argument; end
1285
+
1286
+ # @return [Boolean]
1287
+ #
1288
+ # source://simplecov//lib/simplecov/filter.rb#22
1289
+ def matches?(_source_file); end
1290
+
1291
+ # @return [Boolean]
1292
+ #
1293
+ # source://simplecov//lib/simplecov/filter.rb#26
1294
+ def passes?(source_file); end
1295
+
1296
+ class << self
1297
+ # source://simplecov//lib/simplecov/filter.rb#31
1298
+ def build_filter(filter_argument); end
1299
+
1300
+ # source://simplecov//lib/simplecov/filter.rb#37
1301
+ def class_for_argument(filter_argument); end
1302
+ end
1303
+ end
1304
+
1305
+ # TODO: Documentation on how to build your own formatters
1306
+ #
1307
+ # source://simplecov//lib/simplecov/formatter/multi_formatter.rb#4
1308
+ module SimpleCov::Formatter
1309
+ class << self
1310
+ # source://simplecov//lib/simplecov/default_formatter.rb#7
1311
+ def from_env(env); end
1312
+ end
1313
+ end
1314
+
1315
+ # source://simplecov//lib/simplecov/formatter/multi_formatter.rb#5
1316
+ class SimpleCov::Formatter::MultiFormatter
1317
+ class << self
1318
+ # source://simplecov//lib/simplecov/formatter/multi_formatter.rb#26
1319
+ def [](*args); end
1320
+
1321
+ # source://simplecov//lib/simplecov/formatter/multi_formatter.rb#17
1322
+ def new(formatters = T.unsafe(nil)); end
1323
+ end
1324
+ end
1325
+
1326
+ # source://simplecov//lib/simplecov/formatter/multi_formatter.rb#6
1327
+ module SimpleCov::Formatter::MultiFormatter::InstanceMethods
1328
+ # source://simplecov//lib/simplecov/formatter/multi_formatter.rb#7
1329
+ def format(result); end
1330
+ end
1331
+
1332
+ # A ridiculously simple formatter for SimpleCov results.
1333
+ #
1334
+ # source://simplecov//lib/simplecov/formatter/simple_formatter.rb#8
1335
+ class SimpleCov::Formatter::SimpleFormatter
1336
+ # Takes a SimpleCov::Result and generates a string out of it
1337
+ #
1338
+ # source://simplecov//lib/simplecov/formatter/simple_formatter.rb#10
1339
+ def format(result); end
1340
+ end
1341
+
1342
+ # source://simplecov//lib/simplecov/last_run.rb#6
1343
+ module SimpleCov::LastRun
1344
+ class << self
1345
+ # source://simplecov//lib/simplecov/last_run.rb#8
1346
+ def last_run_path; end
1347
+
1348
+ # source://simplecov//lib/simplecov/last_run.rb#12
1349
+ def read; end
1350
+
1351
+ # source://simplecov//lib/simplecov/last_run.rb#21
1352
+ def write(json); end
1353
+ end
1354
+ end
1355
+
1356
+ # Classifies whether lines are relevant for code coverage analysis.
1357
+ # Comments & whitespace lines, and :nocov: token blocks, are considered not relevant.
1358
+ #
1359
+ # source://simplecov//lib/simplecov/lines_classifier.rb#7
1360
+ class SimpleCov::LinesClassifier
1361
+ # source://simplecov//lib/simplecov/lines_classifier.rb#33
1362
+ def classify(lines); end
1363
+
1364
+ class << self
1365
+ # source://simplecov//lib/simplecov/lines_classifier.rb#15
1366
+ def no_cov_line; end
1367
+
1368
+ # @return [Boolean]
1369
+ #
1370
+ # source://simplecov//lib/simplecov/lines_classifier.rb#19
1371
+ def no_cov_line?(line); end
1372
+
1373
+ # @return [Boolean]
1374
+ #
1375
+ # source://simplecov//lib/simplecov/lines_classifier.rb#26
1376
+ def whitespace_line?(line); end
1377
+ end
1378
+ end
1379
+
1380
+ # source://simplecov//lib/simplecov/lines_classifier.rb#12
1381
+ SimpleCov::LinesClassifier::COMMENT_LINE = T.let(T.unsafe(nil), Regexp)
1382
+
1383
+ # source://simplecov//lib/simplecov/lines_classifier.rb#9
1384
+ SimpleCov::LinesClassifier::NOT_RELEVANT = T.let(T.unsafe(nil), T.untyped)
1385
+
1386
+ # source://simplecov//lib/simplecov/lines_classifier.rb#8
1387
+ SimpleCov::LinesClassifier::RELEVANT = T.let(T.unsafe(nil), Integer)
1388
+
1389
+ # source://simplecov//lib/simplecov/lines_classifier.rb#11
1390
+ SimpleCov::LinesClassifier::WHITESPACE_LINE = T.let(T.unsafe(nil), Regexp)
1391
+
1392
+ # source://simplecov//lib/simplecov/lines_classifier.rb#13
1393
+ SimpleCov::LinesClassifier::WHITESPACE_OR_COMMENT_LINE = T.let(T.unsafe(nil), Regexp)
1394
+
1395
+ # Profiles are SimpleCov configuration procs that can be easily
1396
+ # loaded using SimpleCov.start :rails and defined using
1397
+ # SimpleCov.profiles.define :foo do
1398
+ # # SimpleCov configuration here, same as in SimpleCov.configure
1399
+ # end
1400
+ #
1401
+ # source://simplecov//lib/simplecov/profiles.rb#17
1402
+ class SimpleCov::Profiles < ::Hash
1403
+ # Define a SimpleCov profile:
1404
+ # SimpleCov.profiles.define 'rails' do
1405
+ # # Same as SimpleCov.configure do .. here
1406
+ # end
1407
+ #
1408
+ # source://simplecov//lib/simplecov/profiles.rb#18
1409
+ def define(name, &blk); end
1410
+
1411
+ # Applies the profile of given name on SimpleCov.configure
1412
+ #
1413
+ # source://simplecov//lib/simplecov/profiles.rb#28
1414
+ def load(name); end
1415
+ end
1416
+
1417
+ # source://simplecov//lib/simplecov/filter.rb#63
1418
+ class SimpleCov::RegexFilter < ::SimpleCov::Filter
1419
+ # Returns true when the given source file's filename matches the
1420
+ # regex configured when initializing this Filter with RegexFilter.new(/someregex/)
1421
+ #
1422
+ # @return [Boolean]
1423
+ #
1424
+ # source://simplecov//lib/simplecov/filter.rb#64
1425
+ def matches?(source_file); end
1426
+ end
1427
+
1428
+ # A simplecov code coverage result, initialized from the Hash Ruby's built-in coverage
1429
+ # library generates (Coverage.result).
1430
+ #
1431
+ # source://simplecov//lib/simplecov/result.rb#11
1432
+ class SimpleCov::Result
1433
+ extend ::Forwardable
1434
+
1435
+ # Initialize a new SimpleCov::Result from given Coverage.result (a Hash of filenames each containing an array of
1436
+ # coverage data)
1437
+ #
1438
+ # @return [Result] a new instance of Result
1439
+ #
1440
+ # source://simplecov//lib/simplecov/result.rb#28
1441
+ def initialize(original_result, command_name: T.unsafe(nil), created_at: T.unsafe(nil)); end
1442
+
1443
+ # The command name that launched this result.
1444
+ # Delegated to SimpleCov.command_name if not set manually
1445
+ #
1446
+ # source://simplecov//lib/simplecov/result.rb#61
1447
+ def command_name; end
1448
+
1449
+ # Explicitly set the command name that was used for this coverage result. Defaults to SimpleCov.command_name
1450
+ #
1451
+ # source://simplecov//lib/simplecov/result.rb#21
1452
+ def command_name=(_arg0); end
1453
+
1454
+ # source://forwardable/1.3.2/forwardable.rb#229
1455
+ def coverage_statistics(*args, **_arg1, &block); end
1456
+
1457
+ # source://forwardable/1.3.2/forwardable.rb#229
1458
+ def coverage_statistics_by_file(*args, **_arg1, &block); end
1459
+
1460
+ # source://forwardable/1.3.2/forwardable.rb#229
1461
+ def covered_branches(*args, **_arg1, &block); end
1462
+
1463
+ # source://forwardable/1.3.2/forwardable.rb#229
1464
+ def covered_lines(*args, **_arg1, &block); end
1465
+
1466
+ # source://forwardable/1.3.2/forwardable.rb#229
1467
+ def covered_percent(*args, **_arg1, &block); end
1468
+
1469
+ # source://forwardable/1.3.2/forwardable.rb#229
1470
+ def covered_percentages(*args, **_arg1, &block); end
1471
+
1472
+ # source://forwardable/1.3.2/forwardable.rb#229
1473
+ def covered_strength(*args, **_arg1, &block); end
1474
+
1475
+ # Defines when this result has been created. Defaults to Time.now
1476
+ #
1477
+ # source://simplecov//lib/simplecov/result.rb#55
1478
+ def created_at; end
1479
+
1480
+ # Explicitly set the Time this result has been created
1481
+ #
1482
+ # source://simplecov//lib/simplecov/result.rb#19
1483
+ def created_at=(_arg0); end
1484
+
1485
+ # Returns all filenames for source files contained in this result
1486
+ #
1487
+ # source://simplecov//lib/simplecov/result.rb#40
1488
+ def filenames; end
1489
+
1490
+ # Returns all files that are applicable to this result (sans filters!) as instances of SimpleCov::SourceFile. Aliased as :source_files
1491
+ #
1492
+ # source://simplecov//lib/simplecov/result.rb#16
1493
+ def files; end
1494
+
1495
+ # Applies the configured SimpleCov.formatter on this result
1496
+ #
1497
+ # source://simplecov//lib/simplecov/result.rb#50
1498
+ def format!; end
1499
+
1500
+ # Returns a Hash of groups for this result. Define groups using SimpleCov.add_group 'Models', 'app/models'
1501
+ #
1502
+ # source://simplecov//lib/simplecov/result.rb#45
1503
+ def groups; end
1504
+
1505
+ # source://forwardable/1.3.2/forwardable.rb#229
1506
+ def least_covered_file(*args, **_arg1, &block); end
1507
+
1508
+ # source://forwardable/1.3.2/forwardable.rb#229
1509
+ def missed_branches(*args, **_arg1, &block); end
1510
+
1511
+ # source://forwardable/1.3.2/forwardable.rb#229
1512
+ def missed_lines(*args, **_arg1, &block); end
1513
+
1514
+ # Returns the original Coverage.result used for this instance of SimpleCov::Result
1515
+ #
1516
+ # source://simplecov//lib/simplecov/result.rb#14
1517
+ def original_result; end
1518
+
1519
+ # Returns all files that are applicable to this result (sans filters!) as instances of SimpleCov::SourceFile. Aliased as :source_files
1520
+ #
1521
+ # source://simplecov//lib/simplecov/result.rb#16
1522
+ def source_files; end
1523
+
1524
+ # Returns a hash representation of this Result that can be used for marshalling it into JSON
1525
+ #
1526
+ # source://simplecov//lib/simplecov/result.rb#66
1527
+ def to_hash; end
1528
+
1529
+ # source://forwardable/1.3.2/forwardable.rb#229
1530
+ def total_branches(*args, **_arg1, &block); end
1531
+
1532
+ # source://forwardable/1.3.2/forwardable.rb#229
1533
+ def total_lines(*args, **_arg1, &block); end
1534
+
1535
+ private
1536
+
1537
+ # source://simplecov//lib/simplecov/result.rb#84
1538
+ def coverage; end
1539
+
1540
+ # Applies all configured SimpleCov filters on this result's source files
1541
+ #
1542
+ # source://simplecov//lib/simplecov/result.rb#90
1543
+ def filter!; end
1544
+
1545
+ class << self
1546
+ # Loads a SimpleCov::Result#to_hash dump
1547
+ #
1548
+ # source://simplecov//lib/simplecov/result.rb#76
1549
+ def from_hash(hash); end
1550
+ end
1551
+ end
1552
+
1553
+ # Responsible for adapting the format of the coverage result whether it's default or with statistics
1554
+ #
1555
+ # source://simplecov//lib/simplecov/result_adapter.rb#7
1556
+ class SimpleCov::ResultAdapter
1557
+ # @return [ResultAdapter] a new instance of ResultAdapter
1558
+ #
1559
+ # source://simplecov//lib/simplecov/result_adapter.rb#10
1560
+ def initialize(result); end
1561
+
1562
+ # source://simplecov//lib/simplecov/result_adapter.rb#18
1563
+ def adapt; end
1564
+
1565
+ # Returns the value of attribute result.
1566
+ #
1567
+ # source://simplecov//lib/simplecov/result_adapter.rb#8
1568
+ def result; end
1569
+
1570
+ class << self
1571
+ # source://simplecov//lib/simplecov/result_adapter.rb#14
1572
+ def call(*args); end
1573
+ end
1574
+ end
1575
+
1576
+ # Singleton that is responsible for caching, loading and merging
1577
+ # SimpleCov::Results into a single result for coverage analysis based
1578
+ # upon multiple test suites.
1579
+ #
1580
+ # source://simplecov//lib/simplecov/result_merger.rb#11
1581
+ module SimpleCov::ResultMerger
1582
+ class << self
1583
+ # source://simplecov//lib/simplecov/result_merger.rb#187
1584
+ def adapt_pre_simplecov_0_18_result(result); end
1585
+
1586
+ # We changed the format of the raw result data in simplecov, as people are likely
1587
+ # to have "old" resultsets lying around (but not too old so that they're still
1588
+ # considered we can adapt them).
1589
+ # See https://github.com/simplecov-ruby/simplecov/pull/824#issuecomment-576049747
1590
+ #
1591
+ # source://simplecov//lib/simplecov/result_merger.rb#172
1592
+ def adapt_result(result); end
1593
+
1594
+ # source://simplecov//lib/simplecov/result_merger.rb#93
1595
+ def create_result(command_names, coverage); end
1596
+
1597
+ # source://simplecov//lib/simplecov/result_merger.rb#22
1598
+ def merge_and_store(*file_paths, ignore_timeout: T.unsafe(nil)); end
1599
+
1600
+ # source://simplecov//lib/simplecov/result_merger.rb#100
1601
+ def merge_coverage(*results); end
1602
+
1603
+ # source://simplecov//lib/simplecov/result_merger.rb#28
1604
+ def merge_results(*file_paths, ignore_timeout: T.unsafe(nil)); end
1605
+
1606
+ # source://simplecov//lib/simplecov/result_merger.rb#74
1607
+ def merge_valid_results(results, ignore_timeout: T.unsafe(nil)); end
1608
+
1609
+ # Gets all SimpleCov::Results stored in resultset, merges them and produces a new
1610
+ # SimpleCov::Result with merged coverage data and the command_name
1611
+ # for the result consisting of a join on all source result's names
1612
+ #
1613
+ # source://simplecov//lib/simplecov/result_merger.rb#117
1614
+ def merged_result; end
1615
+
1616
+ # source://simplecov//lib/simplecov/result_merger.rb#51
1617
+ def parse_file(path); end
1618
+
1619
+ # source://simplecov//lib/simplecov/result_merger.rb#65
1620
+ def parse_json(content); end
1621
+
1622
+ # pre 0.18 coverage data pointed from file directly to an array of line coverage
1623
+ #
1624
+ # @return [Boolean]
1625
+ #
1626
+ # source://simplecov//lib/simplecov/result_merger.rb#181
1627
+ def pre_simplecov_0_18_result?(result); end
1628
+
1629
+ # source://simplecov//lib/simplecov/result_merger.rb#56
1630
+ def read_file(path); end
1631
+
1632
+ # source://simplecov//lib/simplecov/result_merger.rb#126
1633
+ def read_resultset; end
1634
+
1635
+ # The path to the .resultset.json cache file
1636
+ #
1637
+ # source://simplecov//lib/simplecov/result_merger.rb#14
1638
+ def resultset_path; end
1639
+
1640
+ # source://simplecov//lib/simplecov/result_merger.rb#18
1641
+ def resultset_writelock; end
1642
+
1643
+ # Saves the given SimpleCov::Result in the resultset cache
1644
+ #
1645
+ # source://simplecov//lib/simplecov/result_merger.rb#136
1646
+ def store_result(result); end
1647
+
1648
+ # Ensure only one process is reading or writing the resultset at any
1649
+ # given time
1650
+ #
1651
+ # source://simplecov//lib/simplecov/result_merger.rb#153
1652
+ def synchronize_resultset; end
1653
+
1654
+ # source://simplecov//lib/simplecov/result_merger.rb#89
1655
+ def time_since_result_creation(data); end
1656
+
1657
+ # source://simplecov//lib/simplecov/result_merger.rb#46
1658
+ def valid_results(file_path, ignore_timeout: T.unsafe(nil)); end
1659
+
1660
+ # @return [Boolean]
1661
+ #
1662
+ # source://simplecov//lib/simplecov/result_merger.rb#85
1663
+ def within_merge_timeout?(data); end
1664
+ end
1665
+ end
1666
+
1667
+ # Responsible for producing file coverage metrics.
1668
+ #
1669
+ # source://simplecov//lib/simplecov/simulate_coverage.rb#7
1670
+ module SimpleCov::SimulateCoverage
1671
+ private
1672
+
1673
+ # Simulate normal file coverage report on
1674
+ # ruby 2.5 and return similar hash with lines and branches keys
1675
+ #
1676
+ # Happens when a file wasn't required but still tracked.
1677
+ #
1678
+ # @return [Hash]
1679
+ #
1680
+ # source://simplecov//lib/simplecov/simulate_coverage.rb#18
1681
+ def call(absolute_path); end
1682
+
1683
+ class << self
1684
+ # Simulate normal file coverage report on
1685
+ # ruby 2.5 and return similar hash with lines and branches keys
1686
+ #
1687
+ # Happens when a file wasn't required but still tracked.
1688
+ #
1689
+ # @return [Hash]
1690
+ #
1691
+ # source://simplecov//lib/simplecov/simulate_coverage.rb#18
1692
+ def call(absolute_path); end
1693
+ end
1694
+ end
1695
+
1696
+ # Representation of a source file including it's coverage data, source code,
1697
+ # source lines and featuring helpers to interpret that data.
1698
+ #
1699
+ # source://simplecov//lib/simplecov/source_file/line.rb#4
1700
+ class SimpleCov::SourceFile
1701
+ # @return [SourceFile] a new instance of SourceFile
1702
+ #
1703
+ # source://simplecov//lib/simplecov/source_file.rb#14
1704
+ def initialize(filename, coverage_data); end
1705
+
1706
+ # Return all the branches inside current source file
1707
+ #
1708
+ # source://simplecov//lib/simplecov/source_file.rb#98
1709
+ def branches; end
1710
+
1711
+ # source://simplecov//lib/simplecov/source_file.rb#106
1712
+ def branches_coverage_percent; end
1713
+
1714
+ # source://simplecov//lib/simplecov/source_file.rb#142
1715
+ def branches_for_line(line_number); end
1716
+
1717
+ # Return hash with key of line number and branch coverage count as value
1718
+ #
1719
+ # source://simplecov//lib/simplecov/source_file.rb#118
1720
+ def branches_report; end
1721
+
1722
+ # The array of coverage data received from the Coverage.result
1723
+ #
1724
+ # source://simplecov//lib/simplecov/source_file.rb#12
1725
+ def coverage_data; end
1726
+
1727
+ # source://simplecov//lib/simplecov/source_file.rb#32
1728
+ def coverage_statistics; end
1729
+
1730
+ # Select the covered branches
1731
+ # Here we user tree schema because some conditions like case may have additional
1732
+ # else that is not in declared inside the code but given by default by coverage report
1733
+ #
1734
+ # @return [Array]
1735
+ #
1736
+ # source://simplecov//lib/simplecov/source_file.rb#129
1737
+ def covered_branches; end
1738
+
1739
+ # Returns all covered lines as SimpleCov::SourceFile::Line
1740
+ #
1741
+ # source://simplecov//lib/simplecov/source_file.rb#48
1742
+ def covered_lines; end
1743
+
1744
+ # The coverage for this file in percent. 0 if the file has no coverage lines
1745
+ #
1746
+ # source://simplecov//lib/simplecov/source_file.rb#80
1747
+ def covered_percent; end
1748
+
1749
+ # source://simplecov//lib/simplecov/source_file.rb#84
1750
+ def covered_strength; end
1751
+
1752
+ # The full path to this source file (e.g. /User/colszowka/projects/simplecov/lib/simplecov/source_file.rb)
1753
+ #
1754
+ # source://simplecov//lib/simplecov/source_file.rb#10
1755
+ def filename; end
1756
+
1757
+ # Access SimpleCov::SourceFile::Line source lines by line number
1758
+ #
1759
+ # source://simplecov//lib/simplecov/source_file.rb#75
1760
+ def line(number); end
1761
+
1762
+ # Check if any branches missing on given line number
1763
+ #
1764
+ # @param line_number [Integer]
1765
+ # @return [Boolean]
1766
+ #
1767
+ # source://simplecov//lib/simplecov/source_file.rb#153
1768
+ def line_with_missed_branch?(line_number); end
1769
+
1770
+ # Returns all source lines for this file as instances of SimpleCov::SourceFile::Line,
1771
+ # and thus including coverage data. Aliased as :source_lines
1772
+ #
1773
+ # source://simplecov//lib/simplecov/source_file.rb#42
1774
+ def lines; end
1775
+
1776
+ # Returns the number of relevant lines (covered + missed)
1777
+ #
1778
+ # source://simplecov//lib/simplecov/source_file.rb#70
1779
+ def lines_of_code; end
1780
+
1781
+ # Select the missed branches with coverage equal to zero
1782
+ #
1783
+ # @return [Array]
1784
+ #
1785
+ # source://simplecov//lib/simplecov/source_file.rb#138
1786
+ def missed_branches; end
1787
+
1788
+ # Returns all lines that should have been, but were not covered
1789
+ # as instances of SimpleCov::SourceFile::Line
1790
+ #
1791
+ # source://simplecov//lib/simplecov/source_file.rb#54
1792
+ def missed_lines; end
1793
+
1794
+ # Returns all lines that are not relevant for coverage as
1795
+ # SimpleCov::SourceFile::Line instances
1796
+ #
1797
+ # source://simplecov//lib/simplecov/source_file.rb#60
1798
+ def never_lines; end
1799
+
1800
+ # @return [Boolean]
1801
+ #
1802
+ # source://simplecov//lib/simplecov/source_file.rb#102
1803
+ def no_branches?; end
1804
+
1805
+ # @return [Boolean]
1806
+ #
1807
+ # source://simplecov//lib/simplecov/source_file.rb#88
1808
+ def no_lines?; end
1809
+
1810
+ # The path to this source file relative to the projects directory
1811
+ #
1812
+ # source://simplecov//lib/simplecov/source_file.rb#20
1813
+ def project_filename; end
1814
+
1815
+ # source://simplecov//lib/simplecov/source_file.rb#92
1816
+ def relevant_lines; end
1817
+
1818
+ # Returns all lines that were skipped as SimpleCov::SourceFile::Line instances
1819
+ #
1820
+ # source://simplecov//lib/simplecov/source_file.rb#65
1821
+ def skipped_lines; end
1822
+
1823
+ # The source code for this file. Aliased as :source
1824
+ #
1825
+ # source://simplecov//lib/simplecov/source_file.rb#25
1826
+ def source; end
1827
+
1828
+ # Returns all source lines for this file as instances of SimpleCov::SourceFile::Line,
1829
+ # and thus including coverage data. Aliased as :source_lines
1830
+ #
1831
+ # source://simplecov//lib/simplecov/source_file.rb#42
1832
+ def source_lines; end
1833
+
1834
+ # The source code for this file. Aliased as :source
1835
+ #
1836
+ # source://simplecov//lib/simplecov/source_file.rb#25
1837
+ def src; end
1838
+
1839
+ # Return the relevant branches to source file
1840
+ #
1841
+ # source://simplecov//lib/simplecov/source_file.rb#112
1842
+ def total_branches; end
1843
+
1844
+ private
1845
+
1846
+ # source://simplecov//lib/simplecov/source_file.rb#340
1847
+ def branch_coverage_statistics; end
1848
+
1849
+ # source://simplecov//lib/simplecov/source_file.rb#318
1850
+ def build_branch(branch_data, hit_count, condition_start_line); end
1851
+
1852
+ # Call recursive method that transform our static hash to array of objects
1853
+ #
1854
+ # @return [Array]
1855
+ #
1856
+ # source://simplecov//lib/simplecov/source_file.rb#267
1857
+ def build_branches; end
1858
+
1859
+ # source://simplecov//lib/simplecov/source_file.rb#304
1860
+ def build_branches_from(condition, branches); end
1861
+
1862
+ # Build full branches report
1863
+ # Root branches represent the wrapper of all condition state that
1864
+ # have inside the branches
1865
+ #
1866
+ # @return [Hash]
1867
+ #
1868
+ # source://simplecov//lib/simplecov/source_file.rb#256
1869
+ def build_branches_report; end
1870
+
1871
+ # source://simplecov//lib/simplecov/source_file.rb#223
1872
+ def build_lines; end
1873
+
1874
+ # source://simplecov//lib/simplecov/source_file.rb#164
1875
+ def build_no_cov_chunks; end
1876
+
1877
+ # Warning to identify condition from Issue #56
1878
+ #
1879
+ # source://simplecov//lib/simplecov/source_file.rb#245
1880
+ def coverage_exceeding_source_warn; end
1881
+
1882
+ # source://simplecov//lib/simplecov/source_file.rb#214
1883
+ def ensure_remove_undefs(file_lines); end
1884
+
1885
+ # source://simplecov//lib/simplecov/source_file.rb#330
1886
+ def line_coverage_statistics; end
1887
+
1888
+ # source://simplecov//lib/simplecov/source_file.rb#240
1889
+ def lines_strength; end
1890
+
1891
+ # source://simplecov//lib/simplecov/source_file.rb#178
1892
+ def load_source; end
1893
+
1894
+ # no_cov_chunks is zero indexed to work directly with the array holding the lines
1895
+ #
1896
+ # source://simplecov//lib/simplecov/source_file.rb#160
1897
+ def no_cov_chunks; end
1898
+
1899
+ # source://simplecov//lib/simplecov/source_file.rb#276
1900
+ def process_skipped_branches(branches); end
1901
+
1902
+ # source://simplecov//lib/simplecov/source_file.rb#231
1903
+ def process_skipped_lines(lines); end
1904
+
1905
+ # source://simplecov//lib/simplecov/source_file.rb#198
1906
+ def read_lines(file, lines, current_line); end
1907
+
1908
+ # Since we are dumping to and loading from JSON, and we have arrays as keys those
1909
+ # don't make their way back to us intact e.g. just as a string
1910
+ #
1911
+ # We should probably do something different here, but as it stands these are
1912
+ # our data structures that we write so eval isn't _too_ bad.
1913
+ #
1914
+ # See #801
1915
+ #
1916
+ # source://simplecov//lib/simplecov/source_file.rb#294
1917
+ def restore_ruby_data_structure(structure); end
1918
+
1919
+ # source://simplecov//lib/simplecov/source_file.rb#206
1920
+ def set_encoding_based_on_magic_comment(file, line); end
1921
+
1922
+ # @return [Boolean]
1923
+ #
1924
+ # source://simplecov//lib/simplecov/source_file.rb#194
1925
+ def shebang?(line); end
1926
+ end
1927
+
1928
+ # Representing single branch that has been detected in coverage report.
1929
+ # Give us support methods that handle needed calculations.
1930
+ #
1931
+ # source://simplecov//lib/simplecov/source_file/branch.rb#8
1932
+ class SimpleCov::SourceFile::Branch
1933
+ # @return [Branch] a new instance of Branch
1934
+ #
1935
+ # source://simplecov//lib/simplecov/source_file/branch.rb#12
1936
+ def initialize(start_line:, end_line:, coverage:, inline:, type:); end
1937
+
1938
+ # Returns the value of attribute coverage.
1939
+ #
1940
+ # source://simplecov//lib/simplecov/source_file/branch.rb#9
1941
+ def coverage; end
1942
+
1943
+ # Return true if there is relevant count defined > 0
1944
+ #
1945
+ # @return [Boolean]
1946
+ #
1947
+ # source://simplecov//lib/simplecov/source_file/branch.rb#31
1948
+ def covered?; end
1949
+
1950
+ # Returns the value of attribute end_line.
1951
+ #
1952
+ # source://simplecov//lib/simplecov/source_file/branch.rb#9
1953
+ def end_line; end
1954
+
1955
+ # @return [Boolean]
1956
+ #
1957
+ # source://simplecov//lib/simplecov/source_file/branch.rb#22
1958
+ def inline?; end
1959
+
1960
+ # Check if branche missed or not
1961
+ #
1962
+ # @return [Boolean]
1963
+ #
1964
+ # source://simplecov//lib/simplecov/source_file/branch.rb#40
1965
+ def missed?; end
1966
+
1967
+ # @return [Boolean]
1968
+ #
1969
+ # source://simplecov//lib/simplecov/source_file/branch.rb#70
1970
+ def overlaps_with?(line_range); end
1971
+
1972
+ # Return array with coverage count and badge
1973
+ #
1974
+ # @return [Array]
1975
+ #
1976
+ # source://simplecov//lib/simplecov/source_file/branch.rb#79
1977
+ def report; end
1978
+
1979
+ # The line on which we want to report the coverage
1980
+ #
1981
+ # Usually we choose the line above the start of the branch (so that it shows up
1982
+ # at if/else) because that
1983
+ # * highlights the condition
1984
+ # * makes it distinguishable if the first line of the branch is an inline branch
1985
+ # (see the nested_branches fixture)
1986
+ #
1987
+ # source://simplecov//lib/simplecov/source_file/branch.rb#52
1988
+ def report_line; end
1989
+
1990
+ # Flags the branch as skipped
1991
+ #
1992
+ # source://simplecov//lib/simplecov/source_file/branch.rb#61
1993
+ def skipped!; end
1994
+
1995
+ # Returns true if the branch was marked skipped by virtue of nocov comments.
1996
+ #
1997
+ # @return [Boolean]
1998
+ #
1999
+ # source://simplecov//lib/simplecov/source_file/branch.rb#66
2000
+ def skipped?; end
2001
+
2002
+ # Returns the value of attribute start_line.
2003
+ #
2004
+ # source://simplecov//lib/simplecov/source_file/branch.rb#9
2005
+ def start_line; end
2006
+
2007
+ # Returns the value of attribute type.
2008
+ #
2009
+ # source://simplecov//lib/simplecov/source_file/branch.rb#9
2010
+ def type; end
2011
+ end
2012
+
2013
+ # Representation of a single line in a source file including
2014
+ # this specific line's source code, line_number and code coverage,
2015
+ # with the coverage being either nil (coverage not applicable, e.g. comment
2016
+ # line), 0 (line not covered) or >1 (the amount of times the line was
2017
+ # executed)
2018
+ #
2019
+ # source://simplecov//lib/simplecov/source_file/line.rb#10
2020
+ class SimpleCov::SourceFile::Line
2021
+ # @raise [ArgumentError]
2022
+ # @return [Line] a new instance of Line
2023
+ #
2024
+ # source://simplecov//lib/simplecov/source_file/line.rb#25
2025
+ def initialize(src, line_number, coverage); end
2026
+
2027
+ # The coverage data for this line: either nil (never), 0 (missed) or >=1 (times covered)
2028
+ #
2029
+ # source://simplecov//lib/simplecov/source_file/line.rb#16
2030
+ def coverage; end
2031
+
2032
+ # Returns true if this is a line that has been covered
2033
+ #
2034
+ # @return [Boolean]
2035
+ #
2036
+ # source://simplecov//lib/simplecov/source_file/line.rb#42
2037
+ def covered?; end
2038
+
2039
+ # The line number in the source file. Aliased as :line, :number
2040
+ #
2041
+ # source://simplecov//lib/simplecov/source_file/line.rb#14
2042
+ def line; end
2043
+
2044
+ # The line number in the source file. Aliased as :line, :number
2045
+ #
2046
+ # source://simplecov//lib/simplecov/source_file/line.rb#14
2047
+ def line_number; end
2048
+
2049
+ # Returns true if this is a line that should have been covered, but was not
2050
+ #
2051
+ # @return [Boolean]
2052
+ #
2053
+ # source://simplecov//lib/simplecov/source_file/line.rb#37
2054
+ def missed?; end
2055
+
2056
+ # Returns true if this line is not relevant for coverage
2057
+ #
2058
+ # @return [Boolean]
2059
+ #
2060
+ # source://simplecov//lib/simplecov/source_file/line.rb#47
2061
+ def never?; end
2062
+
2063
+ # The line number in the source file. Aliased as :line, :number
2064
+ #
2065
+ # source://simplecov//lib/simplecov/source_file/line.rb#14
2066
+ def number; end
2067
+
2068
+ # Whether this line was skipped
2069
+ #
2070
+ # source://simplecov//lib/simplecov/source_file/line.rb#18
2071
+ def skipped; end
2072
+
2073
+ # Flags this line as skipped
2074
+ #
2075
+ # source://simplecov//lib/simplecov/source_file/line.rb#52
2076
+ def skipped!; end
2077
+
2078
+ # Returns true if this line was skipped, false otherwise. Lines are skipped if they are wrapped with
2079
+ # # :nocov: comment lines.
2080
+ #
2081
+ # @return [Boolean]
2082
+ #
2083
+ # source://simplecov//lib/simplecov/source_file/line.rb#58
2084
+ def skipped?; end
2085
+
2086
+ # The source code for this line. Aliased as :source
2087
+ # Lets grab some fancy aliases, shall we?
2088
+ #
2089
+ # source://simplecov//lib/simplecov/source_file/line.rb#12
2090
+ def source; end
2091
+
2092
+ # The source code for this line. Aliased as :source
2093
+ #
2094
+ # source://simplecov//lib/simplecov/source_file/line.rb#12
2095
+ def src; end
2096
+
2097
+ # The status of this line - either covered, missed, skipped or never. Useful i.e. for direct use
2098
+ # as a css class in report generation
2099
+ #
2100
+ # source://simplecov//lib/simplecov/source_file/line.rb#64
2101
+ def status; end
2102
+ end
2103
+
2104
+ # source://simplecov//lib/simplecov/source_file.rb#205
2105
+ SimpleCov::SourceFile::RUBY_FILE_ENCODING_MAGIC_COMMENT_REGEX = T.let(T.unsafe(nil), Regexp)
2106
+
2107
+ # source://simplecov//lib/simplecov/source_file.rb#193
2108
+ SimpleCov::SourceFile::SHEBANG_REGEX = T.let(T.unsafe(nil), Regexp)
2109
+
2110
+ # source://simplecov//lib/simplecov/filter.rb#55
2111
+ class SimpleCov::StringFilter < ::SimpleCov::Filter
2112
+ # Returns true when the given source file's filename matches the
2113
+ # string configured when initializing this Filter with StringFilter.new('somestring')
2114
+ #
2115
+ # @return [Boolean]
2116
+ #
2117
+ # source://simplecov//lib/simplecov/filter.rb#56
2118
+ def matches?(source_file); end
2119
+ end
2120
+
2121
+ # Select the files that related to working scope directory of SimpleCov
2122
+ #
2123
+ # source://simplecov//lib/simplecov/useless_results_remover.rb#7
2124
+ module SimpleCov::UselessResultsRemover
2125
+ class << self
2126
+ # source://simplecov//lib/simplecov/useless_results_remover.rb#8
2127
+ def call(coverage_result); end
2128
+
2129
+ # source://simplecov//lib/simplecov/useless_results_remover.rb#14
2130
+ def root_regx; end
2131
+ end
2132
+ end
2133
+
2134
+ # source://simplecov//lib/simplecov/version.rb#4
2135
+ SimpleCov::VERSION = T.let(T.unsafe(nil), String)