ruby-lsp-i18n 0.3.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 (68) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +13 -0
  3. data/.ruby-version +1 -0
  4. data/.vscode/settings.json +12 -0
  5. data/CHANGELOG.md +36 -0
  6. data/CODE_OF_CONDUCT.md +84 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +73 -0
  9. data/Rakefile +16 -0
  10. data/es.yml +4 -0
  11. data/example/app/example.rb +14 -0
  12. data/example/config/locales/a/es.yml +4 -0
  13. data/example/config/locales/es.yml +6 -0
  14. data/lib/ruby_lsp/ruby_lsp_i18n/addon.rb +138 -0
  15. data/lib/ruby_lsp/ruby_lsp_i18n/i18n_index.rb +130 -0
  16. data/lib/ruby_lsp/ruby_lsp_i18n/listeners/completion.rb +65 -0
  17. data/lib/ruby_lsp/ruby_lsp_i18n/listeners/inlay_hints.rb +118 -0
  18. data/lib/ruby_lsp/ruby_lsp_i18n/prefix_tree.rb +158 -0
  19. data/lib/ruby_lsp/ruby_lsp_i18n/requests/inlay_hints.rb +36 -0
  20. data/lib/ruby_lsp_i18n/version.rb +7 -0
  21. data/lib/ruby_lsp_i18n.rb +9 -0
  22. data/media/demo.gif +0 -0
  23. data/ruby-lsp-i18n.gemspec +35 -0
  24. data/sorbet/config +4 -0
  25. data/sorbet/rbi/annotations/.gitattributes +1 -0
  26. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  27. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  28. data/sorbet/rbi/dsl/.gitattributes +1 -0
  29. data/sorbet/rbi/gems/.gitattributes +1 -0
  30. data/sorbet/rbi/gems/ast@2.4.2.rbi +585 -0
  31. data/sorbet/rbi/gems/bump@0.10.0.rbi +9 -0
  32. data/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi +406 -0
  33. data/sorbet/rbi/gems/erubi@1.13.0.rbi +150 -0
  34. data/sorbet/rbi/gems/i18n@1.14.5.rbi +2208 -0
  35. data/sorbet/rbi/gems/json@2.7.2.rbi +1562 -0
  36. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14238 -0
  37. data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
  38. data/sorbet/rbi/gems/minitest@5.25.1.rbi +1546 -0
  39. data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
  40. data/sorbet/rbi/gems/parallel@1.26.3.rbi +291 -0
  41. data/sorbet/rbi/gems/parser@3.3.4.2.rbi +5519 -0
  42. data/sorbet/rbi/gems/prism@1.2.0.rbi +39085 -0
  43. data/sorbet/rbi/gems/racc@1.8.1.rbi +162 -0
  44. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  45. data/sorbet/rbi/gems/rake@13.2.1.rbi +3028 -0
  46. data/sorbet/rbi/gems/rbi@0.2.0.rbi +9 -0
  47. data/sorbet/rbi/gems/rbs@3.9.4.rbi +6976 -0
  48. data/sorbet/rbi/gems/regexp_parser@2.9.2.rbi +3772 -0
  49. data/sorbet/rbi/gems/rexml@3.3.6.rbi +4813 -0
  50. data/sorbet/rbi/gems/rubocop-ast@1.32.1.rbi +7079 -0
  51. data/sorbet/rbi/gems/rubocop-minitest@0.35.1.rbi +2613 -0
  52. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +329 -0
  53. data/sorbet/rbi/gems/rubocop-shopify@2.15.1.rbi +9 -0
  54. data/sorbet/rbi/gems/rubocop-sorbet@0.8.5.rbi +1665 -0
  55. data/sorbet/rbi/gems/rubocop@1.65.1.rbi +58100 -0
  56. data/sorbet/rbi/gems/ruby-lsp@0.24.1.rbi +7508 -0
  57. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  58. data/sorbet/rbi/gems/spoom@1.4.2.rbi +4932 -0
  59. data/sorbet/rbi/gems/strscan@3.1.0.rbi +9 -0
  60. data/sorbet/rbi/gems/tapioca@0.16.2.rbi +16 -0
  61. data/sorbet/rbi/gems/thor@1.3.2.rbi +4378 -0
  62. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +66 -0
  63. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
  64. data/sorbet/rbi/gems/yard@0.9.36.rbi +18221 -0
  65. data/sorbet/rbi/shims/gems/fast_trie@0.5.1.rbi +18 -0
  66. data/sorbet/tapioca/config.yml +13 -0
  67. data/sorbet/tapioca/require.rb +6 -0
  68. metadata +113 -0
