thread_weaver 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 (53) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/main.yml +19 -0
  3. data/.gitignore +59 -0
  4. data/.rspec +3 -0
  5. data/.vscode/settings.json +14 -0
  6. data/CHANGELOG.md +7 -0
  7. data/Gemfile +17 -0
  8. data/LICENSE +21 -0
  9. data/README.md +37 -0
  10. data/Rakefile +13 -0
  11. data/bin/console +15 -0
  12. data/bin/gem_smoke_test +10 -0
  13. data/bin/setup +8 -0
  14. data/examples/always_deadlocks.rb +15 -0
  15. data/examples/takes_a_while.rb +7 -0
  16. data/examples/thread_safe_nonblocking_run_at_most_once.rb +23 -0
  17. data/examples/thread_safe_run_at_most_once.rb +19 -0
  18. data/examples/thread_unsafe_run_at_most_once.rb +17 -0
  19. data/lib/thread_weaver.rb +15 -0
  20. data/lib/thread_weaver/controllable_thread.rb +177 -0
  21. data/lib/thread_weaver/iterative_race_detector.rb +178 -0
  22. data/lib/thread_weaver/thread_instruction.rb +68 -0
  23. data/lib/thread_weaver/version.rb +6 -0
  24. data/sorbet/config +2 -0
  25. data/sorbet/rbi/gems/ast.rbi +48 -0
  26. data/sorbet/rbi/gems/coderay.rbi +285 -0
  27. data/sorbet/rbi/gems/method_source.rbi +64 -0
  28. data/sorbet/rbi/gems/parallel.rbi +83 -0
  29. data/sorbet/rbi/gems/parser.rbi +1510 -0
  30. data/sorbet/rbi/gems/pry-nav.rbi +29 -0
  31. data/sorbet/rbi/gems/pry.rbi +1965 -0
  32. data/sorbet/rbi/gems/rainbow.rbi +118 -0
  33. data/sorbet/rbi/gems/rake.rbi +645 -0
  34. data/sorbet/rbi/gems/regexp_parser.rbi +920 -0
  35. data/sorbet/rbi/gems/rexml.rbi +589 -0
  36. data/sorbet/rbi/gems/rspec-core.rbi +1893 -0
  37. data/sorbet/rbi/gems/rspec-expectations.rbi +1148 -0
  38. data/sorbet/rbi/gems/rspec-mocks.rbi +1091 -0
  39. data/sorbet/rbi/gems/rspec-support.rbi +280 -0
  40. data/sorbet/rbi/gems/rspec.rbi +15 -0
  41. data/sorbet/rbi/gems/rubocop-ast.rbi +1351 -0
  42. data/sorbet/rbi/gems/rubocop-performance.rbi +471 -0
  43. data/sorbet/rbi/gems/rubocop.rbi +7510 -0
  44. data/sorbet/rbi/gems/ruby-progressbar.rbi +305 -0
  45. data/sorbet/rbi/gems/standard.rbi +141 -0
  46. data/sorbet/rbi/gems/unicode-display_width.rbi +17 -0
  47. data/sorbet/rbi/hidden-definitions/errors.txt +4309 -0
  48. data/sorbet/rbi/hidden-definitions/hidden.rbi +8622 -0
  49. data/sorbet/rbi/sorbet-typed/lib/rainbow/all/rainbow.rbi +276 -0
  50. data/sorbet/rbi/sorbet-typed/lib/rubocop-performance/~>1.6/rubocop-performance.rbi +149 -0
  51. data/sorbet/rbi/todo.rbi +6 -0
  52. data/thread_weaver.gemspec +34 -0
  53. metadata +111 -0
