xlsxrb 0.1.4 → 0.1.5

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 (92) hide show
  1. checksums.yaml +4 -4
  2. data/.devcontainer/Dockerfile +1 -1
  3. data/.gem_rbs_collection/ast/2.4/.rbs_meta.yaml +9 -0
  4. data/.gem_rbs_collection/ast/2.4/ast.rbs +73 -0
  5. data/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml +9 -0
  6. data/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs +4 -0
  7. data/.gem_rbs_collection/concurrent-ruby/1.1/atomic_reference.rbs +16 -0
  8. data/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs +96 -0
  9. data/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs +4 -0
  10. data/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs +68 -0
  11. data/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs +249 -0
  12. data/.gem_rbs_collection/concurrent-ruby/1.1/set.rbs +4 -0
  13. data/.gem_rbs_collection/concurrent-ruby/1.1/timer_task.rbs +47 -0
  14. data/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs +5 -0
  15. data/.gem_rbs_collection/csv/3.3/.rbs_meta.yaml +9 -0
  16. data/.gem_rbs_collection/csv/3.3/csv.rbs +3871 -0
  17. data/.gem_rbs_collection/csv/3.3/manifest.yaml +3 -0
  18. data/.gem_rbs_collection/lint_roller/1.1/.rbs_meta.yaml +9 -0
  19. data/.gem_rbs_collection/lint_roller/1.1/lint_roller.rbs +48 -0
  20. data/.gem_rbs_collection/listen/3.9/.rbs_meta.yaml +9 -0
  21. data/.gem_rbs_collection/listen/3.9/listen.rbs +25 -0
  22. data/.gem_rbs_collection/listen/3.9/listener.rbs +24 -0
  23. data/.gem_rbs_collection/logger/1.7/.rbs_meta.yaml +9 -0
  24. data/.gem_rbs_collection/logger/1.7/formatter.rbs +45 -0
  25. data/.gem_rbs_collection/logger/1.7/log_device.rbs +100 -0
  26. data/.gem_rbs_collection/logger/1.7/logger.rbs +796 -0
  27. data/.gem_rbs_collection/logger/1.7/manifest.yaml +2 -0
  28. data/.gem_rbs_collection/logger/1.7/period.rbs +17 -0
  29. data/.gem_rbs_collection/logger/1.7/severity.rbs +34 -0
  30. data/.gem_rbs_collection/parallel/1.20/.rbs_meta.yaml +9 -0
  31. data/.gem_rbs_collection/parallel/1.20/parallel.rbs +86 -0
  32. data/.gem_rbs_collection/parser/3.2/.rbs_meta.yaml +9 -0
  33. data/.gem_rbs_collection/parser/3.2/manifest.yaml +7 -0
  34. data/.gem_rbs_collection/parser/3.2/parser.rbs +194 -0
  35. data/.gem_rbs_collection/parser/3.2/polyfill.rbs +4 -0
  36. data/.gem_rbs_collection/rainbow/3.0/.rbs_meta.yaml +9 -0
  37. data/.gem_rbs_collection/rainbow/3.0/global.rbs +7 -0
  38. data/.gem_rbs_collection/rainbow/3.0/presenter.rbs +209 -0
  39. data/.gem_rbs_collection/rainbow/3.0/rainbow.rbs +5 -0
  40. data/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml +9 -0
  41. data/.gem_rbs_collection/rake/13.0/manifest.yaml +2 -0
  42. data/.gem_rbs_collection/rake/13.0/rake.rbs +39 -0
  43. data/.gem_rbs_collection/regexp_parser/2.8/.rbs_meta.yaml +9 -0
  44. data/.gem_rbs_collection/regexp_parser/2.8/regexp_parser.rbs +17 -0
  45. data/.gem_rbs_collection/rubocop/1.57/.rbs_meta.yaml +9 -0
  46. data/.gem_rbs_collection/rubocop/1.57/rubocop.rbs +208 -0
  47. data/.gem_rbs_collection/rubocop-ast/1.46/.rbs_meta.yaml +9 -0
  48. data/.gem_rbs_collection/rubocop-ast/1.46/rubocop-ast.rbs +903 -0
  49. data/CHANGELOG.md +24 -3
  50. data/README.md +91 -17
  51. data/Rakefile +22 -2
  52. data/Steepfile +19 -0
  53. data/docs/ARCHITECTURE.md +17 -0
  54. data/docs/DEVELOPMENT.md +58 -0
  55. data/docs/QUALITY_ASSURANCE.md +26 -0
  56. data/docs/visual/VisualGallery.md +893 -938
  57. data/docs/wasm/ruby.wasm +0 -0
  58. data/lib/xlsxrb/elements/cell.rb +74 -1
  59. data/lib/xlsxrb/elements/column.rb +2 -0
  60. data/lib/xlsxrb/elements/row.rb +37 -2
  61. data/lib/xlsxrb/elements/types.rb +2 -0
  62. data/lib/xlsxrb/elements/workbook.rb +29 -0
  63. data/lib/xlsxrb/elements/worksheet.rb +98 -1
  64. data/lib/xlsxrb/elements.rb +2 -0
  65. data/lib/xlsxrb/ooxml/reader.rb +8 -6
  66. data/lib/xlsxrb/ooxml/shared_strings_parser.rb +2 -0
  67. data/lib/xlsxrb/ooxml/styles_parser.rb +2 -0
  68. data/lib/xlsxrb/ooxml/utils.rb +2 -0
  69. data/lib/xlsxrb/ooxml/workbook_parser.rb +6 -1
  70. data/lib/xlsxrb/ooxml/workbook_writer.rb +15 -4
  71. data/lib/xlsxrb/ooxml/worksheet_parser.rb +12 -0
  72. data/lib/xlsxrb/ooxml/worksheet_writer.rb +49 -9
  73. data/lib/xlsxrb/ooxml/writer.rb +217 -5
  74. data/lib/xlsxrb/ooxml/xml_builder.rb +2 -0
  75. data/lib/xlsxrb/ooxml/xml_parser.rb +2 -0
  76. data/lib/xlsxrb/ooxml/zip_generator.rb +5 -8
  77. data/lib/xlsxrb/ooxml/zip_reader.rb +88 -52
  78. data/lib/xlsxrb/ooxml/zip_writer.rb +2 -0
  79. data/lib/xlsxrb/ooxml.rb +3 -1
  80. data/lib/xlsxrb/style_builder.rb +156 -36
  81. data/lib/xlsxrb/version.rb +3 -1
  82. data/lib/xlsxrb.rb +1510 -231
  83. data/rbs_collection.lock.yaml +224 -0
  84. data/rbs_collection.yaml +19 -0
  85. data/sig/generated/xlsxrb/elements.rbs +8 -0
  86. data/sig/generated/xlsxrb/ooxml.rbs +23 -0
  87. data/sig/generated/xlsxrb/style_builder.rbs +88 -0
  88. data/sig/generated/xlsxrb/version.rbs +5 -0
  89. metadata +71 -5
  90. data/benchmark.rb +0 -400
  91. data/measure_memory.rb +0 -42
  92. data/sig/xlsxrb.rbs +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87ffb5143d51491cc1a7389a3aa673c40cc02e4e5ee69c554b795754f707c3cd