@@ -0,0 +1,406 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `concurrent-ruby` gem.
5
+ # Please instead update this file by running `bin/tapioca gem concurrent-ruby`.
6
+
7
+
8
+ # {include:file:README.md}
9
+ #
10
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/constants.rb#1
11
+ module Concurrent
12
+ extend ::Concurrent::Utility::EngineDetector
13
+ end
14
+
15
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#7
16
+ module Concurrent::Collection; end
17
+
18
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#10
19
+ Concurrent::Collection::MapImplementation = Concurrent::Collection::MriMapBackend
20
+
21
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#10
22
+ class Concurrent::Collection::MriMapBackend < ::Concurrent::Collection::NonConcurrentMapBackend
23
+ # @return [MriMapBackend] a new instance of MriMapBackend
24
+ #
25
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#12
26
+ def initialize(options = T.unsafe(nil), &default_proc); end
27
+
28
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#17
29
+ def []=(key, value); end
30
+
31
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#61
32
+ def clear; end
33
+
34
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#33
35
+ def compute(key); end
36
+
37
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#21
38
+ def compute_if_absent(key); end
39
+
40
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#29
41
+ def compute_if_present(key); end
42
+
43
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#53
44
+ def delete(key); end
45
+
46
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#57
47
+ def delete_pair(key, value); end
48
+
49
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#49
50
+ def get_and_set(key, value); end
51
+
52
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#37
53
+ def merge_pair(key, value); end
54
+
55
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#45
56
+ def replace_if_exists(key, new_value); end
57
+
58
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#41
59
+ def replace_pair(key, old_value, new_value); end
60
+ end
61
+
62
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#9
63
+ class Concurrent::Collection::NonConcurrentMapBackend
64
+ # WARNING: all public methods of the class must operate on the @backend
65
+ # directly without calling each other. This is important because of the
66
+ # SynchronizedMapBackend which uses a non-reentrant mutex for performance
67
+ # reasons.
68
+ #
69
+ # @return [NonConcurrentMapBackend] a new instance of NonConcurrentMapBackend
70
+ #
71
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#15
72
+ def initialize(options = T.unsafe(nil), &default_proc); end
73
+
74
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#21
75
+ def [](key); end
76
+
77
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#25
78
+ def []=(key, value); end
79
+
80
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#94
81
+ def clear; end
82
+
83
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#59
84
+ def compute(key); end
85
+
86
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#29
87
+ def compute_if_absent(key); end
88
+
89
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#53
90
+ def compute_if_present(key); end
91
+
92
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#81
93
+ def delete(key); end
94
+
95
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#85
96
+ def delete_pair(key, value); end
97
+
98
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#99
99
+ def each_pair; end
100
+
101
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#71
102
+ def get_and_set(key, value); end
103
+
104
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#110
105
+ def get_or_default(key, default_value); end
106
+
107
+ # @return [Boolean]
108
+ #
109
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#77
110
+ def key?(key); end
111
+
112
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#63
113
+ def merge_pair(key, value); end
114
+
115
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#46
116
+ def replace_if_exists(key, new_value); end
117
+
118
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#37
119
+ def replace_pair(key, old_value, new_value); end
120
+
121
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#106
122
+ def size; end
123
+
124
+ private
125
+
126
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#130
127
+ def dupped_backend; end
128
+
129
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#124
130
+ def initialize_copy(other); end
131
+
132
+ # @return [Boolean]
133
+ #
134
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#134
135
+ def pair?(key, expected_value); end
136
+
137
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#116
138
+ def set_backend(default_proc); end
139
+
140
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#138
141
+ def store_computed_value(key, new_value); end
142
+ end
143
+
144
+ # A thread-safe subclass of Hash. This version locks against the object
145
+ # itself for every method call, ensuring only one thread can be reading
146
+ # or writing at a time. This includes iteration methods like `#each`,
147
+ # which takes the lock repeatedly when reading an item.
148
+ #
149
+ # @see http://ruby-doc.org/core/Hash.html Ruby standard library `Hash`
150
+ #
151
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/hash.rb#49
152
+ class Concurrent::Hash < ::Hash; end
153
+
154
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/hash.rb#16
155
+ Concurrent::HashImplementation = Hash
156
+
157
+ # `Concurrent::Map` is a hash-like object and should have much better performance
158
+ # characteristics, especially under high concurrency, than `Concurrent::Hash`.
159
+ # However, `Concurrent::Map `is not strictly semantically equivalent to a ruby `Hash`
160
+ # -- for instance, it does not necessarily retain ordering by insertion time as `Hash`
161
+ # does. For most uses it should do fine though, and we recommend you consider
162
+ # `Concurrent::Map` instead of `Concurrent::Hash` for your concurrency-safe hash needs.
163
+ #
164
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#39
165
+ class Concurrent::Map < ::Concurrent::Collection::MriMapBackend
166
+ # Iterates over each key value pair.
167
+ # This method is atomic.
168
+ #
169
+ # @note Atomic methods taking a block do not allow the `self` instance
170
+ # to be used within the block. Doing so will cause a deadlock.
171
+ # @return [self]
172
+ # @yield for each key value pair in the map
173
+ # @yieldparam key [Object]
174
+ # @yieldparam value [Object]
175
+ #
176
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#274
177
+ def each; end
178
+
179
+ # Iterates over each key.
180
+ # This method is atomic.
181
+ #
182
+ # @note Atomic methods taking a block do not allow the `self` instance
183
+ # to be used within the block. Doing so will cause a deadlock.
184
+ # @return [self]
185
+ # @yield for each key in the map
186
+ # @yieldparam key [Object]
187
+ #
188
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#255
189
+ def each_key; end
190
+
191
+ # Iterates over each key value pair.
192
+ # This method is atomic.
193
+ #
194
+ # @note Atomic methods taking a block do not allow the `self` instance
195
+ # to be used within the block. Doing so will cause a deadlock.
196
+ # @return [self]
197
+ # @yield for each key value pair in the map
198
+ # @yieldparam key [Object]
199
+ # @yieldparam value [Object]
200
+ #
201
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#274
202
+ def each_pair; end
203
+
204
+ # Iterates over each value.
205
+ # This method is atomic.
206
+ #
207
+ # @note Atomic methods taking a block do not allow the `self` instance
208
+ # to be used within the block. Doing so will cause a deadlock.
209
+ # @return [self]
210
+ # @yield for each value in the map
211
+ # @yieldparam value [Object]
212
+ #
213
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#264
214
+ def each_value; end
215
+
216
+ # Is map empty?
217
+ #
218
+ # @return [true, false]
219
+ #
220
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#291
221
+ def empty?; end
222
+
223
+ # Get a value with key, or default_value when key is absent,
224
+ # or fail when no default_value is given.
225
+ #
226
+ # @note The "fetch-then-act" methods of `Map` are not atomic. `Map` is intended
227
+ # to be use as a concurrency primitive with strong happens-before
228
+ # guarantees. It is not intended to be used as a high-level abstraction
229
+ # supporting complex operations. All read and write operations are
230
+ # thread safe, but no guarantees are made regarding race conditions
231
+ # between the fetch operation and yielding to the block. Additionally,
232
+ # this method does not support recursion. This is due to internal
233
+ # constraints that are very unlikely to change in the near future.
234
+ # @param key [Object]
235
+ # @param default_value [Object]
236
+ # @raise [KeyError] when key is missing and no default_value is provided
237
+ # @return [Object] the value or default value
238
+ # @yield default value for a key
239
+ # @yieldparam key [Object]
240
+ # @yieldreturn [Object] default value
241
+ #
242
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#183
243
+ def fetch(key, default_value = T.unsafe(nil)); end
244
+
245
+ # Fetch value with key, or store default value when key is absent,
246
+ # or fail when no default_value is given. This is a two step operation,
247
+ # therefore not atomic. The store can overwrite other concurrently
248
+ # stored value.
249
+ #
250
+ # @param key [Object]
251
+ # @param default_value [Object]
252
+ # @return [Object] the value or default value
253
+ # @yield default value for a key
254
+ # @yieldparam key [Object]
255
+ # @yieldreturn [Object] default value
256
+ #
257
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#205
258
+ def fetch_or_store(key, default_value = T.unsafe(nil)); end
259
+
260
+ # Get a value with key
261
+ #
262
+ # @param key [Object]
263
+ # @return [Object] the value
264
+ #
265
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#21
266
+ def get(key); end
267
+
268
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#321
269
+ def inspect; end
270
+
271
+ # Find key of a value.
272
+ #
273
+ # @param value [Object]
274
+ # @return [Object, nil] key or nil when not found
275
+ #
276
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#284
277
+ def key(value); end
278
+
279
+ # All keys
280
+ #
281
+ # @return [::Array<Object>] keys
282
+ #
283
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#236
284
+ def keys; end
285
+
286
+ # @raise [TypeError]
287
+ #
288
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#305
289
+ def marshal_dump; end
290
+
291
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#313
292
+ def marshal_load(hash); end
293
+
294
+ # Set a value with key
295
+ #
296
+ # @param key [Object]
297
+ # @param value [Object]
298
+ # @return [Object] the new value
299
+ #
300
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#17
301
+ def put(key, value); end
302
+
303
+ # Insert value into map with key if key is absent in one atomic step.
304
+ #
305
+ # @param key [Object]
306
+ # @param value [Object]
307
+ # @return [Object, nil] the previous value when key was present or nil when there was no key
308
+ #
309
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#215
310
+ def put_if_absent(key, value); end
311
+
312
+ # Is the value stored in the map. Iterates over all values.
313
+ #
314
+ # @param value [Object]
315
+ # @return [true, false]
316
+ #
317
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#227
318
+ def value?(value); end
319
+
320
+ # All values
321
+ #
322
+ # @return [::Array<Object>] values
323
+ #
324
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#244
325
+ def values; end
326
+
327
+ private
328
+
329
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#331
330
+ def initialize_copy(other); end
331
+
332
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#336
333
+ def populate_from(hash); end
334
+
335
+ # @raise [KeyError]
336
+ #
337
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#327
338
+ def raise_fetch_no_key; end
339
+
340
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/map.rb#341
341
+ def validate_options_hash!(options); end
342
+ end
343
+
344
+ # Various classes within allows for +nil+ values to be stored,
345
+ # so a special +NULL+ token is required to indicate the "nil-ness".
346
+ #
347
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/constants.rb#6
348
+ Concurrent::NULL = T.let(T.unsafe(nil), Object)
349
+
350
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/thread_safe/util.rb#4
351
+ module Concurrent::ThreadSafe; end
352
+
353
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/thread_safe/util.rb#7
354
+ module Concurrent::ThreadSafe::Util; end
355
+
356
+ # TODO (pitr-ch 15-Oct-2016): migrate to Utility::ProcessorCounter
357
+ #
358
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/thread_safe/util.rb#13
359
+ Concurrent::ThreadSafe::Util::CPU_COUNT = T.let(T.unsafe(nil), Integer)
360
+
361
+ # TODO (pitr-ch 15-Oct-2016): migrate to Utility::NativeInteger
362
+ #
363
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/thread_safe/util.rb#10
364
+ Concurrent::ThreadSafe::Util::FIXNUM_BIT_SIZE = T.let(T.unsafe(nil), Integer)
365
+
366
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/thread_safe/util.rb#11
367
+ Concurrent::ThreadSafe::Util::MAX_INT = T.let(T.unsafe(nil), Integer)
368
+
369
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/utility/engine.rb#3
370
+ module Concurrent::Utility; end
371
+
372
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/utility/engine.rb#6
373
+ module Concurrent::Utility::EngineDetector
374
+ # @return [Boolean]
375
+ #
376
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/utility/engine.rb#7
377
+ def on_cruby?; end
378
+
379
+ # @return [Boolean]
380
+ #
381
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/utility/engine.rb#11
382
+ def on_jruby?; end
383
+
384
+ # @return [Boolean]
385
+ #
386
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/utility/engine.rb#27
387
+ def on_linux?; end
388
+
389
+ # @return [Boolean]
390
+ #
391
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/utility/engine.rb#23
392
+ def on_osx?; end
393
+
394
+ # @return [Boolean]
395
+ #
396
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/utility/engine.rb#15
397
+ def on_truffleruby?; end
398
+
399
+ # @return [Boolean]
400
+ #
401
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/utility/engine.rb#19
402
+ def on_windows?; end
403
+
404
+ # source://concurrent-ruby/lib/concurrent-ruby/concurrent/utility/engine.rb#31
405
+ def ruby_version(version = T.unsafe(nil), comparison, major, minor, patch); end
406
+ end
@@ -0,0 +1,150 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `erubi` gem.
5
+ # Please instead update this file by running `bin/tapioca gem erubi`.
6
+
7
+
8
+ # source://erubi/lib/erubi.rb#3
9
+ module Erubi
10
+ private
11
+
12
+ def h(_arg0); end
13
+
14
+ class << self
15
+ def h(_arg0); end
16
+ end
17
+ end
18
+
19
+ # source://erubi/lib/erubi.rb#51
20
+ class Erubi::Engine
21
+ # Initialize a new Erubi::Engine. Options:
22
+ # +:bufval+ :: The value to use for the buffer variable, as a string (default <tt>'::String.new'</tt>).
23
+ # +:bufvar+ :: The variable name to use for the buffer variable, as a string.
24
+ # +:chain_appends+ :: Whether to chain <tt><<</t> calls to the buffer variable. Offers better
25
+ # performance, but can cause issues when the buffer variable is reassigned during
26
+ # template rendering (default +false+).
27
+ # +:ensure+ :: Wrap the template in a begin/ensure block restoring the previous value of bufvar.
28
+ # +:escapefunc+ :: The function to use for escaping, as a string (default: <tt>'::Erubi.h'</tt>).
29
+ # +:escape+ :: Whether to make <tt><%=</tt> escape by default, and <tt><%==</tt> not escape by default.
30
+ # +:escape_html+ :: Same as +:escape+, with lower priority.
31
+ # +:filename+ :: The filename for the template.
32
+ # the resulting source code. Note this may cause problems if you are wrapping the resulting
33
+ # source code in other code, because the magic comment only has an effect at the beginning of
34
+ # the file, and having the magic comment later in the file can trigger warnings.
35
+ # +:freeze_template_literals+ :: Whether to suffix all literal strings for template code with <tt>.freeze</tt>
36
+ # (default: +true+ on Ruby 2.1+, +false+ on Ruby 2.0 and older).
37
+ # Can be set to +false+ on Ruby 2.3+ when frozen string literals are enabled
38
+ # in order to improve performance.
39
+ # +:literal_prefix+ :: The prefix to output when using escaped tag delimiters (default <tt>'<%'</tt>).
40
+ # +:literal_postfix+ :: The postfix to output when using escaped tag delimiters (default <tt>'%>'</tt>).
41
+ # +:outvar+ :: Same as +:bufvar+, with lower priority.
42
+ # +:postamble+ :: The postamble for the template, by default returns the resulting source code.
43
+ # +:preamble+ :: The preamble for the template, by default initializes the buffer variable.
44
+ # +:regexp+ :: The regexp to use for scanning.
45
+ # +:src+ :: The initial value to use for the source code, an empty string by default.
46
+ # +:trim+ :: Whether to trim leading and trailing whitespace, true by default.
47
+ #
48
+ # @return [Engine] a new instance of Engine
49
+ #
50
+ # source://erubi/lib/erubi.rb#91
51
+ def initialize(input, properties = T.unsafe(nil)); end
52
+
53
+ # The variable name used for the buffer variable.
54
+ #
55
+ # source://erubi/lib/erubi.rb#62
56
+ def bufvar; end
57
+
58
+ # The filename of the template, if one was given.
59
+ #
60
+ # source://erubi/lib/erubi.rb#59
61
+ def filename; end
62
+
63
+ # The frozen ruby source code generated from the template, which can be evaled.
64
+ #
65
+ # source://erubi/lib/erubi.rb#56
66
+ def src; end
67
+
68
+ private
69
+
70
+ # Add ruby code to the template
71
+ #
72
+ # source://erubi/lib/erubi.rb#223
73
+ def add_code(code); end
74
+
75
+ # Add the given ruby expression result to the template,
76
+ # escaping it based on the indicator given and escape flag.
77
+ #
78
+ # source://erubi/lib/erubi.rb#232
79
+ def add_expression(indicator, code); end
80
+
81
+ # Add the result of Ruby expression to the template
82
+ #
83
+ # source://erubi/lib/erubi.rb#241
84
+ def add_expression_result(code); end
85
+
86
+ # Add the escaped result of Ruby expression to the template
87
+ #
88
+ # source://erubi/lib/erubi.rb#246
89
+ def add_expression_result_escaped(code); end
90
+
91
+ # Add the given postamble to the src. Can be overridden in subclasses
92
+ # to make additional changes to src that depend on the current state.
93
+ #
94
+ # source://erubi/lib/erubi.rb#252
95
+ def add_postamble(postamble); end
96
+
97
+ # Add raw text to the template. Modifies argument if argument is mutable as a memory optimization.
98
+ # Must be called with a string, cannot be called with nil (Rails's subclass depends on it).
99
+ #
100
+ # source://erubi/lib/erubi.rb#210
101
+ def add_text(text); end
102
+
103
+ # Raise an exception, as the base engine class does not support handling other indicators.
104
+ #
105
+ # @raise [ArgumentError]
106
+ #
107
+ # source://erubi/lib/erubi.rb#258
108
+ def handle(indicator, code, tailch, rspace, lspace); end
109
+
110
+ # Make sure that any current expression has been terminated.
111
+ # The default is to terminate all expressions, but when
112
+ # the chain_appends option is used, expressions may not be
113
+ # terminated.
114
+ #
115
+ # source://erubi/lib/erubi.rb#286
116
+ def terminate_expression; end
117
+
118
+ # Make sure the buffer variable is the target of the next append
119
+ # before yielding to the block. Mark that the buffer is the target
120
+ # of the next append after the block executes.
121
+ #
122
+ # This method should only be called if the block will result in
123
+ # code where << will append to the bufvar.
124
+ #
125
+ # source://erubi/lib/erubi.rb#268
126
+ def with_buffer; end
127
+ end
128
+
129
+ # The default regular expression used for scanning.
130
+ #
131
+ # source://erubi/lib/erubi.rb#53
132
+ Erubi::Engine::DEFAULT_REGEXP = T.let(T.unsafe(nil), Regexp)
133
+
134
+ # source://erubi/lib/erubi.rb#17
135
+ Erubi::FREEZE_TEMPLATE_LITERALS = T.let(T.unsafe(nil), TrueClass)
136
+
137
+ # source://erubi/lib/erubi.rb#15
138
+ Erubi::MATCH_METHOD = T.let(T.unsafe(nil), Symbol)
139
+
140
+ # source://erubi/lib/erubi.rb#8
141
+ Erubi::RANGE_FIRST = T.let(T.unsafe(nil), Integer)
142
+
143
+ # source://erubi/lib/erubi.rb#9
144
+ Erubi::RANGE_LAST = T.let(T.unsafe(nil), Integer)
145
+
146
+ # source://erubi/lib/erubi.rb#16
147
+ Erubi::SKIP_DEFINED_FOR_INSTANCE_VARIABLE = T.let(T.unsafe(nil), TrueClass)
148
+
149
+ # source://erubi/lib/erubi.rb#4
150
+ Erubi::VERSION = T.let(T.unsafe(nil), String)