tsumanne 0.0.2 → 0.0.4

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 (99) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +8 -0
  3. data/.mdlrc +6 -0
  4. data/.rubocop.yml +20 -12
  5. data/Dockerfile +24 -0
  6. data/README.md +0 -4
  7. data/Rakefile +19 -16
  8. data/exe/tsumanne +2 -1
  9. data/lib/tsumanne/api.rb +22 -21
  10. data/lib/tsumanne/cli.rb +153 -2
  11. data/lib/tsumanne/models/get_threads.rb +8 -3
  12. data/lib/tsumanne/models/register_thread.rb +5 -1
  13. data/lib/tsumanne/models/search_indexes.rb +7 -2
  14. data/lib/tsumanne/models/search_thread_from_uri.rb +14 -2
  15. data/lib/tsumanne/version.rb +1 -1
  16. data/mise.toml +42 -0
  17. data/sorbet/rbi/gems/.gitattributes +1 -0
  18. data/sorbet/rbi/gems/{ast@2.4.2.rbi → ast@2.4.3.rbi} +45 -79
  19. data/sorbet/rbi/gems/benchmark@0.5.0.rbi +621 -0
  20. data/sorbet/rbi/gems/{chef-utils@18.2.7.rbi → chef-utils@18.8.54.rbi} +1 -0
  21. data/sorbet/rbi/gems/{concurrent-ruby@1.2.2.rbi → concurrent-ruby@1.3.5.rbi} +1 -0
  22. data/sorbet/rbi/gems/{diff-lcs@1.5.0.rbi → diff-lcs@1.6.2.rbi} +183 -199
  23. data/sorbet/rbi/gems/docile@1.4.0.rbi +147 -147
  24. data/sorbet/rbi/gems/{erubi@1.12.0.rbi → erubi@1.13.1.rbi} +36 -26
  25. data/sorbet/rbi/gems/{json@2.6.3.rbi → json@2.19.4.rbi} +920 -251
  26. data/sorbet/rbi/gems/kramdown-parser-gfm@1.1.0.rbi +32 -63
  27. data/sorbet/rbi/gems/{kramdown@2.4.0.rbi → kramdown@2.5.1.rbi} +896 -711
  28. data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
  29. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +189 -0
  30. data/sorbet/rbi/gems/logger@1.7.0.rbi +896 -0
  31. data/sorbet/rbi/gems/{mdl@0.12.0.rbi → mdl@0.15.0.rbi} +109 -113
  32. data/sorbet/rbi/gems/mixlib-cli@2.1.8.rbi +35 -41
  33. data/sorbet/rbi/gems/mixlib-config@3.0.27.rbi +147 -142
  34. data/sorbet/rbi/gems/{mixlib-shellout@3.2.7.rbi → mixlib-shellout@3.3.9.rbi} +127 -150
  35. data/sorbet/rbi/gems/netrc@0.11.0.rbi +45 -56
  36. data/sorbet/rbi/gems/optimist@3.2.1.rbi +895 -0
  37. data/sorbet/rbi/gems/parallel@1.28.0.rbi +270 -0
  38. data/sorbet/rbi/gems/parser@3.3.11.1.rbi +5229 -0
  39. data/sorbet/rbi/gems/prism@1.9.0.rbi +42224 -0
  40. data/sorbet/rbi/gems/{racc@1.7.1.rbi → racc@1.8.1.rbi} +48 -44
  41. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +101 -141
  42. data/sorbet/rbi/gems/{rake@13.0.6.rbi → rake@13.4.2.rbi} +867 -761
  43. data/sorbet/rbi/gems/rbi@0.3.10.rbi +5520 -0
  44. data/sorbet/rbi/gems/rbs@4.0.2.rbi +6908 -0
  45. data/sorbet/rbi/gems/regexp_parser@2.12.0.rbi +3398 -0
  46. data/sorbet/rbi/gems/require-hooks@0.4.0.rbi +152 -0
  47. data/sorbet/rbi/gems/{rexml@3.2.6.rbi → rexml@3.4.4.rbi} +1032 -908
  48. data/sorbet/rbi/gems/{rspec-core@3.12.2.rbi → rspec-core@3.13.6.rbi} +2860 -4206
  49. data/sorbet/rbi/gems/rspec-expectations@3.13.5.rbi +6108 -0
  50. data/sorbet/rbi/gems/{rspec-mocks@3.12.6.rbi → rspec-mocks@3.13.7.rbi} +1264 -1787
  51. data/sorbet/rbi/gems/rspec-support@3.13.6.rbi +1274 -0
  52. data/sorbet/rbi/gems/rspec@3.13.2.rbi +15 -0
  53. data/sorbet/rbi/gems/rubocop-ast@1.49.1.rbi +7212 -0
  54. data/sorbet/rbi/gems/rubocop-performance@1.26.1.rbi +3403 -0
  55. data/sorbet/rbi/gems/{rubocop-rake@0.6.0.rbi → rubocop-rake@0.7.1.rbi} +89 -103
  56. data/sorbet/rbi/gems/rubocop-rspec@3.9.0.rbi +7606 -0
  57. data/sorbet/rbi/gems/rubocop-sorbet@0.12.0.rbi +2448 -0
  58. data/sorbet/rbi/gems/rubocop@1.86.1.rbi +62232 -0
  59. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +326 -655
  60. data/sorbet/rbi/gems/rubydex@0.1.0.beta14.rbi +655 -0
  61. data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +24 -158
  62. data/sorbet/rbi/gems/simplecov@0.22.0.rbi +450 -606
  63. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +32 -166
  64. data/sorbet/rbi/gems/spoom@1.7.13.rbi +6151 -0
  65. data/sorbet/rbi/gems/{tapioca@0.11.8.rbi → tapioca@0.19.1.rbi} +1609 -1379
  66. data/sorbet/rbi/gems/{thor@1.2.2.rbi → thor@1.5.0.rbi} +1075 -1170
  67. data/sorbet/rbi/gems/tomlrb@2.0.3.rbi +1 -0
  68. data/sorbet/rbi/gems/tsort@0.2.0.rbi +389 -0
  69. data/sorbet/rbi/gems/unicode-display_width@3.2.0.rbi +130 -0
  70. data/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi +332 -0
  71. metadata +69 -66
  72. data/.ruby-version +0 -1
  73. data/sorbet/rbi/gems/base64@0.1.1.rbi +0 -172
  74. data/sorbet/rbi/gems/ffi-compiler@1.0.1.rbi +0 -206
  75. data/sorbet/rbi/gems/ffi@1.15.5.rbi +0 -1994
  76. data/sorbet/rbi/gems/http-parser@1.2.3.rbi +0 -422
  77. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +0 -14237
  78. data/sorbet/rbi/gems/mhtml@0.1.6.rbi +0 -353
  79. data/sorbet/rbi/gems/parallel@1.23.0.rbi +0 -273
  80. data/sorbet/rbi/gems/parser@3.2.2.3.rbi +0 -7253
  81. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +0 -951
  82. data/sorbet/rbi/gems/rbi@0.0.17.rbi +0 -2967
  83. data/sorbet/rbi/gems/regexp_parser@2.8.1.rbi +0 -3749
  84. data/sorbet/rbi/gems/rspec-expectations@3.12.3.rbi +0 -8100
  85. data/sorbet/rbi/gems/rspec-support@3.12.1.rbi +0 -1609
  86. data/sorbet/rbi/gems/rspec@3.12.0.rbi +0 -82
  87. data/sorbet/rbi/gems/rubocop-ast@1.29.0.rbi +0 -7144
  88. data/sorbet/rbi/gems/rubocop-capybara@2.18.0.rbi +0 -827
  89. data/sorbet/rbi/gems/rubocop-factory_bot@2.23.1.rbi +0 -812
  90. data/sorbet/rbi/gems/rubocop-performance@1.19.0.rbi +0 -3157
  91. data/sorbet/rbi/gems/rubocop-rspec@2.23.2.rbi +0 -7691
  92. data/sorbet/rbi/gems/rubocop-sorbet@0.7.3.rbi +0 -1226
  93. data/sorbet/rbi/gems/rubocop@1.56.2.rbi +0 -56541
  94. data/sorbet/rbi/gems/spoom@1.2.3.rbi +0 -3199
  95. data/sorbet/rbi/gems/syntax_tree@6.1.1.rbi +0 -22855
  96. data/sorbet/rbi/gems/unicode-display_width@2.4.2.rbi +0 -65
  97. data/sorbet/rbi/gems/unparser@0.6.8.rbi +0 -4525
  98. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +0 -425
  99. data/sorbet/rbi/gems/yard@0.9.34.rbi +0 -18219