4
- data.tar.gz: 1581c2a99238745d5e6cf65700cd3defbe8b3a3afadb55e74a44b647294407b2
3
+ metadata.gz: 5dbb3e61f4a1829594ab419865464dbe59f45dbbd9e14abf4593935e74481216
4
+ data.tar.gz: 1f59b35f34789562610f517a7e6af5de7342c25f97b5c10abce2cf3c8dde7f3c
5
5
  SHA512:
6
- metadata.gz: 2d994013d341f16ab98f33a190f58fd401247813a9451254eaa46809610e45a2840dc13d9e66b2b5d8c8edf0af6207eab38c9a3d0a2184fa781ff8a80dc63ed2
7
- data.tar.gz: 9e92cd503f6a64dcdcf804996e85af09e2a11b4ceebb4586a6d0a688af81ec4cf66f7be0c86fced3acc90f76ca60dd26123aa1440b49740b1bc9522399877974
6
+ metadata.gz: cf108ff163af536c030873bbb22683546f2f591aba6c304be957e5a39e39a1e25fb678dc08e7fde846e91f9b775fd7383c647d0b0e35b3203602e5c27ec16db5
7
+ data.tar.gz: 15f68050e2f3a61476e7c30a0b4572adfdae7490f4df396c5e7be6b66ef97f67dac63e2cbbe7c8d6ecd4030e0e9b0e5970fd6a759550f611d97535fef27c499b
@@ -1,4 +1,4 @@
1
- FROM ruby:4.0
1
+ FROM ruby:4.0.5
2
2
 
