@blazetrails/ruby-compat 0.0.0-stage → 0.1.0-alpha0.2
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.
- package/LICENSE +21 -0
- package/NOTICE +6 -0
- package/README.md +440 -2
- package/dist/argument-error.d.ts +15 -0
- package/dist/argument-error.js +15 -0
- package/dist/argument-error.js.map +1 -0
- package/dist/array.d.ts +415 -0
- package/dist/array.js +1330 -0
- package/dist/array.js.map +1 -0
- package/dist/async-context-adapter.d.ts +19 -0
- package/dist/async-context-adapter.js +139 -0
- package/dist/async-context-adapter.js.map +1 -0
- package/dist/backtrace-location.d.ts +78 -0
- package/dist/backtrace-location.js +158 -0
- package/dist/backtrace-location.js.map +1 -0
- package/dist/base64.d.ts +73 -0
- package/dist/base64.js +164 -0
- package/dist/base64.js.map +1 -0
- package/dist/benchmark.d.ts +19 -0
- package/dist/benchmark.js +16 -0
- package/dist/benchmark.js.map +1 -0
- package/dist/big-decimal.d.ts +111 -0
- package/dist/big-decimal.js +584 -0
- package/dist/big-decimal.js.map +1 -0
- package/dist/bundler.d.ts +44 -0
- package/dist/bundler.js +97 -0
- package/dist/bundler.js.map +1 -0
- package/dist/cgi.d.ts +89 -0
- package/dist/cgi.js +168 -0
- package/dist/cgi.js.map +1 -0
- package/dist/child-process-adapter.d.ts +110 -0
- package/dist/child-process-adapter.js +272 -0
- package/dist/child-process-adapter.js.map +1 -0
- package/dist/class-module.d.ts +10 -0
- package/dist/class-module.js +10 -0
- package/dist/class-module.js.map +1 -0
- package/dist/classpath.d.ts +93 -0
- package/dist/classpath.js +210 -0
- package/dist/classpath.js.map +1 -0
- package/dist/closed-queue-error.d.ts +10 -0
- package/dist/closed-queue-error.js +10 -0
- package/dist/closed-queue-error.js.map +1 -0
- package/dist/comparable.d.ts +127 -0
- package/dist/comparable.js +376 -0
- package/dist/comparable.js.map +1 -0
- package/dist/complex.d.ts +49 -0
- package/dist/complex.js +164 -0
- package/dist/complex.js.map +1 -0
- package/dist/concurrent/atomic-boolean.d.ts +24 -0
- package/dist/concurrent/atomic-boolean.js +43 -0
- package/dist/concurrent/atomic-boolean.js.map +1 -0
- package/dist/concurrent/atomic-fixnum.d.ts +21 -0
- package/dist/concurrent/atomic-fixnum.js +35 -0
- package/dist/concurrent/atomic-fixnum.js.map +1 -0
- package/dist/concurrent/count-down-latch.d.ts +20 -0
- package/dist/concurrent/count-down-latch.js +50 -0
- package/dist/concurrent/count-down-latch.js.map +1 -0
- package/dist/concurrent/cyclic-barrier.d.ts +18 -0
- package/dist/concurrent/cyclic-barrier.js +50 -0
- package/dist/concurrent/cyclic-barrier.js.map +1 -0
- package/dist/concurrent/event.d.ts +19 -0
- package/dist/concurrent/event.js +31 -0
- package/dist/concurrent/event.js.map +1 -0
- package/dist/concurrent/map.d.ts +149 -0
- package/dist/concurrent/map.js +202 -0
- package/dist/concurrent/map.js.map +1 -0
- package/dist/concurrent/read-write-lock.d.ts +25 -0
- package/dist/concurrent/read-write-lock.js +70 -0
- package/dist/concurrent/read-write-lock.js.map +1 -0
- package/dist/concurrent/semaphore.d.ts +24 -0
- package/dist/concurrent/semaphore.js +74 -0
- package/dist/concurrent/semaphore.js.map +1 -0
- package/dist/concurrent/timer-task.d.ts +52 -0
- package/dist/concurrent/timer-task.js +112 -0
- package/dist/concurrent/timer-task.js.map +1 -0
- package/dist/constants.generated.d.ts +2 -0
- package/dist/constants.generated.js +64 -0
- package/dist/constants.generated.js.map +1 -0
- package/dist/converter-not-found-error.d.ts +14 -0
- package/dist/converter-not-found-error.js +14 -0
- package/dist/converter-not-found-error.js.map +1 -0
- package/dist/crypto-adapter.d.ts +64 -0
- package/dist/crypto-adapter.js +365 -0
- package/dist/crypto-adapter.js.map +1 -0
- package/dist/delegate.d.ts +156 -0
- package/dist/delegate.js +306 -0
- package/dist/delegate.js.map +1 -0
- package/dist/digest.d.ts +99 -0
- package/dist/digest.js +131 -0
- package/dist/digest.js.map +1 -0
- package/dist/dir.d.ts +225 -0
- package/dist/dir.js +608 -0
- package/dist/dir.js.map +1 -0
- package/dist/encoding-error.d.ts +14 -0
- package/dist/encoding-error.js +17 -0
- package/dist/encoding-error.js.map +1 -0
- package/dist/encoding.d.ts +121 -0
- package/dist/encoding.js +306 -0
- package/dist/encoding.js.map +1 -0
- package/dist/ensure.d.ts +15 -0
- package/dist/ensure.js +35 -0
- package/dist/ensure.js.map +1 -0
- package/dist/enumerable.d.ts +375 -0
- package/dist/enumerable.js +1102 -0
- package/dist/enumerable.js.map +1 -0
- package/dist/enumerator.d.ts +324 -0
- package/dist/enumerator.js +625 -0
- package/dist/enumerator.js.map +1 -0
- package/dist/eof-error.d.ts +14 -0
- package/dist/eof-error.js +14 -0
- package/dist/eof-error.js.map +1 -0
- package/dist/errno.d.ts +447 -0
- package/dist/errno.js +616 -0
- package/dist/errno.js.map +1 -0
- package/dist/exc-detailed-message.d.ts +15 -0
- package/dist/exc-detailed-message.js +106 -0
- package/dist/exc-detailed-message.js.map +1 -0
- package/dist/exc-to-s.d.ts +10 -0
- package/dist/exc-to-s.js +21 -0
- package/dist/exc-to-s.js.map +1 -0
- package/dist/exception.d.ts +44 -0
- package/dist/exception.js +115 -0
- package/dist/exception.js.map +1 -0
- package/dist/fiber-error.d.ts +12 -0
- package/dist/fiber-error.js +12 -0
- package/dist/fiber-error.js.map +1 -0
- package/dist/fiber.d.ts +51 -0
- package/dist/fiber.js +178 -0
- package/dist/fiber.js.map +1 -0
- package/dist/file-utils.d.ts +480 -0
- package/dist/file-utils.js +1824 -0
- package/dist/file-utils.js.map +1 -0
- package/dist/file.d.ts +643 -0
- package/dist/file.js +1334 -0
- package/dist/file.js.map +1 -0
- package/dist/float-domain-error.d.ts +17 -0
- package/dist/float-domain-error.js +17 -0
- package/dist/float-domain-error.js.map +1 -0
- package/dist/fork-children.d.ts +23 -0
- package/dist/fork-children.js +32 -0
- package/dist/fork-children.js.map +1 -0
- package/dist/frozen-error.d.ts +33 -0
- package/dist/frozen-error.js +41 -0
- package/dist/frozen-error.js.map +1 -0
- package/dist/fs-adapter.d.ts +158 -0
- package/dist/fs-adapter.js +253 -0
- package/dist/fs-adapter.js.map +1 -0
- package/dist/gem/deprecate.d.ts +10 -0
- package/dist/gem/deprecate.js +8 -0
- package/dist/gem/deprecate.js.map +1 -0
- package/dist/gem/requirement.d.ts +55 -0
- package/dist/gem/requirement.js +91 -0
- package/dist/gem/requirement.js.map +1 -0
- package/dist/gem/version.d.ts +50 -0
- package/dist/gem/version.js +148 -0
- package/dist/gem/version.js.map +1 -0
- package/dist/gem.d.ts +59 -0
- package/dist/gem.js +82 -0
- package/dist/gem.js.map +1 -0
- package/dist/hash.d.ts +967 -0
- package/dist/hash.js +1572 -0
- package/dist/hash.js.map +1 -0
- package/dist/http-adapter.d.ts +124 -0
- package/dist/http-adapter.js +220 -0
- package/dist/http-adapter.js.map +1 -0
- package/dist/immediate-executor.d.ts +20 -0
- package/dist/immediate-executor.js +39 -0
- package/dist/immediate-executor.js.map +1 -0
- package/dist/include.d.ts +778 -0
- package/dist/include.js +2208 -0
- package/dist/include.js.map +1 -0
- package/dist/index-error.d.ts +13 -0
- package/dist/index-error.js +13 -0
- package/dist/index-error.js.map +1 -0
- package/dist/index.d.ts +174 -0
- package/dist/index.js +166 -0
- package/dist/index.js.map +1 -0
- package/dist/invalid-byte-sequence-error.d.ts +62 -0
- package/dist/invalid-byte-sequence-error.js +75 -0
- package/dist/invalid-byte-sequence-error.js.map +1 -0
- package/dist/io-error.d.ts +14 -0
- package/dist/io-error.js +17 -0
- package/dist/io-error.js.map +1 -0
- package/dist/io.d.ts +867 -0
- package/dist/io.js +1960 -0
- package/dist/io.js.map +1 -0
- package/dist/ipaddr.d.ts +79 -0
- package/dist/ipaddr.js +405 -0
- package/dist/ipaddr.js.map +1 -0
- package/dist/json.d.ts +70 -0
- package/dist/json.js +181 -0
- package/dist/json.js.map +1 -0
- package/dist/kernel-catch.d.ts +59 -0
- package/dist/kernel-catch.js +184 -0
- package/dist/kernel-catch.js.map +1 -0
- package/dist/kernel-float.d.ts +19 -0
- package/dist/kernel-float.js +54 -0
- package/dist/kernel-float.js.map +1 -0
- package/dist/kernel-fork.d.ts +30 -0
- package/dist/kernel-fork.js +72 -0
- package/dist/kernel-fork.js.map +1 -0
- package/dist/kernel-format.d.ts +27 -0
- package/dist/kernel-format.js +901 -0
- package/dist/kernel-format.js.map +1 -0
- package/dist/kernel-hash.d.ts +7 -0
- package/dist/kernel-hash.js +33 -0
- package/dist/kernel-hash.js.map +1 -0
- package/dist/kernel-integer.d.ts +49 -0
- package/dist/kernel-integer.js +170 -0
- package/dist/kernel-integer.js.map +1 -0
- package/dist/kernel-rand.d.ts +16 -0
- package/dist/kernel-rand.js +237 -0
- package/dist/kernel-rand.js.map +1 -0
- package/dist/kernel-system.d.ts +39 -0
- package/dist/kernel-system.js +103 -0
- package/dist/kernel-system.js.map +1 -0
- package/dist/kernel-warn.d.ts +35 -0
- package/dist/kernel-warn.js +73 -0
- package/dist/kernel-warn.js.map +1 -0
- package/dist/key-error.d.ts +44 -0
- package/dist/key-error.js +59 -0
- package/dist/key-error.js.map +1 -0
- package/dist/keyword-splat.d.ts +41 -0
- package/dist/keyword-splat.js +65 -0
- package/dist/keyword-splat.js.map +1 -0
- package/dist/load-error.d.ts +19 -0
- package/dist/load-error.js +19 -0
- package/dist/load-error.js.map +1 -0
- package/dist/load.d.ts +128 -0
- package/dist/load.js +278 -0
- package/dist/load.js.map +1 -0
- package/dist/loaded-features.d.ts +13 -0
- package/dist/loaded-features.js +15 -0
- package/dist/loaded-features.js.map +1 -0
- package/dist/local-jump-error.d.ts +12 -0
- package/dist/local-jump-error.js +12 -0
- package/dist/local-jump-error.js.map +1 -0
- package/dist/logger/formatter.d.ts +21 -0
- package/dist/logger/formatter.js +43 -0
- package/dist/logger/formatter.js.map +1 -0
- package/dist/logger/log-device.d.ts +52 -0
- package/dist/logger/log-device.js +104 -0
- package/dist/logger/log-device.js.map +1 -0
- package/dist/logger/severity.d.ts +23 -0
- package/dist/logger/severity.js +42 -0
- package/dist/logger/severity.js.map +1 -0
- package/dist/logger.d.ts +127 -0
- package/dist/logger.js +218 -0
- package/dist/logger.js.map +1 -0
- package/dist/marshal.d.ts +83 -0
- package/dist/marshal.js +1487 -0
- package/dist/marshal.js.map +1 -0
- package/dist/match-data.d.ts +161 -0
- package/dist/match-data.js +284 -0
- package/dist/match-data.js.map +1 -0
- package/dist/method-cache.d.ts +81 -0
- package/dist/method-cache.js +109 -0
- package/dist/method-cache.js.map +1 -0
- package/dist/method-missing-proxy.d.ts +53 -0
- package/dist/method-missing-proxy.js +154 -0
- package/dist/method-missing-proxy.js.map +1 -0
- package/dist/method.d.ts +132 -0
- package/dist/method.js +320 -0
- package/dist/method.js.map +1 -0
- package/dist/monitor.d.ts +114 -0
- package/dist/monitor.js +270 -0
- package/dist/monitor.js.map +1 -0
- package/dist/mutex.d.ts +51 -0
- package/dist/mutex.js +150 -0
- package/dist/mutex.js.map +1 -0
- package/dist/name-error.d.ts +45 -0
- package/dist/name-error.js +54 -0
- package/dist/name-error.js.map +1 -0
- package/dist/net/http/exceptions.d.ts +31 -0
- package/dist/net/http/exceptions.js +46 -0
- package/dist/net/http/exceptions.js.map +1 -0
- package/dist/net/http/request.d.ts +137 -0
- package/dist/net/http/request.js +559 -0
- package/dist/net/http/request.js.map +1 -0
- package/dist/net/http/requests.d.ts +197 -0
- package/dist/net/http/requests.js +197 -0
- package/dist/net/http/requests.js.map +1 -0
- package/dist/net/http/response.d.ts +141 -0
- package/dist/net/http/response.js +416 -0
- package/dist/net/http/response.js.map +1 -0
- package/dist/net/http/responses.d.ts +345 -0
- package/dist/net/http/responses.js +486 -0
- package/dist/net/http/responses.js.map +1 -0
- package/dist/net/http.d.ts +278 -0
- package/dist/net/http.js +760 -0
- package/dist/net/http.js.map +1 -0
- package/dist/net/protocol.d.ts +227 -0
- package/dist/net/protocol.js +392 -0
- package/dist/net/protocol.js.map +1 -0
- package/dist/nil-class.d.ts +10 -0
- package/dist/nil-class.js +27 -0
- package/dist/nil-class.js.map +1 -0
- package/dist/no-method-error.d.ts +38 -0
- package/dist/no-method-error.js +45 -0
- package/dist/no-method-error.js.map +1 -0
- package/dist/not-implemented-error.d.ts +13 -0
- package/dist/not-implemented-error.js +13 -0
- package/dist/not-implemented-error.js.map +1 -0
- package/dist/numeric-class.d.ts +29 -0
- package/dist/numeric-class.js +41 -0
- package/dist/numeric-class.js.map +1 -0
- package/dist/numeric.d.ts +226 -0
- package/dist/numeric.js +848 -0
- package/dist/numeric.js.map +1 -0
- package/dist/object-space.d.ts +34 -0
- package/dist/object-space.js +152 -0
- package/dist/object-space.js.map +1 -0
- package/dist/object.d.ts +833 -0
- package/dist/object.js +2131 -0
- package/dist/object.js.map +1 -0
- package/dist/open-uri.d.ts +180 -0
- package/dist/open-uri.js +402 -0
- package/dist/open-uri.js.map +1 -0
- package/dist/open3.d.ts +69 -0
- package/dist/open3.js +134 -0
- package/dist/open3.js.map +1 -0
- package/dist/openssl.d.ts +479 -0
- package/dist/openssl.js +1052 -0
- package/dist/openssl.js.map +1 -0
- package/dist/optparse.d.ts +130 -0
- package/dist/optparse.js +457 -0
- package/dist/optparse.js.map +1 -0
- package/dist/os-adapter.d.ts +20 -0
- package/dist/os-adapter.js +95 -0
- package/dist/os-adapter.js.map +1 -0
- package/dist/pathname.d.ts +73 -0
- package/dist/pathname.js +412 -0
- package/dist/pathname.js.map +1 -0
- package/dist/pp.d.ts +60 -0
- package/dist/pp.js +195 -0
- package/dist/pp.js.map +1 -0
- package/dist/pretty-print.d.ts +89 -0
- package/dist/pretty-print.js +232 -0
- package/dist/pretty-print.js.map +1 -0
- package/dist/process-adapter.d.ts +229 -0
- package/dist/process-adapter.js +889 -0
- package/dist/process-adapter.js.map +1 -0
- package/dist/process.d.ts +202 -0
- package/dist/process.js +433 -0
- package/dist/process.js.map +1 -0
- package/dist/psych/class-loader.d.ts +92 -0
- package/dist/psych/class-loader.js +139 -0
- package/dist/psych/class-loader.js.map +1 -0
- package/dist/psych/coder.d.ts +144 -0
- package/dist/psych/coder.js +176 -0
- package/dist/psych/coder.js.map +1 -0
- package/dist/psych/core-ext.d.ts +8 -0
- package/dist/psych/core-ext.js +10 -0
- package/dist/psych/core-ext.js.map +1 -0
- package/dist/psych/emitter.d.ts +116 -0
- package/dist/psych/emitter.js +1130 -0
- package/dist/psych/emitter.js.map +1 -0
- package/dist/psych/exception.d.ts +43 -0
- package/dist/psych/exception.js +54 -0
- package/dist/psych/exception.js.map +1 -0
- package/dist/psych/handler.d.ts +59 -0
- package/dist/psych/handler.js +95 -0
- package/dist/psych/handler.js.map +1 -0
- package/dist/psych/handlers/document-stream.d.ts +17 -0
- package/dist/psych/handlers/document-stream.js +26 -0
- package/dist/psych/handlers/document-stream.js.map +1 -0
- package/dist/psych/nodes/alias.d.ts +15 -0
- package/dist/psych/nodes/alias.js +22 -0
- package/dist/psych/nodes/alias.js.map +1 -0
- package/dist/psych/nodes/document.d.ts +23 -0
- package/dist/psych/nodes/document.js +35 -0
- package/dist/psych/nodes/document.js.map +1 -0
- package/dist/psych/nodes/mapping.d.ts +25 -0
- package/dist/psych/nodes/mapping.js +35 -0
- package/dist/psych/nodes/mapping.js.map +1 -0
- package/dist/psych/nodes/node.d.ts +59 -0
- package/dist/psych/nodes/node.js +79 -0
- package/dist/psych/nodes/node.js.map +1 -0
- package/dist/psych/nodes/scalar.d.ts +35 -0
- package/dist/psych/nodes/scalar.js +47 -0
- package/dist/psych/nodes/scalar.js.map +1 -0
- package/dist/psych/nodes/sequence.d.ts +25 -0
- package/dist/psych/nodes/sequence.js +35 -0
- package/dist/psych/nodes/sequence.js.map +1 -0
- package/dist/psych/nodes/stream.d.ts +23 -0
- package/dist/psych/nodes/stream.js +31 -0
- package/dist/psych/nodes/stream.js.map +1 -0
- package/dist/psych/omap.d.ts +9 -0
- package/dist/psych/omap.js +9 -0
- package/dist/psych/omap.js.map +1 -0
- package/dist/psych/parser.d.ts +41 -0
- package/dist/psych/parser.js +139 -0
- package/dist/psych/parser.js.map +1 -0
- package/dist/psych/scalar-scanner.d.ts +31 -0
- package/dist/psych/scalar-scanner.js +169 -0
- package/dist/psych/scalar-scanner.js.map +1 -0
- package/dist/psych/syntax-error.d.ts +23 -0
- package/dist/psych/syntax-error.js +35 -0
- package/dist/psych/syntax-error.js.map +1 -0
- package/dist/psych/tree-builder.d.ts +51 -0
- package/dist/psych/tree-builder.js +118 -0
- package/dist/psych/tree-builder.js.map +1 -0
- package/dist/psych/visitors/depth-first.d.ts +27 -0
- package/dist/psych/visitors/depth-first.js +37 -0
- package/dist/psych/visitors/depth-first.js.map +1 -0
- package/dist/psych/visitors/emitter.d.ts +32 -0
- package/dist/psych/visitors/emitter.js +63 -0
- package/dist/psych/visitors/emitter.js.map +1 -0
- package/dist/psych/visitors/to-ruby.d.ts +110 -0
- package/dist/psych/visitors/to-ruby.js +396 -0
- package/dist/psych/visitors/to-ruby.js.map +1 -0
- package/dist/psych/visitors/visitor.d.ts +11 -0
- package/dist/psych/visitors/visitor.js +17 -0
- package/dist/psych/visitors/visitor.js.map +1 -0
- package/dist/psych/visitors/yaml-tree.d.ts +182 -0
- package/dist/psych/visitors/yaml-tree.js +593 -0
- package/dist/psych/visitors/yaml-tree.js.map +1 -0
- package/dist/psych-adapter.d.ts +65 -0
- package/dist/psych-adapter.js +121 -0
- package/dist/psych-adapter.js.map +1 -0
- package/dist/psych-yaml.d.ts +2 -0
- package/dist/psych-yaml.js +5 -0
- package/dist/psych-yaml.js.map +1 -0
- package/dist/psych.d.ts +257 -0
- package/dist/psych.js +332 -0
- package/dist/psych.js.map +1 -0
- package/dist/queue.d.ts +137 -0
- package/dist/queue.js +236 -0
- package/dist/queue.js.map +1 -0
- package/dist/racc/parser.d.ts +70 -0
- package/dist/racc/parser.js +206 -0
- package/dist/racc/parser.js.map +1 -0
- package/dist/range-error.d.ts +15 -0
- package/dist/range-error.js +15 -0
- package/dist/range-error.js.map +1 -0
- package/dist/range.d.ts +166 -0
- package/dist/range.js +421 -0
- package/dist/range.js.map +1 -0
- package/dist/rational.d.ts +168 -0
- package/dist/rational.js +587 -0
- package/dist/rational.js.map +1 -0
- package/dist/rb-config.d.ts +33 -0
- package/dist/rb-config.js +53 -0
- package/dist/rb-config.js.map +1 -0
- package/dist/rb-equal.d.ts +66 -0
- package/dist/rb-equal.js +262 -0
- package/dist/rb-equal.js.map +1 -0
- package/dist/rb-hash.d.ts +26 -0
- package/dist/rb-hash.js +108 -0
- package/dist/rb-hash.js.map +1 -0
- package/dist/regexp.d.ts +82 -0
- package/dist/regexp.js +191 -0
- package/dist/regexp.js.map +1 -0
- package/dist/repl-adapter.d.ts +270 -0
- package/dist/repl-adapter.js +562 -0
- package/dist/repl-adapter.js.map +1 -0
- package/dist/resolv.d.ts +30 -0
- package/dist/resolv.js +48 -0
- package/dist/resolv.js.map +1 -0
- package/dist/ruby-empty.d.ts +28 -0
- package/dist/ruby-empty.js +40 -0
- package/dist/ruby-empty.js.map +1 -0
- package/dist/ruby-platform.d.ts +39 -0
- package/dist/ruby-platform.js +49 -0
- package/dist/ruby-platform.js.map +1 -0
- package/dist/runtime-error.d.ts +15 -0
- package/dist/runtime-error.js +15 -0
- package/dist/runtime-error.js.map +1 -0
- package/dist/scheduled-task.d.ts +73 -0
- package/dist/scheduled-task.js +150 -0
- package/dist/scheduled-task.js.map +1 -0
- package/dist/secure-random.d.ts +50 -0
- package/dist/secure-random.js +141 -0
- package/dist/secure-random.js.map +1 -0
- package/dist/set.d.ts +158 -0
- package/dist/set.js +352 -0
- package/dist/set.js.map +1 -0
- package/dist/shellwords.d.ts +27 -0
- package/dist/shellwords.js +53 -0
- package/dist/shellwords.js.map +1 -0
- package/dist/signal-exception.d.ts +43 -0
- package/dist/signal-exception.js +88 -0
- package/dist/signal-exception.js.map +1 -0
- package/dist/socket.d.ts +230 -0
- package/dist/socket.js +484 -0
- package/dist/socket.js.map +1 -0
- package/dist/standard-error.d.ts +27 -0
- package/dist/standard-error.js +49 -0
- package/dist/standard-error.js.map +1 -0
- package/dist/stop-iteration.d.ts +10 -0
- package/dist/stop-iteration.js +10 -0
- package/dist/stop-iteration.js.map +1 -0
- package/dist/string/b.d.ts +19 -0
- package/dist/string/b.js +28 -0
- package/dist/string/b.js.map +1 -0
- package/dist/string/byte-methods.d.ts +57 -0
- package/dist/string/byte-methods.js +266 -0
- package/dist/string/byte-methods.js.map +1 -0
- package/dist/string/bytes.d.ts +35 -0
- package/dist/string/bytes.js +123 -0
- package/dist/string/bytes.js.map +1 -0
- package/dist/string/case-mapping.d.ts +57 -0
- package/dist/string/case-mapping.js +192 -0
- package/dist/string/case-mapping.js.map +1 -0
- package/dist/string/chomp.d.ts +15 -0
- package/dist/string/chomp.js +32 -0
- package/dist/string/chomp.js.map +1 -0
- package/dist/string/convert.d.ts +55 -0
- package/dist/string/convert.js +316 -0
- package/dist/string/convert.js.map +1 -0
- package/dist/string/delete.d.ts +14 -0
- package/dist/string/delete.js +17 -0
- package/dist/string/delete.js.map +1 -0
- package/dist/string/each.d.ts +108 -0
- package/dist/string/each.js +305 -0
- package/dist/string/each.js.map +1 -0
- package/dist/string/encode.d.ts +37 -0
- package/dist/string/encode.js +268 -0
- package/dist/string/encode.js.map +1 -0
- package/dist/string/force-encoding.d.ts +72 -0
- package/dist/string/force-encoding.js +147 -0
- package/dist/string/force-encoding.js.map +1 -0
- package/dist/string/inspect.d.ts +17 -0
- package/dist/string/inspect.js +81 -0
- package/dist/string/inspect.js.map +1 -0
- package/dist/string/method-table.d.ts +174 -0
- package/dist/string/method-table.js +805 -0
- package/dist/string/method-table.js.map +1 -0
- package/dist/string/scrub.d.ts +12 -0
- package/dist/string/scrub.js +33 -0
- package/dist/string/scrub.js.map +1 -0
- package/dist/string/slice.d.ts +26 -0
- package/dist/string/slice.js +73 -0
- package/dist/string/slice.js.map +1 -0
- package/dist/string/split.d.ts +11 -0
- package/dist/string/split.js +44 -0
- package/dist/string/split.js.map +1 -0
- package/dist/string/sub.d.ts +114 -0
- package/dist/string/sub.js +371 -0
- package/dist/string/sub.js.map +1 -0
- package/dist/string/succ.d.ts +14 -0
- package/dist/string/succ.js +118 -0
- package/dist/string/succ.js.map +1 -0
- package/dist/string/support.d.ts +142 -0
- package/dist/string/support.js +296 -0
- package/dist/string/support.js.map +1 -0
- package/dist/string/tr.d.ts +46 -0
- package/dist/string/tr.js +156 -0
- package/dist/string/tr.js.map +1 -0
- package/dist/string-io.d.ts +166 -0
- package/dist/string-io.js +248 -0
- package/dist/string-io.js.map +1 -0
- package/dist/string-scanner.d.ts +133 -0
- package/dist/string-scanner.js +248 -0
- package/dist/string-scanner.js.map +1 -0
- package/dist/struct.d.ts +54 -0
- package/dist/struct.js +222 -0
- package/dist/struct.js.map +1 -0
- package/dist/symbol.d.ts +48 -0
- package/dist/symbol.js +107 -0
- package/dist/symbol.js.map +1 -0
- package/dist/tempfile.d.ts +173 -0
- package/dist/tempfile.js +295 -0
- package/dist/tempfile.js.map +1 -0
- package/dist/temporal-tag.d.ts +23 -0
- package/dist/temporal-tag.js +29 -0
- package/dist/temporal-tag.js.map +1 -0
- package/dist/thread-error.d.ts +13 -0
- package/dist/thread-error.js +13 -0
- package/dist/thread-error.js.map +1 -0
- package/dist/thread-pool-executor.d.ts +121 -0
- package/dist/thread-pool-executor.js +254 -0
- package/dist/thread-pool-executor.js.map +1 -0
- package/dist/thread.d.ts +211 -0
- package/dist/thread.js +495 -0
- package/dist/thread.js.map +1 -0
- package/dist/timeout.d.ts +29 -0
- package/dist/timeout.js +41 -0
- package/dist/timeout.js.map +1 -0
- package/dist/tse.d.ts +40 -0
- package/dist/tse.js +66 -0
- package/dist/tse.js.map +1 -0
- package/dist/type-error.d.ts +14 -0
- package/dist/type-error.js +14 -0
- package/dist/type-error.js.map +1 -0
- package/dist/undefined-conversion-error.d.ts +10 -0
- package/dist/undefined-conversion-error.js +10 -0
- package/dist/undefined-conversion-error.js.map +1 -0
- package/dist/uri/common.d.ts +209 -0
- package/dist/uri/common.js +369 -0
- package/dist/uri/common.js.map +1 -0
- package/dist/uri/generic.d.ts +280 -0
- package/dist/uri/generic.js +806 -0
- package/dist/uri/generic.js.map +1 -0
- package/dist/uri/http.d.ts +23 -0
- package/dist/uri/http.js +30 -0
- package/dist/uri/http.js.map +1 -0
- package/dist/uri/https.d.ts +13 -0
- package/dist/uri/https.js +15 -0
- package/dist/uri/https.js.map +1 -0
- package/dist/uri/rfc2396-parser.d.ts +70 -0
- package/dist/uri/rfc2396-parser.js +264 -0
- package/dist/uri/rfc2396-parser.js.map +1 -0
- package/dist/uri/rfc3986-parser.d.ts +46 -0
- package/dist/uri/rfc3986-parser.js +171 -0
- package/dist/uri/rfc3986-parser.js.map +1 -0
- package/dist/uri.d.ts +13 -0
- package/dist/uri.js +13 -0
- package/dist/uri.js.map +1 -0
- package/dist/variable.d.ts +183 -0
- package/dist/variable.js +463 -0
- package/dist/variable.js.map +1 -0
- package/dist/verbose.d.ts +39 -0
- package/dist/verbose.js +49 -0
- package/dist/verbose.js.map +1 -0
- package/dist/yaml.d.ts +9 -0
- package/dist/yaml.js +9 -0
- package/dist/yaml.js.map +1 -0
- package/dist/zlib-adapter.d.ts +119 -0
- package/dist/zlib-adapter.js +230 -0
- package/dist/zlib-adapter.js.map +1 -0
- package/dist/zlib.d.ts +299 -0
- package/dist/zlib.js +679 -0
- package/dist/zlib.js.map +1 -0
- package/package.json +172 -3
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { Encoding } from "./encoding.js";
|
|
2
|
+
import { print as ioPrint, puts as ioPuts } from "./io.js";
|
|
3
|
+
/**
|
|
4
|
+
* Ruby's `StringIO` (stdlib), the readable/writable in-memory IO that
|
|
5
|
+
* `XmlMini._parse_file` (`activesupport/lib/active_support/xml_mini.rb:180-186`)
|
|
6
|
+
* and `Rack::MockRequest` hand to their callers. Only the members Ruby code in
|
|
7
|
+
* this repo sends are ported.
|
|
8
|
+
*
|
|
9
|
+
* The buffer holds bytes, so `size`, `read`'s length and `write`'s return
|
|
10
|
+
* value count bytes exactly as Ruby's do. A StringIO opened on an ASCII-8BIT
|
|
11
|
+
* String, a `Uint8Array`, answers its whole-buffer reads as one, and every
|
|
12
|
+
* other answers them as the UTF-8 text the bytes spell; `read`'s length arm
|
|
13
|
+
* answers a `Uint8Array` whatever the buffer, as `strio_read`
|
|
14
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1539`) tags it ASCII-8BIT.
|
|
15
|
+
*
|
|
16
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `StringIO`
|
|
17
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1432`) ships with the interpreter, so
|
|
18
|
+
* no Rails file defines it and no port can remove the need for it while
|
|
19
|
+
* `_parse_file` and `Rack::MockRequest` hand callers an IO.
|
|
20
|
+
*/
|
|
21
|
+
export declare class StringIO<S extends string | Uint8Array = string> {
|
|
22
|
+
#private;
|
|
23
|
+
constructor(string?: S);
|
|
24
|
+
/**
|
|
25
|
+
* `strio_copy` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:620`), bound to
|
|
26
|
+
* `initialize_copy` (`:1869`): the copy shares the original's struct, so
|
|
27
|
+
* both read and write one buffer and one position.
|
|
28
|
+
*
|
|
29
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `StringIO#initialize_copy`.
|
|
30
|
+
*/
|
|
31
|
+
initializeCopy(orig: StringIO<S>): this;
|
|
32
|
+
string(): S;
|
|
33
|
+
size(): number;
|
|
34
|
+
/**
|
|
35
|
+
* `strio_read` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1539`). The `str` buffer
|
|
36
|
+
* of its two-argument form (`stringio.c:1548-1552`) receives the bytes, and
|
|
37
|
+
* at EOF Ruby empties it with `rb_str_resize(str, 0)` (`stringio.c:1561`)
|
|
38
|
+
* before answering `nil`.
|
|
39
|
+
*
|
|
40
|
+
* A `Uint8Array` cannot be resized, so — exactly as {@link IO.read} already
|
|
41
|
+
* does for `io_read`'s identical `str` argument (`vendor/ruby/v3.3.11/io.c:3800`) —
|
|
42
|
+
* it is filled up to its own length instead, and zero-filled where Ruby
|
|
43
|
+
* truncates. That deviation is recorded once there; this is the same fact
|
|
44
|
+
* about the same buffer.
|
|
45
|
+
*/
|
|
46
|
+
read(): S;
|
|
47
|
+
read(length: number, str?: Uint8Array | null): Uint8Array | null;
|
|
48
|
+
write(string: string | Uint8Array): number;
|
|
49
|
+
/**
|
|
50
|
+
* `IO::generic_writable#<<` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1955`
|
|
51
|
+
* `strio_addstr`, which is `rb_io_addstr`, `vendor/ruby/v3.3.11/io.c:2323-2327`).
|
|
52
|
+
*
|
|
53
|
+
* @noRailsEquivalent PERMANENT
|
|
54
|
+
*/
|
|
55
|
+
append(str: string | Uint8Array): this;
|
|
56
|
+
/**
|
|
57
|
+
* `IO::generic_writable#puts` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1530`
|
|
58
|
+
* aliases it to `rb_io_puts`, `vendor/ruby/v3.3.11/io.c:8947`), which is how
|
|
59
|
+
* `Rack::Session::Abstract::Persisted#commit_session` writes to
|
|
60
|
+
* `rack.errors`. One body, shared with `IO#puts` — see `./io.js`.
|
|
61
|
+
*
|
|
62
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
|
|
63
|
+
* `IO::generic_writable#puts` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1530`).
|
|
64
|
+
*/
|
|
65
|
+
puts: typeof ioPuts;
|
|
66
|
+
/**
|
|
67
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
|
|
68
|
+
* `IO::generic_writable#print` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1956`
|
|
69
|
+
* aliases it to `rb_io_print`, `vendor/ruby/v3.3.11/io.c:8715`).
|
|
70
|
+
*/
|
|
71
|
+
print: typeof ioPrint;
|
|
72
|
+
/**
|
|
73
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `strio_flush`
|
|
74
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1891`) returns the StringIO itself,
|
|
75
|
+
* which is how `Rack::ShowExceptions#call` flushes `rack.errors`.
|
|
76
|
+
*/
|
|
77
|
+
flush(): this;
|
|
78
|
+
/**
|
|
79
|
+
* `strio_get_pos` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:940`), the offset
|
|
80
|
+
* {@link rewind} puts back to zero.
|
|
81
|
+
*
|
|
82
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib `StringIO#pos`
|
|
83
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:940`).
|
|
84
|
+
*/
|
|
85
|
+
get pos(): number;
|
|
86
|
+
rewind(): number;
|
|
87
|
+
/**
|
|
88
|
+
* `strio_binmode` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1863`) — it records
|
|
89
|
+
* ASCII-8BIT on the stream and, when the StringIO is writable, associates it
|
|
90
|
+
* with the buffer String, then answers the StringIO, whose whole-buffer reads
|
|
91
|
+
* then answer a `Uint8Array` (see the class comment).
|
|
92
|
+
*
|
|
93
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib `StringIO#binmode`
|
|
94
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1879`).
|
|
95
|
+
*/
|
|
96
|
+
binmode(): this;
|
|
97
|
+
/**
|
|
98
|
+
* `strio_set_encoding` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1801`) in its
|
|
99
|
+
* one-argument form — the encoding is recorded on the stream and, when the
|
|
100
|
+
* StringIO is writable, associated with the buffer String
|
|
101
|
+
* (`stringio.c:1823-1826`); it answers the StringIO. `int_enc` and `opt` are
|
|
102
|
+
* ignored by MRI itself (`stringio.c:1796-1797`), so neither is ported.
|
|
103
|
+
*
|
|
104
|
+
* Associated with `BINARY`, the buffer's whole-buffer reads answer a
|
|
105
|
+
* `Uint8Array` (see the class comment), and the recorded encoding is what
|
|
106
|
+
* `Rack::Test::Utils.build_file_part`'s `set_encoding(Encoding::BINARY)`
|
|
107
|
+
* (`vendor/rack-test/v2.2.0/lib/rack/test/utils.rb:148`) is asking for.
|
|
108
|
+
*
|
|
109
|
+
* `rb_find_encoding` (`vendor/ruby/v3.3.11/encoding.c:325-332`) answers a NULL
|
|
110
|
+
* `rb_encoding *` for a name that resolves to `UNSPECIFIED_ENCODING` — the
|
|
111
|
+
* `internal` alias while `Encoding.default_internal` is unset — and
|
|
112
|
+
* `strio_set_encoding` then falls through the mode-string path to no
|
|
113
|
+
* encoding at all, which the stream reports as `ASCII-8BIT` (verified
|
|
114
|
+
* against ruby 3.3: `StringIO.new("x").set_encoding("internal")
|
|
115
|
+
* .external_encoding` is `#<Encoding:ASCII-8BIT>`).
|
|
116
|
+
*
|
|
117
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib `StringIO#set_encoding`
|
|
118
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1801`).
|
|
119
|
+
*/
|
|
120
|
+
setEncoding(extEnc: Encoding | string): this;
|
|
121
|
+
/**
|
|
122
|
+
* `strio_sysread` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1664`), which
|
|
123
|
+
* `StringIO#readpartial` is defined as (`stringio.c:1949`): `read` with a
|
|
124
|
+
* `rb_eof_error()` (`vendor/ruby/v3.3.11/io.c:756`) where that answers `nil` — the
|
|
125
|
+
* member
|
|
126
|
+
* `Rack::Test::UploadedFile#append_to`
|
|
127
|
+
* (`vendor/rack-test/v2.2.0/lib/rack/test/uploaded_file.rb:64`) walks a StringIO
|
|
128
|
+
* body with.
|
|
129
|
+
*
|
|
130
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib `StringIO#readpartial`
|
|
131
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1949`).
|
|
132
|
+
*/
|
|
133
|
+
readpartial(maxlen: number, outbuf?: Uint8Array | null): Uint8Array;
|
|
134
|
+
/**
|
|
135
|
+
* `strio_gets` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1322`) with no
|
|
136
|
+
* separator argument: the next line, newline included, or `nil` at EOF.
|
|
137
|
+
*
|
|
138
|
+
* @noRailsEquivalent PERMANENT
|
|
139
|
+
*/
|
|
140
|
+
gets(): S | null;
|
|
141
|
+
/**
|
|
142
|
+
* `strio_each` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1366`) with no
|
|
143
|
+
* separator argument: yields each remaining line and leaves the stream at EOF.
|
|
144
|
+
*
|
|
145
|
+
* @noRailsEquivalent PERMANENT
|
|
146
|
+
*/
|
|
147
|
+
each(block: (line: S) => void): this;
|
|
148
|
+
isEof(): boolean;
|
|
149
|
+
close(): void;
|
|
150
|
+
/**
|
|
151
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib `StringIO#close_read`
|
|
152
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:520`).
|
|
153
|
+
*/
|
|
154
|
+
closeRead(): null;
|
|
155
|
+
/**
|
|
156
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib `StringIO#close_write`
|
|
157
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:541`).
|
|
158
|
+
*/
|
|
159
|
+
closeWrite(): null;
|
|
160
|
+
/**
|
|
161
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib `StringIO#closed?`
|
|
162
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:559`).
|
|
163
|
+
*/
|
|
164
|
+
isClosed(): boolean;
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=string-io.d.ts.map
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { Encoding } from "./encoding.js";
|
|
2
|
+
import { EOFError } from "./eof-error.js";
|
|
3
|
+
import { IOError } from "./io-error.js";
|
|
4
|
+
import { print as ioPrint, puts as ioPuts } from "./io.js";
|
|
5
|
+
import { b } from "./string/b.js";
|
|
6
|
+
import { strNew } from "./string/bytes.js";
|
|
7
|
+
import { rbDefineAllocFunc } from "./include.js";
|
|
8
|
+
/**
|
|
9
|
+
* Ruby's `StringIO` (stdlib), the readable/writable in-memory IO that
|
|
10
|
+
* `XmlMini._parse_file` (`activesupport/lib/active_support/xml_mini.rb:180-186`)
|
|
11
|
+
* and `Rack::MockRequest` hand to their callers. Only the members Ruby code in
|
|
12
|
+
* this repo sends are ported.
|
|
13
|
+
*
|
|
14
|
+
* The buffer holds bytes, so `size`, `read`'s length and `write`'s return
|
|
15
|
+
* value count bytes exactly as Ruby's do. A StringIO opened on an ASCII-8BIT
|
|
16
|
+
* String, a `Uint8Array`, answers its whole-buffer reads as one, and every
|
|
17
|
+
* other answers them as the UTF-8 text the bytes spell; `read`'s length arm
|
|
18
|
+
* answers a `Uint8Array` whatever the buffer, as `strio_read`
|
|
19
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1539`) tags it ASCII-8BIT.
|
|
20
|
+
*
|
|
21
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `StringIO`
|
|
22
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1432`) ships with the interpreter, so
|
|
23
|
+
* no Rails file defines it and no port can remove the need for it while
|
|
24
|
+
* `_parse_file` and `Rack::MockRequest` hand callers an IO.
|
|
25
|
+
*/
|
|
26
|
+
export class StringIO {
|
|
27
|
+
/** `DATA_PTR`, the `struct StringIO` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:36-43`). */
|
|
28
|
+
#ptr;
|
|
29
|
+
#_readable = true;
|
|
30
|
+
#_writable = true;
|
|
31
|
+
constructor(string = "") {
|
|
32
|
+
this.#ptr = {
|
|
33
|
+
string: new Uint8Array(0),
|
|
34
|
+
binary: string instanceof Uint8Array,
|
|
35
|
+
pos: 0,
|
|
36
|
+
enc: null,
|
|
37
|
+
};
|
|
38
|
+
this.write(string);
|
|
39
|
+
this.#ptr.pos = 0;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* `strio_copy` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:620`), bound to
|
|
43
|
+
* `initialize_copy` (`:1869`): the copy shares the original's struct, so
|
|
44
|
+
* both read and write one buffer and one position.
|
|
45
|
+
*
|
|
46
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `StringIO#initialize_copy`.
|
|
47
|
+
*/
|
|
48
|
+
initializeCopy(orig) {
|
|
49
|
+
if (this === orig)
|
|
50
|
+
return this;
|
|
51
|
+
this.#ptr = orig.#ptr;
|
|
52
|
+
this.#_readable = orig.#_readable;
|
|
53
|
+
this.#_writable = orig.#_writable;
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
string() {
|
|
57
|
+
const bytes = this.#ptr.string.slice();
|
|
58
|
+
return (this.#ptr.binary ? bytes : strNew(Array.from(bytes)));
|
|
59
|
+
}
|
|
60
|
+
size() {
|
|
61
|
+
return this.#ptr.string.length;
|
|
62
|
+
}
|
|
63
|
+
read(length, str) {
|
|
64
|
+
if (length == null) {
|
|
65
|
+
const rest = this.#ptr.string.slice(this.#ptr.pos);
|
|
66
|
+
this.#ptr.pos = this.#ptr.string.length;
|
|
67
|
+
return (this.#ptr.binary ? rest : strNew(rest));
|
|
68
|
+
}
|
|
69
|
+
if (this.isEof()) {
|
|
70
|
+
if (str)
|
|
71
|
+
str.fill(0);
|
|
72
|
+
return length === 0 ? new Uint8Array(0) : null;
|
|
73
|
+
}
|
|
74
|
+
const chunk = this.#ptr.string.slice(this.#ptr.pos, this.#ptr.pos + length);
|
|
75
|
+
this.#ptr.pos += chunk.length;
|
|
76
|
+
if (str)
|
|
77
|
+
str.set(chunk.subarray(0, str.length));
|
|
78
|
+
return chunk;
|
|
79
|
+
}
|
|
80
|
+
write(string) {
|
|
81
|
+
const bytes = typeof string === "string" ? b(string) : string;
|
|
82
|
+
const end = this.#ptr.pos + bytes.length;
|
|
83
|
+
if (end > this.#ptr.string.length) {
|
|
84
|
+
const grown = new Uint8Array(end);
|
|
85
|
+
grown.set(this.#ptr.string);
|
|
86
|
+
this.#ptr.string = grown;
|
|
87
|
+
}
|
|
88
|
+
this.#ptr.string.set(bytes, this.#ptr.pos);
|
|
89
|
+
this.#ptr.pos = end;
|
|
90
|
+
return bytes.length;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* `IO::generic_writable#<<` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1955`
|
|
94
|
+
* `strio_addstr`, which is `rb_io_addstr`, `vendor/ruby/v3.3.11/io.c:2323-2327`).
|
|
95
|
+
*
|
|
96
|
+
* @noRailsEquivalent PERMANENT
|
|
97
|
+
*/
|
|
98
|
+
append(str) {
|
|
99
|
+
this.write(str);
|
|
100
|
+
return this;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `strio_flush`
|
|
104
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1891`) returns the StringIO itself,
|
|
105
|
+
* which is how `Rack::ShowExceptions#call` flushes `rack.errors`.
|
|
106
|
+
*/
|
|
107
|
+
flush() {
|
|
108
|
+
return this;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* `strio_get_pos` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:940`), the offset
|
|
112
|
+
* {@link rewind} puts back to zero.
|
|
113
|
+
*
|
|
114
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib `StringIO#pos`
|
|
115
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:940`).
|
|
116
|
+
*/
|
|
117
|
+
get pos() {
|
|
118
|
+
return this.#ptr.pos;
|
|
119
|
+
}
|
|
120
|
+
rewind() {
|
|
121
|
+
this.#ptr.pos = 0;
|
|
122
|
+
return 0;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* `strio_binmode` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1863`) — it records
|
|
126
|
+
* ASCII-8BIT on the stream and, when the StringIO is writable, associates it
|
|
127
|
+
* with the buffer String, then answers the StringIO, whose whole-buffer reads
|
|
128
|
+
* then answer a `Uint8Array` (see the class comment).
|
|
129
|
+
*
|
|
130
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib `StringIO#binmode`
|
|
131
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1879`).
|
|
132
|
+
*/
|
|
133
|
+
binmode() {
|
|
134
|
+
this.#ptr.enc = Encoding.ASCII_8BIT;
|
|
135
|
+
this.#ptr.binary = true;
|
|
136
|
+
return this;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* `strio_set_encoding` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1801`) in its
|
|
140
|
+
* one-argument form — the encoding is recorded on the stream and, when the
|
|
141
|
+
* StringIO is writable, associated with the buffer String
|
|
142
|
+
* (`stringio.c:1823-1826`); it answers the StringIO. `int_enc` and `opt` are
|
|
143
|
+
* ignored by MRI itself (`stringio.c:1796-1797`), so neither is ported.
|
|
144
|
+
*
|
|
145
|
+
* Associated with `BINARY`, the buffer's whole-buffer reads answer a
|
|
146
|
+
* `Uint8Array` (see the class comment), and the recorded encoding is what
|
|
147
|
+
* `Rack::Test::Utils.build_file_part`'s `set_encoding(Encoding::BINARY)`
|
|
148
|
+
* (`vendor/rack-test/v2.2.0/lib/rack/test/utils.rb:148`) is asking for.
|
|
149
|
+
*
|
|
150
|
+
* `rb_find_encoding` (`vendor/ruby/v3.3.11/encoding.c:325-332`) answers a NULL
|
|
151
|
+
* `rb_encoding *` for a name that resolves to `UNSPECIFIED_ENCODING` — the
|
|
152
|
+
* `internal` alias while `Encoding.default_internal` is unset — and
|
|
153
|
+
* `strio_set_encoding` then falls through the mode-string path to no
|
|
154
|
+
* encoding at all, which the stream reports as `ASCII-8BIT` (verified
|
|
155
|
+
* against ruby 3.3: `StringIO.new("x").set_encoding("internal")
|
|
156
|
+
* .external_encoding` is `#<Encoding:ASCII-8BIT>`).
|
|
157
|
+
*
|
|
158
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib `StringIO#set_encoding`
|
|
159
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1801`).
|
|
160
|
+
*/
|
|
161
|
+
setEncoding(extEnc) {
|
|
162
|
+
this.#ptr.enc = Encoding.find(extEnc) ?? Encoding.BINARY;
|
|
163
|
+
this.#ptr.binary = this.#ptr.enc === Encoding.BINARY;
|
|
164
|
+
return this;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* `strio_sysread` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1664`), which
|
|
168
|
+
* `StringIO#readpartial` is defined as (`stringio.c:1949`): `read` with a
|
|
169
|
+
* `rb_eof_error()` (`vendor/ruby/v3.3.11/io.c:756`) where that answers `nil` — the
|
|
170
|
+
* member
|
|
171
|
+
* `Rack::Test::UploadedFile#append_to`
|
|
172
|
+
* (`vendor/rack-test/v2.2.0/lib/rack/test/uploaded_file.rb:64`) walks a StringIO
|
|
173
|
+
* body with.
|
|
174
|
+
*
|
|
175
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib `StringIO#readpartial`
|
|
176
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1949`).
|
|
177
|
+
*/
|
|
178
|
+
readpartial(maxlen, outbuf) {
|
|
179
|
+
const ret = this.read(maxlen, outbuf);
|
|
180
|
+
if (ret === null)
|
|
181
|
+
throw new EOFError("end of file reached");
|
|
182
|
+
return ret;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* `strio_gets` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1322`) with no
|
|
186
|
+
* separator argument: the next line, newline included, or `nil` at EOF.
|
|
187
|
+
*
|
|
188
|
+
* @noRailsEquivalent PERMANENT
|
|
189
|
+
*/
|
|
190
|
+
gets() {
|
|
191
|
+
if (this.isEof())
|
|
192
|
+
return null;
|
|
193
|
+
const newline = this.#ptr.string.indexOf(0x0a, this.#ptr.pos);
|
|
194
|
+
const end = newline === -1 ? this.#ptr.string.length : newline + 1;
|
|
195
|
+
const bytes = this.#ptr.string.slice(this.#ptr.pos, end);
|
|
196
|
+
this.#ptr.pos = end;
|
|
197
|
+
return (this.#ptr.binary ? bytes : strNew(Array.from(bytes)));
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* `strio_each` (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:1366`) with no
|
|
201
|
+
* separator argument: yields each remaining line and leaves the stream at EOF.
|
|
202
|
+
*
|
|
203
|
+
* @noRailsEquivalent PERMANENT
|
|
204
|
+
*/
|
|
205
|
+
each(block) {
|
|
206
|
+
while (!this.isEof())
|
|
207
|
+
block(this.gets());
|
|
208
|
+
return this;
|
|
209
|
+
}
|
|
210
|
+
isEof() {
|
|
211
|
+
return this.#ptr.pos >= this.#ptr.string.length;
|
|
212
|
+
}
|
|
213
|
+
close() {
|
|
214
|
+
this.#_readable = false;
|
|
215
|
+
this.#_writable = false;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib `StringIO#close_read`
|
|
219
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:520`).
|
|
220
|
+
*/
|
|
221
|
+
closeRead() {
|
|
222
|
+
if (!this.#_readable)
|
|
223
|
+
throw new IOError("closing non-duplex IO for reading");
|
|
224
|
+
this.#_readable = false;
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib `StringIO#close_write`
|
|
229
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:541`).
|
|
230
|
+
*/
|
|
231
|
+
closeWrite() {
|
|
232
|
+
if (!this.#_writable)
|
|
233
|
+
throw new IOError("closing non-duplex IO for writing");
|
|
234
|
+
this.#_writable = false;
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib `StringIO#closed?`
|
|
239
|
+
* (`vendor/ruby/v3.3.11/ext/stringio/stringio.c:559`).
|
|
240
|
+
*/
|
|
241
|
+
isClosed() {
|
|
242
|
+
return !this.#_readable && !this.#_writable;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
rbDefineAllocFunc(StringIO, (klass) => new klass());
|
|
246
|
+
StringIO.prototype.puts = ioPuts;
|
|
247
|
+
StringIO.prototype.print = ioPrint;
|
|
248
|
+
//# sourceMappingURL=string-io.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-io.js","sourceRoot":"","sources":["../lib/string-io.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,QAAQ;IACnB,+FAA+F;IAC/F,IAAI,CAA6E;IACjF,UAAU,GAAG,IAAI,CAAC;IAClB,UAAU,GAAG,IAAI,CAAC;IAElB,YAAY,MAAM,GAAM,EAAO;QAC7B,IAAI,CAAC,IAAI,GAAG;YACV,MAAM,EAAE,IAAI,UAAU,CAAC,CAAC,CAAC;YACzB,MAAM,EAAE,MAAM,YAAY,UAAU;YACpC,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,IAAI;SACV,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACnB,IAA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AAI,CAAC,UAAU;YAAE,MAAM,IAAI,OAAO,CAAC,mCAAmC,CAAC,CAAC;QAC7E,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,QAAQ;QACN,OAAO,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;IAC9C,CAAC;CACF;AAED,iBAAiB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;AAEpD,QAAQ,CAAC,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC;AACjC,QAAQ,CAAC,SAAS,CAAC,KAAK,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:1667` `rb_define_class("StringScanner", rb_cObject)`.
|
|
3
|
+
*
|
|
4
|
+
* @noRailsEquivalent PERMANENT
|
|
5
|
+
*/
|
|
6
|
+
export declare class StringScanner {
|
|
7
|
+
#private;
|
|
8
|
+
/**
|
|
9
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:233` `strscan_initialize`.
|
|
10
|
+
*
|
|
11
|
+
* @noRailsEquivalent PERMANENT
|
|
12
|
+
*/
|
|
13
|
+
constructor(str: string);
|
|
14
|
+
/**
|
|
15
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:357` `strscan_get_string`.
|
|
16
|
+
*
|
|
17
|
+
* @noRailsEquivalent PERMANENT
|
|
18
|
+
*/
|
|
19
|
+
get string(): string;
|
|
20
|
+
/**
|
|
21
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:372` `strscan_set_string`, which
|
|
22
|
+
* also resets the scan pointer and clears the match.
|
|
23
|
+
*
|
|
24
|
+
* @noRailsEquivalent PERMANENT
|
|
25
|
+
*/
|
|
26
|
+
set string(str: string);
|
|
27
|
+
/**
|
|
28
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:314` `strscan_reset`.
|
|
29
|
+
*
|
|
30
|
+
* @noRailsEquivalent PERMANENT
|
|
31
|
+
*/
|
|
32
|
+
reset(): this;
|
|
33
|
+
/**
|
|
34
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:423` `strscan_get_pos`.
|
|
35
|
+
*
|
|
36
|
+
* @noRailsEquivalent PERMANENT
|
|
37
|
+
*/
|
|
38
|
+
get pos(): number;
|
|
39
|
+
/**
|
|
40
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:681` `strscan_scan`. The match
|
|
41
|
+
* runs over the rest of the string (`strscan_do_scan`, `:605`), so `^` and
|
|
42
|
+
* `\A` anchor at the scan pointer.
|
|
43
|
+
*
|
|
44
|
+
* @noRailsEquivalent PERMANENT
|
|
45
|
+
*/
|
|
46
|
+
scan(pattern: RegExp): string | null;
|
|
47
|
+
/**
|
|
48
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:884` `strscan_getch`.
|
|
49
|
+
*
|
|
50
|
+
* @noRailsEquivalent PERMANENT
|
|
51
|
+
*/
|
|
52
|
+
getch(): string | null;
|
|
53
|
+
/**
|
|
54
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:1000` `strscan_unscan`.
|
|
55
|
+
*
|
|
56
|
+
* @noRailsEquivalent PERMANENT
|
|
57
|
+
*/
|
|
58
|
+
unscan(): this;
|
|
59
|
+
/**
|
|
60
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:778` `strscan_scan_until`: the
|
|
61
|
+
* match is searched for over the rest of the string (`strscan_do_scan`,
|
|
62
|
+
* `:605`, with `headonly` false), and the answer runs from the old scan
|
|
63
|
+
* pointer to the end of the match.
|
|
64
|
+
*
|
|
65
|
+
* @noRailsEquivalent PERMANENT
|
|
66
|
+
*/
|
|
67
|
+
scanUntil(pattern: RegExp): string | null;
|
|
68
|
+
/**
|
|
69
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:797` `strscan_exist_p`: a
|
|
70
|
+
* search over the rest of the string (`strscan_do_scan` with `succptr` and
|
|
71
|
+
* `getstr` false) that records the match but leaves the scan pointer, and
|
|
72
|
+
* answers the distance from it to the end of the match.
|
|
73
|
+
*
|
|
74
|
+
* @noRailsEquivalent PERMANENT
|
|
75
|
+
*/
|
|
76
|
+
isExist(pattern: RegExp): number | null;
|
|
77
|
+
/**
|
|
78
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:1132` `strscan_matched_size`.
|
|
79
|
+
*
|
|
80
|
+
* @noRailsEquivalent PERMANENT
|
|
81
|
+
*/
|
|
82
|
+
matchedSize(): number | null;
|
|
83
|
+
/**
|
|
84
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:1186` `strscan_aref`, `StringScanner#[]`
|
|
85
|
+
* by group number.
|
|
86
|
+
*
|
|
87
|
+
* @noRailsEquivalent PERMANENT
|
|
88
|
+
*/
|
|
89
|
+
get(idx: number): string | null;
|
|
90
|
+
/**
|
|
91
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:723` `strscan_skip`.
|
|
92
|
+
*
|
|
93
|
+
* @noRailsEquivalent PERMANENT
|
|
94
|
+
*/
|
|
95
|
+
skip(pattern: RegExp): number | null;
|
|
96
|
+
/**
|
|
97
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:962` `strscan_peek`.
|
|
98
|
+
*
|
|
99
|
+
* @noRailsEquivalent PERMANENT
|
|
100
|
+
*/
|
|
101
|
+
peek(len: number): string;
|
|
102
|
+
/**
|
|
103
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:1046` `strscan_eos_p`.
|
|
104
|
+
*
|
|
105
|
+
* @noRailsEquivalent PERMANENT
|
|
106
|
+
*/
|
|
107
|
+
isEos(): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:332` `strscan_terminate`.
|
|
110
|
+
*
|
|
111
|
+
* @noRailsEquivalent PERMANENT
|
|
112
|
+
*/
|
|
113
|
+
terminate(): this;
|
|
114
|
+
/**
|
|
115
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:1109` `strscan_matched`.
|
|
116
|
+
*
|
|
117
|
+
* @noRailsEquivalent PERMANENT
|
|
118
|
+
*/
|
|
119
|
+
matched(): string | null;
|
|
120
|
+
/**
|
|
121
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:1320` `strscan_pre_match`.
|
|
122
|
+
*
|
|
123
|
+
* @noRailsEquivalent PERMANENT
|
|
124
|
+
*/
|
|
125
|
+
preMatch(): string | null;
|
|
126
|
+
/**
|
|
127
|
+
* `vendor/ruby/v3.3.11/ext/strscan/strscan.c:1357` `strscan_rest`.
|
|
128
|
+
*
|
|
129
|
+
* @noRailsEquivalent PERMANENT
|
|
130
|
+
*/
|
|
131
|
+
rest(): string;
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=string-scanner.d.ts.map
|