@@ -4,5 +4,6 @@
4
4
  # This is an autogenerated file for types exported from the `tomlrb` gem.
5
5
  # Please instead update this file by running `bin/tapioca gem tomlrb`.
6
6
 
7
+
7
8
  # THIS IS AN EMPTY RBI FILE.
8
9
  # see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
@@ -0,0 +1,389 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `tsort` gem.
5
+ # Please instead update this file by running `bin/tapioca gem tsort`.
6
+
7
+
8
+ # TSort implements topological sorting using Tarjan's algorithm for
9
+ # strongly connected components.
10
+ #
11
+ # TSort is designed to be able to be used with any object which can be
12
+ # interpreted as a directed graph.
13
+ #
14
+ # TSort requires two methods to interpret an object as a graph,
15
+ # tsort_each_node and tsort_each_child.
16
+ #
17
+ # * tsort_each_node is used to iterate for all nodes over a graph.
18
+ # * tsort_each_child is used to iterate for child nodes of a given node.
19
+ #
20
+ # The equality of nodes are defined by eql? and hash since
21
+ # TSort uses Hash internally.
22
+ #
23
+ # == A Simple Example
24
+ #
25
+ # The following example demonstrates how to mix the TSort module into an
26
+ # existing class (in this case, Hash). Here, we're treating each key in
27
+ # the hash as a node in the graph, and so we simply alias the required
28
+ # #tsort_each_node method to Hash's #each_key method. For each key in the
29
+ # hash, the associated value is an array of the node's child nodes. This
30
+ # choice in turn leads to our implementation of the required #tsort_each_child
31
+ # method, which fetches the array of child nodes and then iterates over that
32
+ # array using the user-supplied block.
33
+ #
34
+ # require 'tsort'
35
+ #
36
+ # class Hash
37
+ # include TSort
38
+ # alias tsort_each_node each_key
39
+ # def tsort_each_child(node, &block)
40
+ # fetch(node).each(&block)
41
+ # end
42
+ # end
43
+ #
44
+ # {1=>[2, 3], 2=>[3], 3=>[], 4=>[]}.tsort
45
+ # #=> [3, 2, 1, 4]
46
+ #
47
+ # {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}.strongly_connected_components
48
+ # #=> [[4], [2, 3], [1]]
49
+ #
50
+ # == A More Realistic Example
51
+ #
52
+ # A very simple `make' like tool can be implemented as follows:
53
+ #
54
+ # require 'tsort'
55
+ #
56
+ # class Make
57
+ # def initialize
58
+ # @dep = {}
59
+ # @dep.default = []
60
+ # end
61
+ #
62
+ # def rule(outputs, inputs=[], &block)
63
+ # triple = [outputs, inputs, block]
64
+ # outputs.each {|f| @dep[f] = [triple]}
65
+ # @dep[triple] = inputs
66
+ # end
67
+ #
68
+ # def build(target)
69
+ # each_strongly_connected_component_from(target) {|ns|
70
+ # if ns.length != 1
71
+ # fs = ns.delete_if {|n| Array === n}
72
+ # raise TSort::Cyclic.new("cyclic dependencies: #{fs.join ', '}")
73
+ # end
74
+ # n = ns.first
75
+ # if Array === n
76
+ # outputs, inputs, block = n
77
+ # inputs_time = inputs.map {|f| File.mtime f}.max
78
+ # begin
79
+ # outputs_time = outputs.map {|f| File.mtime f}.min
80
+ # rescue Errno::ENOENT
81
+ # outputs_time = nil
82
+ # end
83
+ # if outputs_time == nil ||
84
+ # inputs_time != nil && outputs_time <= inputs_time
85
+ # sleep 1 if inputs_time != nil && inputs_time.to_i == Time.now.to_i
86
+ # block.call
87
+ # end
88
+ # end
89
+ # }
90
+ # end
91
+ #
92
+ # def tsort_each_child(node, &block)
93
+ # @dep[node].each(&block)
94
+ # end
95
+ # include TSort
96
+ # end
97
+ #
98
+ # def command(arg)
99
+ # print arg, "\n"
100
+ # system arg
101
+ # end
102
+ #
103
+ # m = Make.new
104
+ # m.rule(%w[t1]) { command 'date > t1' }
105
+ # m.rule(%w[t2]) { command 'date > t2' }
106
+ # m.rule(%w[t3]) { command 'date > t3' }
107
+ # m.rule(%w[t4], %w[t1 t3]) { command 'cat t1 t3 > t4' }
108
+ # m.rule(%w[t5], %w[t4 t2]) { command 'cat t4 t2 > t5' }
109
+ # m.build('t5')
110
+ #
111
+ # == Bugs
112
+ #
113
+ # * 'tsort.rb' is wrong name because this library uses
114
+ # Tarjan's algorithm for strongly connected components.
115
+ # Although 'strongly_connected_components.rb' is correct but too long.
116
+ #
117
+ # == References
118
+ #
119
+ # R. E. Tarjan, "Depth First Search and Linear Graph Algorithms",
120
+ # <em>SIAM Journal on Computing</em>, Vol. 1, No. 2, pp. 146-160, June 1972.
121
+ module TSort
122
+ # The iterator version of the #strongly_connected_components method.
123
+ # <tt><em>obj</em>.each_strongly_connected_component</tt> is similar to
124
+ # <tt><em>obj</em>.strongly_connected_components.each</tt>, but
125
+ # modification of _obj_ during the iteration may lead to unexpected results.
126
+ #
127
+ # #each_strongly_connected_component returns +nil+.
128
+ #
129
+ # class G
130
+ # include TSort
131
+ # def initialize(g)
132
+ # @g = g
133
+ # end
134
+ # def tsort_each_child(n, &b) @g[n].each(&b) end
135
+ # def tsort_each_node(&b) @g.each_key(&b) end
136
+ # end
137
+ #
138
+ # graph = G.new({1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]})
139
+ # graph.each_strongly_connected_component {|scc| p scc }
140
+ # #=> [4]
141
+ # # [2]
142
+ # # [3]
143
+ # # [1]
144
+ #
145
+ # graph = G.new({1=>[2], 2=>[3, 4], 3=>[2], 4=>[]})
146
+ # graph.each_strongly_connected_component {|scc| p scc }
147
+ # #=> [4]
148
+ # # [2, 3]
149
+ # # [1]
150
+ #
151
+ # pkg:gem/tsort#tsort.rb:318
152
+ def each_strongly_connected_component(&block); end
153
+
154
+ # Iterates over strongly connected component in the subgraph reachable from
155
+ # _node_.
156
+ #
157
+ # Return value is unspecified.
158
+ #
159
+ # #each_strongly_connected_component_from doesn't call #tsort_each_node.
160
+ #
161
+ # class G
162
+ # include TSort
163
+ # def initialize(g)
164
+ # @g = g
165
+ # end
166
+ # def tsort_each_child(n, &b) @g[n].each(&b) end
167
+ # def tsort_each_node(&b) @g.each_key(&b) end
168
+ # end
169
+ #
170
+ # graph = G.new({1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]})
171
+ # graph.each_strongly_connected_component_from(2) {|scc| p scc }
172
+ # #=> [4]
173
+ # # [2]
174
+ #
175
+ # graph = G.new({1=>[2], 2=>[3, 4], 3=>[2], 4=>[]})
176
+ # graph.each_strongly_connected_component_from(2) {|scc| p scc }
177
+ # #=> [4]
178
+ # # [2, 3]
179
+ #
180
+ # pkg:gem/tsort#tsort.rb:388
181
+ def each_strongly_connected_component_from(node, id_map = T.unsafe(nil), stack = T.unsafe(nil), &block); end
182
+
183
+ # Returns strongly connected components as an array of arrays of nodes.
184
+ # The array is sorted from children to parents.
185
+ # Each elements of the array represents a strongly connected component.
186
+ #
187
+ # class G
188
+ # include TSort
189
+ # def initialize(g)
190
+ # @g = g
191
+ # end
192
+ # def tsort_each_child(n, &b) @g[n].each(&b) end
193
+ # def tsort_each_node(&b) @g.each_key(&b) end
194
+ # end
195
+ #
196
+ # graph = G.new({1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]})
197
+ # p graph.strongly_connected_components #=> [[4], [2], [3], [1]]
198
+ #
199
+ # graph = G.new({1=>[2], 2=>[3, 4], 3=>[2], 4=>[]})
200
+ # p graph.strongly_connected_components #=> [[4], [2, 3], [1]]
201
+ #
202
+ # pkg:gem/tsort#tsort.rb:259
203
+ def strongly_connected_components; end
204
+
205
+ # Returns a topologically sorted array of nodes.
206
+ # The array is sorted from children to parents, i.e.
207
+ # the first element has no child and the last node has no parent.
208
+ #
209
+ # If there is a cycle, TSort::Cyclic is raised.
210
+ #
211
+ # class G
212
+ # include TSort
213
+ # def initialize(g)
214
+ # @g = g
215
+ # end
216
+ # def tsort_each_child(n, &b) @g[n].each(&b) end
217
+ # def tsort_each_node(&b) @g.each_key(&b) end
218
+ # end
219
+ #
220
+ # graph = G.new({1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]})
221
+ # p graph.tsort #=> [4, 2, 3, 1]
222
+ #
223
+ # graph = G.new({1=>[2], 2=>[3, 4], 3=>[2], 4=>[]})
224
+ # p graph.tsort # raises TSort::Cyclic
225
+ #
226
+ # pkg:gem/tsort#tsort.rb:154
227
+ def tsort; end
228
+
229
+ # The iterator version of the #tsort method.
230
+ # <tt><em>obj</em>.tsort_each</tt> is similar to <tt><em>obj</em>.tsort.each</tt>, but
231
+ # modification of _obj_ during the iteration may lead to unexpected results.
232
+ #
233
+ # #tsort_each returns +nil+.
234
+ # If there is a cycle, TSort::Cyclic is raised.
235
+ #
236
+ # class G
237
+ # include TSort
238
+ # def initialize(g)
239
+ # @g = g
240
+ # end
241
+ # def tsort_each_child(n, &b) @g[n].each(&b) end
242
+ # def tsort_each_node(&b) @g.each_key(&b) end
243
+ # end
244
+ #
245
+ # graph = G.new({1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]})
246
+ # graph.tsort_each {|n| p n }
247
+ # #=> 4
248
+ # # 2
249
+ # # 3
250
+ # # 1
251
+ #
252
+ # pkg:gem/tsort#tsort.rb:207
253
+ def tsort_each(&block); end
254
+
255
+ # Should be implemented by a extended class.
256
+ #
257
+ # #tsort_each_child is used to iterate for child nodes of _node_.
258
+ #
259
+ # pkg:gem/tsort#tsort.rb:454
260
+ def tsort_each_child(node); end
261
+
262
+ # Should be implemented by a extended class.
263
+ #
264
+ # #tsort_each_node is used to iterate for all nodes over a graph.
265
+ #
266
+ # pkg:gem/tsort#tsort.rb:446
267
+ def tsort_each_node; end
268
+
269
+ class << self
270
+ # The iterator version of the TSort.strongly_connected_components method.
271
+ #
272
+ # The graph is represented by _each_node_ and _each_child_.
273
+ # _each_node_ should have +call+ method which yields for each node in the graph.
274
+ # _each_child_ should have +call+ method which takes a node argument and yields for each child node.
275
+ #
276
+ # g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}
277
+ # each_node = lambda {|&b| g.each_key(&b) }
278
+ # each_child = lambda {|n, &b| g[n].each(&b) }
279
+ # TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc }
280
+ # #=> [4]
281
+ # # [2]
282
+ # # [3]
283
+ # # [1]
284
+ #
285
+ # g = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
286
+ # each_node = lambda {|&b| g.each_key(&b) }
287
+ # each_child = lambda {|n, &b| g[n].each(&b) }
288
+ # TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc }
289
+ # #=> [4]
290
+ # # [2, 3]
291
+ # # [1]
292
+ #
293
+ # pkg:gem/tsort#tsort.rb:347
294
+ def each_strongly_connected_component(each_node, each_child); end
295
+
296
+ # Iterates over strongly connected components in a graph.
297
+ # The graph is represented by _node_ and _each_child_.
298
+ #
299
+ # _node_ is the first node.
300
+ # _each_child_ should have +call+ method which takes a node argument
301
+ # and yields for each child node.
302
+ #
303
+ # Return value is unspecified.
304
+ #
305
+ # #TSort.each_strongly_connected_component_from is a class method and
306
+ # it doesn't need a class to represent a graph which includes TSort.
307
+ #
308
+ # graph = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
309
+ # each_child = lambda {|n, &b| graph[n].each(&b) }
310
+ # TSort.each_strongly_connected_component_from(1, each_child) {|scc|
311
+ # p scc
312
+ # }
313
+ # #=> [4]
314
+ # # [2, 3]
315
+ # # [1]
316
+ #
317
+ # pkg:gem/tsort#tsort.rb:413
318
+ def each_strongly_connected_component_from(node, each_child, id_map = T.unsafe(nil), stack = T.unsafe(nil)); end
319
+
320
+ # Returns strongly connected components as an array of arrays of nodes.
321
+ # The array is sorted from children to parents.
322
+ # Each elements of the array represents a strongly connected component.
323
+ #
324
+ # The graph is represented by _each_node_ and _each_child_.
325
+ # _each_node_ should have +call+ method which yields for each node in the graph.
326
+ # _each_child_ should have +call+ method which takes a node argument and yields for each child node.
327
+ #
328
+ # g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}
329
+ # each_node = lambda {|&b| g.each_key(&b) }
330
+ # each_child = lambda {|n, &b| g[n].each(&b) }
331
+ # p TSort.strongly_connected_components(each_node, each_child)
332
+ # #=> [[4], [2], [3], [1]]
333
+ #
334
+ # g = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
335
+ # each_node = lambda {|&b| g.each_key(&b) }
336
+ # each_child = lambda {|n, &b| g[n].each(&b) }
337
+ # p TSort.strongly_connected_components(each_node, each_child)
338
+ # #=> [[4], [2, 3], [1]]
339
+ #
340
+ # pkg:gem/tsort#tsort.rb:285
341
+ def strongly_connected_components(each_node, each_child); end
342
+
343
+ # Returns a topologically sorted array of nodes.
344
+ # The array is sorted from children to parents, i.e.
345
+ # the first element has no child and the last node has no parent.
346
+ #
347
+ # The graph is represented by _each_node_ and _each_child_.
348
+ # _each_node_ should have +call+ method which yields for each node in the graph.
349
+ # _each_child_ should have +call+ method which takes a node argument and yields for each child node.
350
+ #
351
+ # If there is a cycle, TSort::Cyclic is raised.
352
+ #
353
+ # g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}
354
+ # each_node = lambda {|&b| g.each_key(&b) }
355
+ # each_child = lambda {|n, &b| g[n].each(&b) }
356
+ # p TSort.tsort(each_node, each_child) #=> [4, 2, 3, 1]
357
+ #
358
+ # g = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
359
+ # each_node = lambda {|&b| g.each_key(&b) }
360
+ # each_child = lambda {|n, &b| g[n].each(&b) }
361
+ # p TSort.tsort(each_node, each_child) # raises TSort::Cyclic
362
+ #
363
+ # pkg:gem/tsort#tsort.rb:180
364
+ def tsort(each_node, each_child); end
365
+
366
+ # The iterator version of the TSort.tsort method.
367
+ #
368
+ # The graph is represented by _each_node_ and _each_child_.
369
+ # _each_node_ should have +call+ method which yields for each node in the graph.
370
+ # _each_child_ should have +call+ method which takes a node argument and yields for each child node.
371
+ #
372
+ # g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}
373
+ # each_node = lambda {|&b| g.each_key(&b) }
374
+ # each_child = lambda {|n, &b| g[n].each(&b) }
375
+ # TSort.tsort_each(each_node, each_child) {|n| p n }
376
+ # #=> 4
377
+ # # 2
378
+ # # 3
379
+ # # 1
380
+ #
381
+ # pkg:gem/tsort#tsort.rb:228
382
+ def tsort_each(each_node, each_child); end
383
+ end
384
+ end
385
+
386
+ # The version string.
387
+ #
388
+ # pkg:gem/tsort#tsort.rb:127
389
+ TSort::VERSION = T.let(T.unsafe(nil), String)
@@ -0,0 +1,130 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `unicode-display_width` gem.
5
+ # Please instead update this file by running `bin/tapioca gem unicode-display_width`.
6
+
7
+
8
+ # pkg:gem/unicode-display_width#lib/unicode/display_width/constants.rb:3
9
+ module Unicode; end
10
+
11
+ # pkg:gem/unicode-display_width#lib/unicode/display_width/constants.rb:4
12
+ class Unicode::DisplayWidth
13
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:229
14
+ def initialize(ambiguous: T.unsafe(nil), overwrite: T.unsafe(nil), emoji: T.unsafe(nil)); end
15
+
16
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:235
17
+ def get_config(**kwargs); end
18
+
19
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:243
20
+ def of(string, **kwargs); end
21
+
22
+ class << self
23
+ # pkg:gem/unicode-display_width#lib/unicode/display_width/index.rb:14
24
+ def decompress_index(index, level); end
25
+
26
+ # Returns width of all considered Emoji and remaining string
27
+ #
28
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:143
29
+ def emoji_width(string, mode = T.unsafe(nil), ambiguous = T.unsafe(nil)); end
30
+
31
+ # Match possible Emoji first, then refine
32
+ #
33
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:173
34
+ def emoji_width_via_possible(string, emoji_set_regex, strict_eaw = T.unsafe(nil), ambiguous = T.unsafe(nil)); end
35
+
36
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:201
37
+ def normalize_options(string, ambiguous = T.unsafe(nil), overwrite = T.unsafe(nil), old_options = T.unsafe(nil), **options); end
38
+
39
+ # Returns monospace display width of string
40
+ #
41
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:51
42
+ def of(string, ambiguous = T.unsafe(nil), overwrite = T.unsafe(nil), old_options = T.unsafe(nil), **options); end
43
+
44
+ # Returns width for ASCII-only strings. Will consider zero-width control symbols.
45
+ #
46
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:133
47
+ def width_ascii(string); end
48
+
49
+ # Returns width of custom overwrites and remaining string
50
+ #
51
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:117
52
+ def width_custom(string, overwrite); end
53
+ end
54
+ end
55
+
56
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:16
57
+ Unicode::DisplayWidth::AMBIGUOUS_MAP = T.let(T.unsafe(nil), Hash)
58
+
59
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:15
60
+ Unicode::DisplayWidth::ASCII_BACKSPACE = T.let(T.unsafe(nil), String)
61
+
62
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:13
63
+ Unicode::DisplayWidth::ASCII_NON_ZERO_REGEX = T.let(T.unsafe(nil), Regexp)
64
+
65
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:14
66
+ Unicode::DisplayWidth::ASCII_NON_ZERO_STRING = T.let(T.unsafe(nil), String)
67
+
68
+ # pkg:gem/unicode-display_width#lib/unicode/display_width/constants.rb:7
69
+ Unicode::DisplayWidth::DATA_DIRECTORY = T.let(T.unsafe(nil), String)
70
+
71
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:11
72
+ Unicode::DisplayWidth::DEFAULT_AMBIGUOUS = T.let(T.unsafe(nil), Integer)
73
+
74
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:32
75
+ Unicode::DisplayWidth::EMOJI_SEQUENCES_REGEX_MAPPING = T.let(T.unsafe(nil), Hash)
76
+
77
+ # pkg:gem/unicode-display_width#lib/unicode/display_width/emoji_support.rb:5
78
+ module Unicode::DisplayWidth::EmojiSupport
79
+ class << self
80
+ # pkg:gem/unicode-display_width#lib/unicode/display_width/emoji_support.rb:18
81
+ def _recommended; end
82
+
83
+ # Tries to find out which terminal emulator is used to
84
+ # set emoji: config to best suiting value
85
+ #
86
+ # Please also see section in README.md and
87
+ # misc/terminal-emoji-width.rb
88
+ #
89
+ # Please note: Many terminals do not set any ENV vars,
90
+ # maybe CSI queries can help?
91
+ #
92
+ # pkg:gem/unicode-display_width#lib/unicode/display_width/emoji_support.rb:14
93
+ def recommended; end
94
+ end
95
+ end
96
+
97
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:28
98
+ Unicode::DisplayWidth::FIRST_4096 = T.let(T.unsafe(nil), Hash)
99
+
100
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:20
101
+ Unicode::DisplayWidth::FIRST_AMBIGUOUS = T.let(T.unsafe(nil), Hash)
102
+
103
+ # pkg:gem/unicode-display_width#lib/unicode/display_width/index.rb:11
104
+ Unicode::DisplayWidth::INDEX = T.let(T.unsafe(nil), Hash)
105
+
106
+ # pkg:gem/unicode-display_width#lib/unicode/display_width/constants.rb:8
107
+ Unicode::DisplayWidth::INDEX_FILENAME = T.let(T.unsafe(nil), String)
108
+
109
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:12
110
+ Unicode::DisplayWidth::INITIAL_DEPTH = T.let(T.unsafe(nil), Integer)
111
+
112
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:24
113
+ Unicode::DisplayWidth::NOT_COMMON_NARROW_REGEX = T.let(T.unsafe(nil), Hash)
114
+
115
+ # ebase = Unicode::Emoji::REGEX_PROP_MODIFIER_BASE.source
116
+ #
117
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:47
118
+ Unicode::DisplayWidth::REGEX_EMOJI_ALL_SEQUENCES = T.let(T.unsafe(nil), Regexp)
119
+
120
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:48
121
+ Unicode::DisplayWidth::REGEX_EMOJI_ALL_SEQUENCES_AND_VS16 = T.let(T.unsafe(nil), Regexp)
122
+
123
+ # pkg:gem/unicode-display_width#lib/unicode/display_width.rb:37
124
+ Unicode::DisplayWidth::REGEX_EMOJI_VS16 = T.let(T.unsafe(nil), Regexp)
125
+
126
+ # pkg:gem/unicode-display_width#lib/unicode/display_width/constants.rb:6
127
+ Unicode::DisplayWidth::UNICODE_VERSION = T.let(T.unsafe(nil), String)
128
+
129
+ # pkg:gem/unicode-display_width#lib/unicode/display_width/constants.rb:5
130
+ Unicode::DisplayWidth::VERSION = T.let(T.unsafe(nil), String)