@@ -0,0 +1,305 @@
1
+ # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
+ # srb rbi gems
3
+
4
+ # typed: strict
5
+ #
6
+ # If you would like to make changes to this file, great! Please create the gem's shim here:
7
+ #
8
+ # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/ruby-progressbar/all/ruby-progressbar.rbi
9
+ #
10
+ # ruby-progressbar-1.10.1
11
+
12
+ class ProgressBar
13
+ def self.create(*args); end
14
+ end
15
+ class ProgressBar::Output
16
+ def bar; end
17
+ def bar=(arg0); end
18
+ def clear_string; end
19
+ def initialize(options = nil); end
20
+ def length; end
21
+ def length_calculator; end
22
+ def length_calculator=(arg0); end
23
+ def log(string); end
24
+ def print_and_flush; end
25
+ def refresh(options = nil); end
26
+ def self.detect(options = nil); end
27
+ def stream; end
28
+ def stream=(arg0); end
29
+ def throttle; end
30
+ def throttle=(arg0); end
31
+ def with_refresh; end
32
+ end
33
+ module ProgressBar::Outputs
34
+ end
35
+ class ProgressBar::Outputs::Tty < ProgressBar::Output
36
+ def bar_update_string; end
37
+ def clear; end
38
+ def default_format; end
39
+ def eol; end
40
+ def refresh_with_format_change; end
41
+ def resolve_format(other_format); end
42
+ end
43
+ class ProgressBar::Outputs::NonTty < ProgressBar::Output
44
+ def bar_update_string; end
45
+ def clear; end
46
+ def default_format; end
47
+ def eol; end
48
+ def last_update_length; end
49
+ def last_update_length=(arg0); end
50
+ def refresh_with_format_change(*arg0); end
51
+ def resolve_format(*arg0); end
52
+ end
53
+ class ProgressBar::Time
54
+ def initialize(time = nil); end
55
+ def now; end
56
+ def time; end
57
+ def time=(arg0); end
58
+ def unmocked_time_method; end
59
+ end
60
+ class ProgressBar::Timer
61
+ def divide_seconds(seconds); end
62
+ def elapsed_seconds; end
63
+ def elapsed_whole_seconds; end
64
+ def initialize(options = nil); end
65
+ def pause; end
66
+ def reset; end
67
+ def reset?; end
68
+ def restart; end
69
+ def resume; end
70
+ def start; end
71
+ def started?; end
72
+ def started_at; end
73
+ def started_at=(arg0); end
74
+ def stop; end
75
+ def stopped?; end
76
+ def stopped_at; end
77
+ def stopped_at=(arg0); end
78
+ def time; end
79
+ def time=(arg0); end
80
+ end
81
+ class ProgressBar::InvalidProgressError < RuntimeError
82
+ end
83
+ class ProgressBar::Progress
84
+ def absolute; end
85
+ def decrement; end
86
+ def finish; end
87
+ def finished?; end
88
+ def increment; end
89
+ def initialize(options = nil); end
90
+ def none?; end
91
+ def percentage_completed; end
92
+ def percentage_completed_with_precision; end
93
+ def progress; end
94
+ def progress=(new_progress); end
95
+ def reset; end
96
+ def running_average; end
97
+ def running_average=(arg0); end
98
+ def smoothing; end
99
+ def smoothing=(arg0); end
100
+ def start(options = nil); end
101
+ def starting_position; end
102
+ def starting_position=(arg0); end
103
+ def total; end
104
+ def total=(new_total); end
105
+ def total_with_unknown_indicator; end
106
+ def unknown?; end
107
+ end
108
+ class ProgressBar::Throttle
109
+ def choke(options = nil); end
110
+ def initialize(options = nil); end
111
+ def rate; end
112
+ def rate=(arg0); end
113
+ def started_at; end
114
+ def started_at=(arg0); end
115
+ def stopped_at; end
116
+ def stopped_at=(arg0); end
117
+ def timer; end
118
+ def timer=(arg0); end
119
+ end
120
+ module ProgressBar::Calculators
121
+ end
122
+ class ProgressBar::Calculators::Length
123
+ def calculate_length; end
124
+ def current_length; end
125
+ def current_length=(arg0); end
126
+ def dynamic_width; end
127
+ def dynamic_width_stty; end
128
+ def dynamic_width_tput; end
129
+ def dynamic_width_via_io_object; end
130
+ def dynamic_width_via_output_stream_object; end
131
+ def dynamic_width_via_system_calls; end
132
+ def initialize(options = nil); end
133
+ def length; end
134
+ def length_changed?; end
135
+ def length_override; end
136
+ def length_override=(other); end
137
+ def output; end
138
+ def output=(arg0); end
139
+ def reset_length; end
140
+ def terminal_width; end
141
+ def unix?; end
142
+ end
143
+ class ProgressBar::Calculators::RunningAverage
144
+ def self.calculate(current_average, new_value_to_average, smoothing_factor); end
145
+ end
146
+ module ProgressBar::Components
147
+ end
148
+ class ProgressBar::Components::Bar
149
+ def bar(length); end
150
+ def bar_with_percentage(length); end
151
+ def complete_bar(length); end
152
+ def complete_bar_with_percentage(length); end
153
+ def completed_length; end
154
+ def incomplete_space(length); end
155
+ def incomplete_string; end
156
+ def initialize(options = nil); end
157
+ def integrated_percentage_complete_string; end
158
+ def length; end
159
+ def length=(arg0); end
160
+ def progress; end
161
+ def progress=(arg0); end
162
+ def progress_mark; end
163
+ def progress_mark=(arg0); end
164
+ def remainder_mark; end
165
+ def remainder_mark=(arg0); end
166
+ def standard_complete_string; end
167
+ def to_s(options = nil); end
168
+ def unknown_progress_frame; end
169
+ def unknown_string; end
170
+ def upa_steps; end
171
+ def upa_steps=(arg0); end
172
+ end
173
+ class ProgressBar::Components::Percentage
174
+ def initialize(options = nil); end
175
+ def justified_percentage; end
176
+ def justified_percentage_with_precision; end
177
+ def percentage; end
178
+ def percentage_with_precision; end
179
+ def progress; end
180
+ def progress=(arg0); end
181
+ end
182
+ class ProgressBar::Components::Rate
183
+ def base_rate; end
184
+ def elapsed_seconds; end
185
+ def initialize(options = nil); end
186
+ def progress; end
187
+ def progress=(arg0); end
188
+ def rate_of_change(format_string = nil); end
189
+ def rate_of_change_with_precision; end
190
+ def rate_scale; end
191
+ def rate_scale=(arg0); end
192
+ def scaled_rate; end
193
+ def started_at; end
194
+ def started_at=(arg0); end
195
+ def stopped_at; end
196
+ def stopped_at=(arg0); end
197
+ def timer; end
198
+ def timer=(arg0); end
199
+ end
200
+ class ProgressBar::Components::Time
201
+ def elapsed; end
202
+ def elapsed_with_label; end
203
+ def estimated; end
204
+ def estimated_seconds_remaining; end
205
+ def estimated_with_elapsed_fallback; end
206
+ def estimated_with_friendly_oob; end
207
+ def estimated_with_label; end
208
+ def estimated_with_no_oob; end
209
+ def estimated_with_unknown_oob; end
210
+ def initialize(options = nil); end
211
+ def out_of_bounds_time; end
212
+ def out_of_bounds_time_format; end
213
+ def out_of_bounds_time_format=(format); end
214
+ def progress; end
215
+ def progress=(arg0); end
216
+ def timer; end
217
+ def timer=(arg0); end
218
+ end
219
+ class ProgressBar::Components::Title
220
+ def initialize(options = nil); end
221
+ def title; end
222
+ def title=(arg0); end
223
+ end
224
+ module ProgressBar::Format
225
+ end
226
+ class ProgressBar::Format::Molecule
227
+ def bar_molecule?; end
228
+ def full_key; end
229
+ def initialize(letter); end
230
+ def key; end
231
+ def key=(arg0); end
232
+ def lookup_value(environment, length = nil); end
233
+ def method_name; end
234
+ def method_name=(arg0); end
235
+ def non_bar_molecule?; end
236
+ end
237
+ class ProgressBar::Format::Formatter
238
+ def self.process(format_string, max_length, bar); end
239
+ end
240
+ class ProgressBar::Format::String < String
241
+ def bar_molecule_placeholder_length; end
242
+ def bar_molecules; end
243
+ def displayable_length; end
244
+ def molecules; end
245
+ def non_bar_molecules; end
246
+ end
247
+ class ProgressBar::Base
248
+ def autofinish; end
249
+ def autofinish=(arg0); end
250
+ def autostart; end
251
+ def autostart=(arg0); end
252
+ def bar; end
253
+ def bar=(arg0); end
254
+ def clear(*args, &block); end
255
+ def decrement; end
256
+ def finish; end
257
+ def finished; end
258
+ def finished=(arg0); end
259
+ def finished?; end
260
+ def format(other); end
261
+ def format=(other); end
262
+ def increment; end
263
+ def initialize(options = nil); end
264
+ def inspect; end
265
+ def log(*args, &block); end
266
+ def output; end
267
+ def output=(arg0); end
268
+ def pause; end
269
+ def paused?; end
270
+ def percentage; end
271
+ def percentage=(arg0); end
272
+ def progress(*args, &block); end
273
+ def progress=(new_progress); end
274
+ def progress_mark=(mark); end
275
+ def progressable; end
276
+ def progressable=(arg0); end
277
+ def rate; end
278
+ def rate=(arg0); end
279
+ def refresh(*args, &block); end
280
+ def remainder_mark=(mark); end
281
+ def reset; end
282
+ def resume; end
283
+ def start(options = nil); end
284
+ def started?; end
285
+ def stop; end
286
+ def stopped?; end
287
+ def time; end
288
+ def time=(arg0); end
289
+ def timer; end
290
+ def timer=(arg0); end
291
+ def title; end
292
+ def title=(title); end
293
+ def title_comp; end
294
+ def title_comp=(arg0); end
295
+ def to_h; end
296
+ def to_s(new_format = nil); end
297
+ def total(*args, &block); end
298
+ def total=(new_total); end
299
+ def update_progress(*args); end
300
+ extend Forwardable
301
+ end
302
+ module ProgressBar::Refinements
303
+ end
304
+ module ProgressBar::Refinements::Enumerator
305
+ end
@@ -0,0 +1,141 @@
1
+ # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
+ # srb rbi gems
3
+
4
+ # typed: true
5
+ #
6
+ # If you would like to make changes to this file, great! Please create the gem's shim here:
7
+ #
8
+ # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/standard/all/standard.rbi
9
+ #
10
+ # standard-0.10.2
11
+
12
+ module RuboCop
13
+ end
14
+ class RuboCop::Cop::Lint::AssignmentInCondition < RuboCop::Cop::Base
15
+ end
16
+ module Standard
17
+ end
18
+ class Standard::FileFinder
19
+ def call(name, search_path); end
20
+ end
21
+ class Standard::ParsesCliOption
22
+ def argv_value_for(argv, option_name); end
23
+ def call(argv, option_name); end
24
+ end
25
+ class Standard::LoadsYamlConfig
26
+ def arrayify(object); end
27
+ def call(standard_yaml_path, todo_yaml_path); end
28
+ def construct_config(yaml_path, standard_yaml, todo_path, todo_yaml); end
29
+ def expand_ignore_config(ignore_config); end
30
+ def load_standard_yaml(yaml_path); end
31
+ end
32
+ class Standard::MergesSettings
33
+ def call(argv, standard_yaml); end
34
+ def determine_command(argv); end
35
+ def merge(standard_yaml, standard_cli_flags, rubocop_cli_flags); end
36
+ def parse_standard_argv(argv); end
37
+ def separate_argv(argv); end
38
+ def without_banned(rubocop_cli_flags); end
39
+ end
40
+ class Standard::MergesSettings::Settings < Struct
41
+ def options; end
42
+ def options=(_); end
43
+ def paths; end
44
+ def paths=(_); end
45
+ def runner; end
46
+ def runner=(_); end
47
+ def self.[](*arg0); end
48
+ def self.inspect; end
49
+ def self.members; end
50
+ def self.new(*arg0); end
51
+ end
52
+ class Standard::CreatesConfigStore
53
+ def call(standard_config); end
54
+ def initialize; end
55
+ end
56
+ class Standard::CreatesConfigStore::AssignsRubocopYaml
57
+ def call(config_store, standard_config); end
58
+ def rubocop_yaml_path(desired_version); end
59
+ end
60
+ class Standard::CreatesConfigStore::SetsTargetRubyVersion
61
+ def call(options_config, standard_config); end
62
+ def floatify_version(version); end
63
+ def max_rubocop_supported_version(desired_version); end
64
+ end
65
+ class Standard::CreatesConfigStore::ConfiguresIgnoredPaths
66
+ def absolute?(path); end
67
+ def absolutify(config_root, path); end
68
+ def call(options_config, standard_config); end
69
+ def ignored_patterns(standard_config); end
70
+ end
71
+ class Standard::Config < Struct
72
+ def paths; end
73
+ def paths=(_); end
74
+ def rubocop_config_store; end
75
+ def rubocop_config_store=(_); end
76
+ def rubocop_options; end
77
+ def rubocop_options=(_); end
78
+ def runner; end
79
+ def runner=(_); end
80
+ def self.[](*arg0); end
81
+ def self.inspect; end
82
+ def self.members; end
83
+ def self.new(*arg0); end
84
+ end
85
+ class Standard::BuildsConfig
86
+ def call(argv, search_path = nil); end
87
+ def determine_yaml_file(argv, search_path, option_name, default_file); end
88
+ def initialize; end
89
+ end
90
+ class Standard::LoadsRunner
91
+ def call(command); end
92
+ end
93
+ class Standard::Cli
94
+ def initialize(argv); end
95
+ def run; end
96
+ end
97
+ class Standard::DetectsFixability
98
+ def call(offenses); end
99
+ def cop_instance(cop_name); end
100
+ end
101
+ class Standard::Formatter < RuboCop::Formatter::BaseFormatter
102
+ def auto_correct_option_provided?; end
103
+ def file_finished(file, offenses); end
104
+ def finished(_); end
105
+ def initialize(*args); end
106
+ def path_to(file); end
107
+ def print_call_for_feedback; end
108
+ def print_fix_suggestion_once(offenses); end
109
+ def print_header_once; end
110
+ def print_todo_warning; end
111
+ def self.fixable_error_message(command); end
112
+ def should_suggest_fix?(offenses); end
113
+ def started(_target_files); end
114
+ end
115
+ module RuboCop::Cop
116
+ end
117
+ module RuboCop::Cop::Standard
118
+ end
119
+ class RuboCop::Cop::Standard::SemanticBlocks < RuboCop::Cop::Cop
120
+ def array_or_range?(node); end
121
+ def autocorrect(node); end
122
+ def conditional?(node); end
123
+ def correction_would_break_code?(node); end
124
+ def functional_block?(node); end
125
+ def functional_method?(method_name); end
126
+ def get_blocks(node, &block); end
127
+ def message(node); end
128
+ def non_parenthesized_keyword_args?(node); end
129
+ def on_block(node); end
130
+ def on_send(node); end
131
+ def procedural_method?(method_name); end
132
+ def proper_block_style?(node); end
133
+ def replace_braces_with_do_end(loc); end
134
+ def replace_do_end_with_braces(loc); end
135
+ def rescue_child_block?(node); end
136
+ def return_value_of_scope?(node); end
137
+ def return_value_used?(node); end
138
+ def whitespace_after?(range, length = nil); end
139
+ def whitespace_before?(range); end
140
+ include RuboCop::Cop::IgnoredMethods
141
+ end
@@ -0,0 +1,17 @@
1
+ # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
+ # srb rbi gems
3
+
4
+ # typed: strict
5
+ #
6
+ # If you would like to make changes to this file, great! Please create the gem's shim here:
7
+ #
8
+ # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/unicode-display_width/all/unicode-display_width.rbi
9
+ #
10
+ # unicode-display_width-1.7.0
11
+
12
+ module Unicode
13
+ end
14
+ module Unicode::DisplayWidth
15
+ def self.emoji_extra_width_of(string, ambiguous = nil, overwrite = nil, _ = nil); end
16
+ def self.of(string, ambiguous = nil, overwrite = nil, options = nil); end
17
+ end