3
3
  ARG USERNAME=vscode
4
4
  ARG USER_UID=1000
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: ast
3
+ version: '2.4'
4
+ source:
5
+ type: git
6
+ name: ruby/gem_rbs_collection
7
+ revision: 82762423fc5694b82888ea89a972847cf19838c2
8
+ remote: https://github.com/ruby/gem_rbs_collection.git
9
+ repo_dir: gems
@@ -0,0 +1,73 @@
1
+ module AST
2
+ interface _ToAst
3
+ def to_ast: () -> Node
4
+ end
5
+
6
+ interface _ToSym
7
+ def to_sym: () -> Symbol
8
+ end
9
+
10
+ class Node
11
+ public
12
+
13
+ attr_reader children: Array[untyped]
14
+ attr_reader hash: String
15
+ attr_reader type: Symbol
16
+
17
+ alias + concat
18
+
19
+ alias << append
20
+
21
+ def ==: (untyped other) -> bool
22
+
23
+ def append: (untyped element) -> self
24
+
25
+ alias clone dup
26
+
27
+ def concat: (_ToA[untyped] array) -> self
28
+
29
+ def dup: () -> self
30
+
31
+ def eql?: (untyped other) -> bool
32
+
33
+ def inspect: (?Integer indent) -> String
34
+
35
+ alias to_a children
36
+
37
+ def to_ast: () -> self
38
+
39
+ alias to_s to_sexp
40
+
41
+ def to_sexp: (?Integer indent) -> String
42
+
43
+ def to_sexp_array: () -> Array[untyped]
44
+
45
+ def updated: (?_ToSym? `type`, ?_ToA[untyped]? children, ?Hash[Symbol, untyped]? properties) -> self
46
+
47
+ private
48
+
49
+ def initialize: (_ToSym `type`, ?_ToA[untyped]? children, ?Hash[Symbol, untyped] properties) -> void
50
+
51
+ alias original_dup dup
52
+ end
53
+
54
+ class Processor
55
+ include Mixin
56
+
57
+ module Mixin
58
+ public
59
+
60
+ def handler_missing: (Node node) -> Node?
61
+
62
+ def process: (_ToAst? node) -> Node?
63
+
64
+ def process_all: (Array[_ToAst] nodes) -> Array[Node]
65
+ end
66
+ end
67
+
68
+ module Sexp
69
+ public
70
+
71
+ def s: (_ToSym `type`, *untyped children) -> Node
72
+ end
73
+ end
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: concurrent-ruby
3
+ version: '1.1'
4
+ source:
5
+ type: git
6
+ name: ruby/gem_rbs_collection
7
+ revision: 82762423fc5694b82888ea89a972847cf19838c2
8
+ remote: https://github.com/ruby/gem_rbs_collection.git
9
+ repo_dir: gems
@@ -0,0 +1,4 @@
1
+ module Concurrent
2
+ class Array[T] < ::Array[T]
3
+ end
4
+ end
@@ -0,0 +1,16 @@
1
+ module Concurrent
2
+ class AtomicReference[T]
3
+ def initialize: (?T value) -> void
4
+ def get: -> T
5
+ def value: -> T
6
+ def set: (T new_value) -> T
7
+ def value=: (T new_value) -> T
8
+ def get_and_set: (T new_value) -> T
9
+ def swap: (T new_value) -> T
10
+ def compare_and_set: (T old_value, T new_value) -> bool
11
+ def compare_and_swap: (T old_value, T new_value) -> bool
12
+ def update: () { (T) -> T } -> T
13
+ def try_update: () { (T) -> T } -> T?
14
+ def try_update!: () { (T) -> T } -> T
15
+ end
16
+ end
@@ -0,0 +1,96 @@
1
+ module Concurrent
2
+ module ExecutorService
3
+ interface _Task
4
+ def call: () -> void
5
+ end
6
+
7
+ def post: [A] (*A args) { (*A args) -> void } -> bool
8
+
9
+ def <<: (_Task task) -> bool
10
+
11
+ def can_overflow?: () -> bool
12
+
13
+ def serialized?: () -> bool
14
+ end
15
+
16
+ type executor = ExecutorService | :io | :fast | :immediate
17
+
18
+ def self.executor: (executor executor_identifier) -> ExecutorService
19
+
20
+ def self.global_io_executor: () -> ExecutorService
21
+ def self.global_fast_executor: () -> ExecutorService
22
+ def self.global_immediate_executor: () -> ExecutorService
23
+
24
+ def self.new_io_executor: (?::Hash[Symbol, untyped] opts) -> ExecutorService
25
+ def self.new_fast_executor: (?::Hash[Symbol, untyped] opts) -> ExecutorService
26
+
27
+ # A thread pool that reuses a fixed number of threads operating off an unbounded queue.
28
+ class FixedThreadPool
29
+ include ExecutorService
30
+
31
+ attr_reader fallback_policy: Symbol
32
+
33
+ attr_reader name: String?
34
+
35
+ attr_reader max_length: Integer
36
+
37
+ attr_reader min_length: Integer
38
+
39
+ attr_reader idletime: Integer
40
+
41
+ attr_reader max_queue: Integer
42
+
43
+ attr_reader synchronous: bool
44
+
45
+ def initialize: (Integer num_threads, ?::Hash[Symbol, untyped] opts) -> void
46
+
47
+ def largest_length: () -> Integer
48
+
49
+ def scheduled_task_count: () -> Integer
50
+
51
+ def completed_task_count: () -> Integer
52
+
53
+ def length: () -> Integer
54
+
55
+ def queue_length: () -> Integer
56
+
57
+ def remaining_capacity: () -> Integer
58
+
59
+ def prune_pool: () -> void
60
+
61
+ def running?: () -> bool
62
+
63
+ def shuttingdown?: () -> bool
64
+
65
+ def shutdown?: () -> bool
66
+
67
+ def shutdown: () -> bool
68
+
69
+ def kill: () -> bool
70
+
71
+ def wait_for_termination: (?Numeric? timeout) -> bool
72
+
73
+ def auto_terminate?: () -> bool
74
+
75
+ def to_s: () -> String
76
+ end
77
+
78
+ # An executor service which runs all operations on the current thread, blocking as necessary.
79
+ class ImmediateExecutor
80
+ include ExecutorService
81
+
82
+ def initialize: () -> void
83
+
84
+ def running?: () -> bool
85
+
86
+ def shuttingdown?: () -> bool
87
+
88
+ def shutdown?: () -> bool
89
+
90
+ def shutdown: () -> bool
91
+
92
+ def kill: () -> bool
93
+
94
+ def wait_for_termination: (?Numeric? timeout) -> bool
95
+ end
96
+ end
@@ -0,0 +1,4 @@
1
+ module Concurrent
2
+ class Hash[K, V] < ::Hash[K, V]
3
+ end
4
+ end
@@ -0,0 +1,68 @@
1
+ module Concurrent
2
+ class Map[unchecked out K, unchecked out V]
3
+ def initialize: (?Hash[Symbol, untyped] options) ?{ (self, untyped) -> V } -> void
4
+
5
+ def []: (untyped key) -> V?
6
+ def []=: (K key, V value) -> V
7
+
8
+ alias get []
9
+ alias put []=
10
+
11
+ def compute: (K key) { (V? old_value) -> V } -> V
12
+ | (K key) { (V? old_value) -> nil } -> nil
13
+
14
+ def compute_if_absent: (K key) { () -> V } -> V
15
+
16
+ def compute_if_present: (K key) { (V old_value) -> V? } -> V?
17
+
18
+ def fetch: (untyped key) -> V
19
+ | [D] (untyped key, D default_value) -> (V | D)
20
+ | [T, D] (T key) { (T key) -> D } -> (V | D)
21
+
22
+ def fetch_or_store: (untyped key) -> V
23
+ | (K key, V default_value) -> V
24
+ | (K key) { (K key) -> V } -> V
25
+
26
+ def put_if_absent: (K key, V value) -> V?
27
+
28
+ def value?: (untyped value) -> bool
29
+
30
+ def keys: () -> Array[K]
31
+
32
+ def values: () -> Array[V]
33
+
34
+ def each_key: () { (K key) -> void } -> self
35
+
36
+ def each_value: () { (V value) -> void } -> self
37
+
38
+ def each_pair: () { (K key, V value) -> void } -> self
39
+
40
+ alias each each_pair
41
+
42
+ def key: (untyped value) -> K?
43
+
44
+ def empty?: () -> bool
45
+
46
+ def size: () -> Integer
47
+
48
+ def marshal_dump: () -> Hash[K, V]
49
+ def marshal_load: (Hash[K, V] hash) -> self
50
+
51
+ def delete: (K key) -> V?
52
+ def delete_pair: (K key, V value) -> bool
53
+
54
+ # undef :freeze
55
+
56
+ def inspect: () -> String
57
+
58
+ private
59
+
60
+ def raise_fetch_no_key: () -> bot
61
+
62
+ def initialize_copy: (instance other) -> void
63
+
64
+ def populate_from: (Hash[K, V] hash) -> self
65
+
66
+ def validate_options_hash!: (Hash[Symbol, untyped] options) -> void
67
+ end
68
+ end
@@ -0,0 +1,249 @@
1
+ module Concurrent
2
+ module Promises
3
+ module FactoryMethods
4
+ def any_event: (*(Event | Future[top, top]) futures_and_or_events) -> Event
5
+ def any_event_on: (executor default_executor, *(Event | Future[top, top]) futures_and_or_events) -> Event
6
+
7
+ def any_fulfilled_future: (*Event events) -> Future[nil, bot]
8
+ | [T, E] (*Future[T, E] futures) -> Future[T, E]
9
+ | [T, E] (*(Event | Future[T, E]) futures_and_or_events) -> Future[T | nil, E]
10
+ def any_fulfilled_future_on: (executor default_executor, *Event events) -> Future[nil, bot]
11
+ | [T, E] (executor default_executor, *Future[T, E] futures) -> Future[T, E]
12
+ | [T, E] (executor default_executor, *(Event | Future[T, E]) futures_and_or_events) -> Future[T | nil, E]
13
+
14
+ def any_resolved_future: (*Event events) -> Future[nil, bot]
15
+ | [T, E] (*Future[T, E] futures) -> Future[T, E]
16
+ | [T, E] (*(Event | Future[T, E]) futures_and_or_events) -> Future[T | nil, E]
17
+ alias any any_resolved_future
18
+ def any_resolved_future_on: (executor default_executor, *Event events) -> Future[nil, bot]
19
+ | [T, E] (executor default_executor, *Future[T, E] futures) -> Future[T, E]
20
+ | [T, E] (executor default_executor, *(Event | Future[T, E]) futures_and_or_events) -> Future[T | nil, E]
21
+
22
+ def default_executor: () -> executor
23
+
24
+ def delay: () -> Event
25
+ | [A, T] (*A args) { (*A args) -> T } -> Future[T, Exception]
26
+ def delay_on: (executor default_executor) -> Event
27
+ | [A, T] (executor default_executor, *A args) { (*A args) -> T } -> Future[T, Exception]
28
+
29
+ def fulfilled_future: [T] (T value, ?executor default_executor) -> Future[T, bot]
30
+
31
+ def future: [A, T] (*A args) { (*A args) -> T } -> Future[T, Exception]
32
+ def future_on: [A, T] (executor default_executor, *A args) { (*A args) -> T } -> Future[T, Exception]
33
+
34
+ def make_future: (nil, ?executor default_executor) -> Event
35
+ | [X < AbstractEventFuture] (X event_or_future, ?executor default_executor) -> X
36
+ | [E < Exception] (E reason, ?executor default_executor) -> Future[bot, E]
37
+ | [T] (T value, ?executor default_executor) -> Future[T, bot]
38
+
39
+ def rejected_future: [E] (E reason, ?executor default_executor) -> Future[bot, E]
40
+
41
+ def resolvable_event: () -> ResolvableEvent
42
+ def resolvable_event_on: (executor default_executor) -> ResolvableEvent
43
+
44
+ def resolvable_future: () -> ResolvableFuture[untyped, untyped]
45
+ def resolvable_future_on: (executor default_executor) -> ResolvableFuture[untyped, untyped]
46
+
47
+ def resolved_event: (?executor default_executor) -> Event
48
+
49
+ def resolved_future: [T] (true fulfilled, T value, top reason, ?executor default_executor) -> Future[T, bot]
50
+ | [E] (false fulfilled, top value, E reason, ?executor default_executor) -> Future[bot, E]
51
+ | [T, E] (boolish fulfilled, T? value, E? reason, ?executor default_executor) -> Future[T, E]
52
+
53
+ def schedule: (Numeric | Time intended_time) -> Event
54
+ | [A, T] (Numeric | Time intended_time, *A args) { (*A args) -> T } -> Future[T, Exception]
55
+ def schedule_on: (executor default_executor, Numeric | Time intended_time) -> Event
56
+ | [A, T] (executor default_executor, Numeric | Time intended_time, *A args) { (*A args) -> T } -> Future[T, Exception]
57
+
58
+ def zip_events: (*(Event | Future[top, top]) futures_and_or_events) -> Event
59
+ def zip_events_on: (executor default_executor, *(Event | Future[top, top]) futures_and_or_events) -> Event
60
+
61
+ def zip_futures: (*Event events) -> Future[::Array[nil], bot]
62
+ | [T, E] (*Future[T, E] futures) -> Future[::Array[T], ::Array[E]]
63
+ | [T, E] (*(Event | Future[T, E]) futures_and_or_events) -> Future[::Array[T | nil], ::Array[E | nil]]
64
+ alias zip zip_futures
65
+ def zip_futures_on: (executor default_executor, *Event events) -> Future[Array[nil], bot]
66
+ | [T, E] (executor default_executor, *Future[T, E] futures) -> Future[Array[T], Array[E]]
67
+ | [T, E] (executor default_executor, *(Event | Future[T, E]) futures_and_or_events) -> Future[Array[T | nil], Array[E]]
68
+ end
69
+
70
+ extend FactoryMethods
71
+
72
+ class AbstractEventFuture
73
+ def chain: [A, U] (*A args) { (*untyped) -> U } -> Future[U, Exception]
74
+ def chain_on: [A, U] (executor executor, *A args) { (*untyped) -> U } -> Future[U, Exception]
75
+
76
+ def chain_resolvable: (Resolvable resolvable) -> self
77
+ alias tangle chain_resolvable
78
+
79
+ def default_executor: () -> executor
80
+
81
+ def internal_state: () -> Object
82
+
83
+ def on_resolution: [A] (*A args) { (*untyped) -> void } -> self
84
+ def on_resolution!: [A] (*A args) { (*untyped) -> void } -> self
85
+ def on_resolution_using: [A] (executor executor, *A args) { (*untyped) -> void } -> self
86
+
87
+ def resolved?: () -> bool
88
+
89
+ def pending?: () -> bool
90
+
91
+ def state: () -> Symbol
92
+
93
+ def touch: () -> self
94
+
95
+ def wait: (?nil) -> self
96
+ | (Numeric timeout) -> bool
97
+ end
98
+
99
+ class Event < AbstractEventFuture
100
+ def any: (Event | Future[top, top] event_or_future) -> Event
101
+ alias | any
102
+
103
+ def delay: () -> Event
104
+
105
+ def schedule: (Numeric | Time intended_time) -> Event
106
+
107
+ def to_event: () -> self
108
+
109
+ def to_future: () -> Future[nil, bot]
110
+
111
+ def with_default_executor: (executor executor) -> Event
112
+
113
+ def zip: (Event event) -> Event
114
+ | [T, E] (Future[T, E] future) -> Future[T, E]
115
+ alias & zip
116
+
117
+
118
+ ## Following methods are actually defined in the base class and have specific types for Event
119
+
120
+ def chain: [A, U] (*A args) { (*A args) -> U } -> Future[U, Exception]
121
+ def chain_on: [A, U] (executor executor, *A args) { (*A args) -> U } -> Future[U, Exception]
122
+
123
+ def on_resolution: [A] (*A args) { (*A args) -> void } -> self
124
+ def on_resolution!: [A] (*A args) { (*A args) -> void } -> self
125
+ def on_resolution_using: [A] (executor executor, *A args) { (*A args) -> void } -> self
126
+
127
+ def state: () -> (:pending | :resolved)
128
+ end
129
+
130
+ class Future[out T, out E] < AbstractEventFuture
131
+ def any: (Event event) -> Future[T | nil, E]
132
+ | [T2, E2] (Future[T2, E2] future) -> Future[T | T2, E | E2]
133
+ alias | any
134
+
135
+ def delay: () -> Future[T, E]
136
+
137
+ def exception: () -> Exception # TODO: Return type can be narrowed to E when E <: Exception
138
+
139
+ def flat_event: () -> Event
140
+
141
+ def flat_future: (?Integer level) -> untyped # TODO: Valid only if T <: Future[top, top]
142
+ alias flat flat_future
143
+
144
+ def fulfilled?: () -> bool
145
+
146
+ def on_fulfillment: [A] (*A args) { (T value, *A args) -> void } -> self
147
+ def on_fulfillment!: [A] (*A args) { (T value, *A args) -> void } -> self
148
+ def on_fulfillment_using: [A] (executor executor, *A args) { (T value, A args) -> void } -> self
149
+
150
+ def on_rejection: [A] (*A args) { (E reason, *A args) -> void } -> self
151
+ def on_rejection!: [A] (*A args) { (E reason, *A args) -> void } -> self
152
+ def on_rejection_using: [A] (executor executor, *A args) { (E reason, A args) -> void } -> self
153
+
154
+ def reason: (?Numeric timeout) -> (E | nil)
155
+ | [R] (Numeric timeout, R timeout_value) -> (E | R | nil)
156
+
157
+ def rejected?: () -> bool
158
+
159
+ def rescue: [A, U] (*A args) { (E reason, *A args) -> U } -> Future[U, Exception]
160
+ def rescue_on: [A, U] (executor executor, *A args) { (E reason, *A args) -> U } -> Future[U, Exception]
161
+
162
+ def result: (?nil) -> ([true, T, nil] | [false, nil, E])
163
+ | (Numeric timeout) -> ([true, T, nil] | [false, nil, E] | nil)
164
+
165
+ def run: (?^(untyped) -> Future[untyped, untyped]? run_test) -> Future[untyped, untyped] # TODO: Any specific type?
166
+
167
+ def schedule: (Numeric | Time intended_time) -> Future[T, E]
168
+
169
+ def then: [A, U] (*A args) { (T value, *A args) -> U } -> Future[U, E | Exception]
170
+ def then_on: [A, U] (executor executor, *A args) { (T value, *A args) -> U } -> Future[U, E | Exception]
171
+
172
+ def to_event: () -> Event
173
+
174
+ def to_future: () -> self
175
+
176
+ def value: (?Numeric timeout) -> (T | nil)
177
+ | [R] (Numeric timeout, R timeout_value) -> (T | R | nil)
178
+ def value!: (?nil) -> T
179
+ | (Numeric timeout) -> (T | nil)
180
+ | [R] (Numeric timeout, R timeout_value) -> (T | R | nil)
181
+
182
+ def wait!: (?nil) -> self
183
+ | (Numeric timeout) -> bool
184
+
185
+ def with_default_executor: (executor executor) -> Future[T, E]
186
+
187
+ def zip: (Event event) -> Future[T, E]
188
+ | [T2, E2] (Future[T2, E2] future) -> Future[[T, T2], [E, E2]]
189
+ alias & zip
190
+
191
+
192
+ ## Following methods are actually defined in the base class and have specific types for Future
193
+
194
+ def chain: [A, U] (*A args) { (bool fulfilled, T? value, E? reason, *A args) -> U } -> Future[U, Exception]
195
+ def chain_on: [A, U] (executor executor, *A args) { (bool fulfilled, T? value, E? reason, *A args) -> U } -> Future[U, Exception]
196
+
197
+ def on_resolution: [A] (*A args) { (bool fulfilled, T? value, E? reason, *A args) -> void } -> self
198
+ def on_resolution!: [A] (*A args) { (bool fulfilled, T? value, E? reason, *A args) -> void } -> self
199
+ def on_resolution_using: [A] (executor executor, *A args) { (bool fulfilled, T? value, E? reason, *A args) -> void } -> self
200
+
201
+ def state: () -> (:pending | :fulfilled | :rejected)
202
+ end
203
+
204
+ module Resolvable
205
+ end
206
+
207
+ class ResolvableEvent < Event
208
+ include Resolvable
209
+
210
+ def resolve: (?true raise_on_reassign, ?boolish reserved) -> self
211
+ | (boolish raise_on_reassign, ?boolish reserved) -> (self | false)
212
+
213
+ def wait: (Numeric timeout, boolish resolve_on_timeout) -> bool
214
+ | ...
215
+
216
+ def with_hidden_resolvable: () -> Event
217
+ end
218
+
219
+ class ResolvableFuture[T, E] < Future[T, E] # Note: ResolvableFuture is invariant on T and E
220
+ include Resolvable
221
+
222
+ def evalute_to: [A] (*A args) { (*A args) -> T } -> self # TODO: Unsound unless E :> Exception
223
+ def evalute_to!: [A] (*A args) { (*A args) -> T } -> self # TODO: ditto
224
+
225
+ def fulfill: (T value, ?true raise_on_reassign, ?boolish reserved) -> self
226
+ | (T value, boolish raise_on_reassign, ?boolish reserved) -> (self | false)
227
+
228
+ def reason: [R] (Numeric timeout, R timeout_value, [boolish, T?, E?] resolve_on_timeout) -> (E | R | nil)
229
+ | ...
230
+
231
+ def reject: (E reason, ?true raise_on_reassign, ?boolish reserved) -> self
232
+ | (E reason, boolish raise_on_reassign, ?boolish reserved) -> (self | false)
233
+
234
+ def resolve: (?boolish fulfilled, ?T? value, ?E? reason, ?true raise_on_reassign, ?boolish reserved) -> self
235
+ | (boolish fulfilled, T? value, E? reason, boolish raise_on_reassign, ?boolish reserved) -> (self | false)
236
+
237
+ def result: (Numeric timeout, [boolish, T?, E?] resolve_on_timeout) -> ([true, T, nil] | [false, nil, E] | nil)
238
+ | ...
239
+
240
+ def value: [R] (Numeric timeout, R timeout_value, [boolish, T?, E?] resolve_on_timeout) -> (T | R | nil)
241
+ | ...
242
+
243
+ def value!: [R] (Numeric timeout, R timeout_value, [boolish, T?, E?] resolve_on_timeout) -> (T | R | nil)
244
+ | ...
245
+
246
+ def with_hidden_resolvable: () -> Future[T, E]
247
+ end
248
+ end
249
+ end
@@ -0,0 +1,4 @@
1
+ module Concurrent
2
+ class Set[T] < ::Set[T]
3
+ end
4
+ end
@@ -0,0 +1,47 @@
1
+ module Concurrent
2
+ interface _Observer[T]
3
+ def update: (Time, T? result, StandardError? exception) -> void
4
+ end
5
+
6
+ interface _Dereferenceable[T]
7
+ def value: -> T
8
+ def deref: -> T
9
+ end
10
+
11
+ interface _Observable[T]
12
+ def add_observer: (_Observer[T]) -> _Observer[T] # Typed: observer with standard `update` method
13
+ | () { (?Time, ?T?, ?StandardError?) -> void } -> ^(?Time, ?T?, ?StandardError?) -> void # Typed: block form
14
+ | (untyped observer, Symbol func) -> untyped # Untyped: custom method name
15
+ def count_observers: -> Integer
16
+ def delete_observer: (_Observer[T]) -> _Observer[T]
17
+ | (^(?Time, ?T?, ?StandardError?) -> void) -> ^(?Time, ?T?, ?StandardError?) -> void
18
+ | (untyped observer) -> untyped
19
+ def delete_observers: -> self
20
+ def with_observer: (_Observer[T]) -> self
21
+ | () { (?Time, ?T?, ?StandardError?) -> void } -> self
22
+ | (untyped observer, Symbol func) -> self
23
+ end
24
+
25
+ class TimerTask[T]
26
+ include _Observable[T]
27
+ include _Dereferenceable[T]
28
+
29
+ def initialize: (
30
+ ?execution_interval: Float | Integer,
31
+ ?run_now: bool,
32
+ ?executor: executor,
33
+ ?dup_on_deref: bool,
34
+ ?freeze_on_deref: bool,
35
+ ?copy_on_deref: (^(T) -> T)?,
36
+ ?interval_type: :fixed_rate | :fixed_delay
37
+ ) { (instance) -> T } -> void
38
+
39
+ def execute: -> self
40
+ def execution_interval: -> (Float | Integer)
41
+ def execution_interval=: (Float | Integer) -> void
42
+ def shutdown: -> bool
43
+ def interval_type: -> (:fixed_rate | :fixed_delay)
44
+ def timeout_interval: -> Float
45
+ def running?: -> bool
46
+ end
47
+ end
@@ -0,0 +1,5 @@
1
+ module Concurrent
2
+ def self.physical_processor_count: () -> Integer
3
+
4
+ def self.processor_count: () -> Integer
5
+ end
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: csv
3
+ version: '3.3'
4
+ source:
5
+ type: git
6
+ name: ruby/gem_rbs_collection
7
+ revision: 82762423fc5694b82888ea89a972847cf19838c2
8
+ remote: https://github.com/ruby/gem_rbs_collection.git
9
+ repo_dir: gems