@blazetrails/ruby-compat 0.0.0-stage → 0.1.0-alpha0.1
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 +77 -0
- package/dist/backtrace-location.js +155 -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 +110 -0
- package/dist/big-decimal.js +582 -0
- package/dist/big-decimal.js.map +1 -0
- package/dist/bundler.d.ts +44 -0
- package/dist/bundler.js +101 -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 +90 -0
- package/dist/classpath.js +207 -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 +48 -0
- package/dist/complex.js +162 -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 +218 -0
- package/dist/dir.js +599 -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 +1100 -0
- package/dist/enumerable.js.map +1 -0
- package/dist/enumerator.d.ts +321 -0
- package/dist/enumerator.js +642 -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 +327 -0
- package/dist/errno.js +452 -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 +34 -0
- package/dist/exception.js +99 -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 +1823 -0
- package/dist/file-utils.js.map +1 -0
- package/dist/file.d.ts +635 -0
- package/dist/file.js +1312 -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 +42 -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 +64 -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 +123 -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 +2195 -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 +67 -0
- package/dist/json.js +185 -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 +40 -0
- package/dist/kernel-system.js +97 -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 +121 -0
- package/dist/load.js +263 -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 +215 -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 +17 -0
- package/dist/method-cache.js +19 -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 +14 -0
- package/dist/not-implemented-error.js.map +1 -0
- package/dist/numeric.d.ts +211 -0
- package/dist/numeric.js +802 -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 +908 -0
- package/dist/object.js +2238 -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 +71 -0
- package/dist/pathname.js +394 -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 +224 -0
- package/dist/process-adapter.js +878 -0
- package/dist/process-adapter.js.map +1 -0
- package/dist/process.d.ts +192 -0
- package/dist/process.js +403 -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 +35 -0
- package/dist/psych/scalar-scanner.js +173 -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 +129 -0
- package/dist/queue.js +215 -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 +167 -0
- package/dist/rational.js +379 -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 +261 -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 +188 -0
- package/dist/repl-adapter.js +388 -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 +16 -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 +33 -0
- package/dist/secure-random.js +78 -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 +21 -0
- package/dist/signal-exception.js +21 -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 +18 -0
- package/dist/standard-error.js +23 -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 +135 -0
- package/dist/string/support.js +283 -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 +290 -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 +119 -0
- package/dist/thread-pool-executor.js +250 -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 +62 -0
- package/dist/tse.js.map +1 -0
- package/dist/type-error.d.ts +14 -0
- package/dist/type-error.js +15 -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 +283 -0
- package/dist/uri/generic.js +810 -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 +21 -0
- package/dist/verbose.js +26 -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 +117 -0
- package/dist/zlib-adapter.js +250 -0
- package/dist/zlib-adapter.js.map +1 -0
- package/dist/zlib.d.ts +248 -0
- package/dist/zlib.js +362 -0
- package/dist/zlib.js.map +1 -0
- package/package.json +82 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type IO } from "./io.js";
|
|
2
|
+
/**
|
|
3
|
+
* `Kernel#system` (`vendor/ruby/v3.3.11/process.c:4841` `rb_f_system`), in its
|
|
4
|
+
* `system([env, ] command_line)` and `system([env, ] cmd, *args [, out:, err:])`
|
|
5
|
+
* forms: `true` when the command exits with `EXIT_SUCCESS`, `false` when it
|
|
6
|
+
* exits with anything else, and `nil` when it could not be executed.
|
|
7
|
+
*
|
|
8
|
+
* A command line always runs through `/bin/sh -c` (`proc_exec_sh`,
|
|
9
|
+
* `process.c:1788`), a waited child that reports a spawn error answers `nil`
|
|
10
|
+
* (`data->error != 0`, `process.c:4867-4875`), and the call is awaited where MRI blocks in
|
|
11
|
+
* `rb_process_status_wait`. A host with no way to spawn raises
|
|
12
|
+
* `rb_notimplement`'s `NotImplementedError` (`vendor/ruby/v3.3.11/error.c:3498`).
|
|
13
|
+
*
|
|
14
|
+
* `exception: true` raises each of those answers (`process.c:4868-4896`). Node
|
|
15
|
+
* reports no core-dump flag, so the failure message has no `(core dumped)`.
|
|
16
|
+
* A host whose process adapter has no `signo` spawns no child, so it never
|
|
17
|
+
* reaches the signal arm.
|
|
18
|
+
*
|
|
19
|
+
* @inventedArm throw — CONVERGEABLE rb-syserr-fail-str-raises-errno-for-every-spawn-code
|
|
20
|
+
* @noRailsEquivalent PERMANENT — Ruby core `Kernel#system`
|
|
21
|
+
* (`vendor/ruby/v3.3.11/process.c:4841`).
|
|
22
|
+
*/
|
|
23
|
+
export declare function rbFSystem(...argv: (string | Record<string, string | null> | {
|
|
24
|
+
out?: string | IO;
|
|
25
|
+
err?: string | IO;
|
|
26
|
+
exception?: boolean;
|
|
27
|
+
})[]): Promise<boolean | null>;
|
|
28
|
+
/**
|
|
29
|
+
* ``Kernel#` `` (`vendor/ruby/v3.3.11/io.c:10585` `rb_f_backquote`): the
|
|
30
|
+
* command's standard output, with `$?` set, awaited where MRI blocks. A command
|
|
31
|
+
* line with no shell metacharacter is exec'd directly (`rb_exec_fillarg`,
|
|
32
|
+
* `vendor/ruby/v3.3.11/process.c:2640-2672`), so a missing command raises `Errno::ENOENT`;
|
|
33
|
+
* any other runs through `/bin/sh -c`. Only stdout is piped; the child inherits
|
|
34
|
+
* fd 2 (`pipe_open`, `vendor/ruby/v3.3.11/io.c:7513`), so its stderr reaches
|
|
35
|
+
* the current `$stderr`.
|
|
36
|
+
*
|
|
37
|
+
* @noRailsEquivalent PERMANENT
|
|
38
|
+
*/
|
|
39
|
+
export declare function rbFBackquote(str: string): Promise<string>;
|
|
40
|
+
//# sourceMappingURL=kernel-system.d.ts.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { getChildProcess } from "./child-process-adapter.js";
|
|
2
|
+
import { Errno, SystemCallError } from "./errno.js";
|
|
3
|
+
import { STDERR } from "./io.js";
|
|
4
|
+
import { NotImplementedError } from "./not-implemented-error.js";
|
|
5
|
+
import { getProcessAdapter } from "./process-adapter.js";
|
|
6
|
+
import { Process, rbExecargNew, rbLastStatusSet } from "./process.js";
|
|
7
|
+
import { RuntimeError } from "./runtime-error.js";
|
|
8
|
+
/**
|
|
9
|
+
* `Kernel#system` (`vendor/ruby/v3.3.11/process.c:4841` `rb_f_system`), in its
|
|
10
|
+
* `system([env, ] command_line)` and `system([env, ] cmd, *args [, out:, err:])`
|
|
11
|
+
* forms: `true` when the command exits with `EXIT_SUCCESS`, `false` when it
|
|
12
|
+
* exits with anything else, and `nil` when it could not be executed.
|
|
13
|
+
*
|
|
14
|
+
* A command line always runs through `/bin/sh -c` (`proc_exec_sh`,
|
|
15
|
+
* `process.c:1788`), a waited child that reports a spawn error answers `nil`
|
|
16
|
+
* (`data->error != 0`, `process.c:4867-4875`), and the call is awaited where MRI blocks in
|
|
17
|
+
* `rb_process_status_wait`. A host with no way to spawn raises
|
|
18
|
+
* `rb_notimplement`'s `NotImplementedError` (`vendor/ruby/v3.3.11/error.c:3498`).
|
|
19
|
+
*
|
|
20
|
+
* `exception: true` raises each of those answers (`process.c:4868-4896`). Node
|
|
21
|
+
* reports no core-dump flag, so the failure message has no `(core dumped)`.
|
|
22
|
+
* A host whose process adapter has no `signo` spawns no child, so it never
|
|
23
|
+
* reaches the signal arm.
|
|
24
|
+
*
|
|
25
|
+
* @inventedArm throw — CONVERGEABLE rb-syserr-fail-str-raises-errno-for-every-spawn-code
|
|
26
|
+
* @noRailsEquivalent PERMANENT — Ruby core `Kernel#system`
|
|
27
|
+
* (`vendor/ruby/v3.3.11/process.c:4841`).
|
|
28
|
+
*/
|
|
29
|
+
export async function rbFSystem(...argv) {
|
|
30
|
+
const [prog, env, args, opthash] = rbExecargNew(argv, true);
|
|
31
|
+
const adapter = getChildProcess();
|
|
32
|
+
if (adapter.system === undefined) {
|
|
33
|
+
throw new NotImplementedError("system() function is unimplemented on this machine");
|
|
34
|
+
}
|
|
35
|
+
const data = await adapter.system(prog, env, args, opthash);
|
|
36
|
+
rbLastStatusSet(new Process.Status(data));
|
|
37
|
+
if (data.pid != null && data.pid > 0) {
|
|
38
|
+
if (data.status === 0) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
if (data.error !== undefined) {
|
|
42
|
+
if (opthash.exception) {
|
|
43
|
+
const klass = Errno[data.error?.code];
|
|
44
|
+
throw klass !== undefined
|
|
45
|
+
? new klass(prog)
|
|
46
|
+
: (data.error ?? new SystemCallError(`unknown error - ${prog}`));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else if (opthash.exception) {
|
|
53
|
+
const message = data.signal != null
|
|
54
|
+
? `${data.signal} (signal ${getProcessAdapter().signo(data.signal)})`
|
|
55
|
+
: `exit ${data.status}`;
|
|
56
|
+
throw new RuntimeError(`Command failed with ${message}: ${prog}`);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (opthash.exception) {
|
|
63
|
+
const klass = Errno[data.error?.code];
|
|
64
|
+
throw klass !== undefined
|
|
65
|
+
? new klass(prog)
|
|
66
|
+
: (data.error ?? new SystemCallError(`unknown error - ${prog}`));
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* ``Kernel#` `` (`vendor/ruby/v3.3.11/io.c:10585` `rb_f_backquote`): the
|
|
74
|
+
* command's standard output, with `$?` set, awaited where MRI blocks. A command
|
|
75
|
+
* line with no shell metacharacter is exec'd directly (`rb_exec_fillarg`,
|
|
76
|
+
* `vendor/ruby/v3.3.11/process.c:2640-2672`), so a missing command raises `Errno::ENOENT`;
|
|
77
|
+
* any other runs through `/bin/sh -c`. Only stdout is piped; the child inherits
|
|
78
|
+
* fd 2 (`pipe_open`, `vendor/ruby/v3.3.11/io.c:7513`), so its stderr reaches
|
|
79
|
+
* the current `$stderr`.
|
|
80
|
+
*
|
|
81
|
+
* @noRailsEquivalent PERMANENT
|
|
82
|
+
*/
|
|
83
|
+
export async function rbFBackquote(str) {
|
|
84
|
+
const adapter = getChildProcess();
|
|
85
|
+
if (adapter.capture3 === undefined) {
|
|
86
|
+
throw new NotImplementedError("spawn() function is unimplemented on this machine");
|
|
87
|
+
}
|
|
88
|
+
const [prog, env, args] = rbExecargNew([str]);
|
|
89
|
+
const [stdout, stderr, data] = await adapter.capture3(prog, env, args, "");
|
|
90
|
+
if (data.error !== undefined)
|
|
91
|
+
throw data.error;
|
|
92
|
+
if (stderr !== "")
|
|
93
|
+
STDERR.write(stderr);
|
|
94
|
+
rbLastStatusSet(new Process.Status(data));
|
|
95
|
+
return stdout;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=kernel-system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kernel-system.js","sourceRoot":"","sources":["../lib/kernel-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,MAAM,EAAW,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,G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AAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACxC,eAAe,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAE1C,OAAO,MAAgB,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Kernel#warn` (`vendor/ruby/v3.3.11/warning.rb:50-52`, `error.c:555` `rb_warn_m`), which
|
|
3
|
+
* writes nothing at all while `$VERBOSE` is `nil` (`error.c:561`, `!NIL_P(ruby_verbose)`) —
|
|
4
|
+
* `false` still warns, so the guard is against `nil` alone — and terminates each
|
|
5
|
+
* message with a newline where it lacks one (`error.c:573`).
|
|
6
|
+
*
|
|
7
|
+
* `category:` names a warning category (`error.c:168` `rb_warning_category_from_name`) and a
|
|
8
|
+
* disabled one writes nothing (`error.c:157,198`); `:deprecated` and `:performance` start disabled.
|
|
9
|
+
*
|
|
10
|
+
* `uplevel:` prefixes the output with `path:line: warning: ` for the frame that many levels above
|
|
11
|
+
* the caller (`error.c:563-586`), or with a bare `warning: ` where there is no such frame, and
|
|
12
|
+
* raises `ArgumentError` for a negative level (`error.c:565-567`).
|
|
13
|
+
*
|
|
14
|
+
* @noRailsEquivalent PERMANENT — Ruby core `Kernel#warn`, which Rails calls without
|
|
15
|
+
* defining.
|
|
16
|
+
*/
|
|
17
|
+
export declare function warn(...msgs: (string | {
|
|
18
|
+
uplevel?: number | null;
|
|
19
|
+
category?: string | null;
|
|
20
|
+
})[]): void;
|
|
21
|
+
/**
|
|
22
|
+
* `Warning.[]` (`vendor/ruby/v3.3.11/error.c:226-230` `rb_warning_s_aref`): whether
|
|
23
|
+
* `category` is enabled.
|
|
24
|
+
*
|
|
25
|
+
* @noRailsEquivalent PERMANENT
|
|
26
|
+
*/
|
|
27
|
+
export declare function rbWarningSAref(category: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* `Warning.[]=` (`vendor/ruby/v3.3.11/error.c:241-251` `rb_warning_s_aset`): enables
|
|
30
|
+
* `category` for a truthy `flag`, disables it otherwise, and answers `flag`.
|
|
31
|
+
*
|
|
32
|
+
* @noRailsEquivalent PERMANENT
|
|
33
|
+
*/
|
|
34
|
+
export declare function rbWarningSAset<T>(category: string, flag: T): T;
|
|
35
|
+
//# sourceMappingURL=kernel-warn.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ArgumentError } from "./argument-error.js";
|
|
2
|
+
import { stderr } from "./process-adapter.js";
|
|
3
|
+
import { verbose } from "./verbose.js";
|
|
4
|
+
const WARNING_CATEGORIES = {
|
|
5
|
+
":deprecated": false,
|
|
6
|
+
":experimental": true,
|
|
7
|
+
":performance": false,
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* `Kernel#warn` (`vendor/ruby/v3.3.11/warning.rb:50-52`, `error.c:555` `rb_warn_m`), which
|
|
11
|
+
* writes nothing at all while `$VERBOSE` is `nil` (`error.c:561`, `!NIL_P(ruby_verbose)`) —
|
|
12
|
+
* `false` still warns, so the guard is against `nil` alone — and terminates each
|
|
13
|
+
* message with a newline where it lacks one (`error.c:573`).
|
|
14
|
+
*
|
|
15
|
+
* `category:` names a warning category (`error.c:168` `rb_warning_category_from_name`) and a
|
|
16
|
+
* disabled one writes nothing (`error.c:157,198`); `:deprecated` and `:performance` start disabled.
|
|
17
|
+
*
|
|
18
|
+
* `uplevel:` prefixes the output with `path:line: warning: ` for the frame that many levels above
|
|
19
|
+
* the caller (`error.c:563-586`), or with a bare `warning: ` where there is no such frame, and
|
|
20
|
+
* raises `ArgumentError` for a negative level (`error.c:565-567`).
|
|
21
|
+
*
|
|
22
|
+
* @noRailsEquivalent PERMANENT — Ruby core `Kernel#warn`, which Rails calls without
|
|
23
|
+
* defining.
|
|
24
|
+
*/
|
|
25
|
+
export function warn(...msgs) {
|
|
26
|
+
const last = msgs[msgs.length - 1];
|
|
27
|
+
const { uplevel = null, category = null } = typeof last === "object" ? msgs.pop() : {};
|
|
28
|
+
if (msgs.length === 0 || verbose() == null)
|
|
29
|
+
return;
|
|
30
|
+
let location = null;
|
|
31
|
+
if (uplevel != null) {
|
|
32
|
+
if (uplevel < 0)
|
|
33
|
+
throw new ArgumentError(`negative level (${uplevel})`);
|
|
34
|
+
const frame = new Error().stack?.split("\n")[2 + uplevel] ?? "";
|
|
35
|
+
location = /(?:\(|at )(?:file:\/\/)?([^()\s]+):(\d+):\d+\)?$/.exec(frame.trim());
|
|
36
|
+
}
|
|
37
|
+
if (category != null) {
|
|
38
|
+
if (!Object.hasOwn(WARNING_CATEGORIES, category))
|
|
39
|
+
throw new ArgumentError(`unknown category: ${category}`);
|
|
40
|
+
if (!WARNING_CATEGORIES[category])
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const str = uplevel == null
|
|
44
|
+
? ""
|
|
45
|
+
: location == null
|
|
46
|
+
? "warning: "
|
|
47
|
+
: `${location[1]}:${location[2]}: warning: `;
|
|
48
|
+
stderr.write(str + msgs.map((msg) => (msg.endsWith("\n") ? msg : `${msg}\n`)).join(""));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* `Warning.[]` (`vendor/ruby/v3.3.11/error.c:226-230` `rb_warning_s_aref`): whether
|
|
52
|
+
* `category` is enabled.
|
|
53
|
+
*
|
|
54
|
+
* @noRailsEquivalent PERMANENT
|
|
55
|
+
*/
|
|
56
|
+
export function rbWarningSAref(category) {
|
|
57
|
+
if (!Object.hasOwn(WARNING_CATEGORIES, category))
|
|
58
|
+
throw new ArgumentError(`unknown category: ${category}`);
|
|
59
|
+
return WARNING_CATEGORIES[category];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* `Warning.[]=` (`vendor/ruby/v3.3.11/error.c:241-251` `rb_warning_s_aset`): enables
|
|
63
|
+
* `category` for a truthy `flag`, disables it otherwise, and answers `flag`.
|
|
64
|
+
*
|
|
65
|
+
* @noRailsEquivalent PERMANENT
|
|
66
|
+
*/
|
|
67
|
+
export function rbWarningSAset(category, flag) {
|
|
68
|
+
if (!Object.hasOwn(WARNING_CATEGORIES, category))
|
|
69
|
+
throw new ArgumentError(`unknown category: ${category}`);
|
|
70
|
+
WARNING_CATEGORIES[category] = flag != null && flag !== false;
|
|
71
|
+
return flag;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=kernel-warn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kernel-warn.js","sourceRoot":"","sources":["../lib/kernel-warn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,kBAAkB,GAA4B;IAClD,aAAa,EAAE,KAAK;IACpB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,KAAK;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,IAAI,CAClB,GAAG,IAAwE;IAE3E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACnC,MAAM,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,GAAG,IAAI,EAAE,GACvC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAE,IAAI,CAAC,GAAG,EAAkB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9D,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,EAAE,IAAI,IAAI;QAAE,OAAO;IACnD,IAAI,QAAQ,GAA2B,IAAI,CAAC;IAC5C,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,IAAI,OAAO,GAAG,CAAC;YAAE,MAAM,IAAI,aAAa,CAAC,mBAAmB,OAAO,GAAG,CAAC,CAAC;QACxE,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,KAAK,EAAE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CAAC,MAAM,CAAC,kBAAkB,EAAE,QAAQ,CAAC;QAC9C,MAAM,IAAI,aAAa,CAAC,qBAAqB,QAAQ,EAAE,CAAC,CAAC;IAC3D,kBAAkB,CAAC,QAAQ,CAAC,GAAG,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC;IAC9D,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IndexError } from "./index-error.js";
|
|
2
|
+
/**
|
|
3
|
+
* Ruby's core `KeyError` (`vendor/ruby/v3.3.11/error.c:3325`) — what `Hash#fetch`
|
|
4
|
+
* raises for an absent key (`vendor/ruby/v3.3.11/hash.c:2203` `rb_key_err_raise`).
|
|
5
|
+
* `@blazetrails/activesupport`'s index re-exports it, so that package's
|
|
6
|
+
* public surface is unchanged.
|
|
7
|
+
*
|
|
8
|
+
* Callers pass the whole message, exactly as Ruby composes it: a Symbol key
|
|
9
|
+
* renders `key not found: :expression`, a String key
|
|
10
|
+
* `key not found: "expression"`.
|
|
11
|
+
*
|
|
12
|
+
* Ruby's chain is `KeyError < IndexError < StandardError`
|
|
13
|
+
* (`vendor/ruby/v3.3.11/error.c:3325`).
|
|
14
|
+
*
|
|
15
|
+
* @noRailsEquivalent PERMANENT — Ruby core `KeyError`, which Rails inherits
|
|
16
|
+
* rather than defines.
|
|
17
|
+
*/
|
|
18
|
+
export declare class KeyError extends IndexError {
|
|
19
|
+
#private;
|
|
20
|
+
/**
|
|
21
|
+
* Ruby's `KeyError.new(message=nil, receiver: nil, key: nil)`
|
|
22
|
+
* (`vendor/ruby/v3.3.11/error.c:2537` `key_err_initialize`), which sets each
|
|
23
|
+
* attribute only when its keyword was passed.
|
|
24
|
+
*
|
|
25
|
+
* @noRailsEquivalent PERMANENT
|
|
26
|
+
*/
|
|
27
|
+
constructor(message?: string, options?: {
|
|
28
|
+
receiver?: unknown;
|
|
29
|
+
key?: unknown;
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Ruby's `KeyError#receiver` (`vendor/ruby/v3.3.11/error.c:2491` `key_err_receiver`).
|
|
33
|
+
*
|
|
34
|
+
* @noRailsEquivalent PERMANENT
|
|
35
|
+
*/
|
|
36
|
+
receiver(): unknown;
|
|
37
|
+
/**
|
|
38
|
+
* Ruby's `KeyError#key` (`vendor/ruby/v3.3.11/error.c:2508` `key_err_key`).
|
|
39
|
+
*
|
|
40
|
+
* @noRailsEquivalent PERMANENT
|
|
41
|
+
*/
|
|
42
|
+
key(): unknown;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=key-error.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ArgumentError } from "./argument-error.js";
|
|
2
|
+
import { IndexError } from "./index-error.js";
|
|
3
|
+
/**
|
|
4
|
+
* Ruby's core `KeyError` (`vendor/ruby/v3.3.11/error.c:3325`) — what `Hash#fetch`
|
|
5
|
+
* raises for an absent key (`vendor/ruby/v3.3.11/hash.c:2203` `rb_key_err_raise`).
|
|
6
|
+
* `@blazetrails/activesupport`'s index re-exports it, so that package's
|
|
7
|
+
* public surface is unchanged.
|
|
8
|
+
*
|
|
9
|
+
* Callers pass the whole message, exactly as Ruby composes it: a Symbol key
|
|
10
|
+
* renders `key not found: :expression`, a String key
|
|
11
|
+
* `key not found: "expression"`.
|
|
12
|
+
*
|
|
13
|
+
* Ruby's chain is `KeyError < IndexError < StandardError`
|
|
14
|
+
* (`vendor/ruby/v3.3.11/error.c:3325`).
|
|
15
|
+
*
|
|
16
|
+
* @noRailsEquivalent PERMANENT — Ruby core `KeyError`, which Rails inherits
|
|
17
|
+
* rather than defines.
|
|
18
|
+
*/
|
|
19
|
+
export class KeyError extends IndexError {
|
|
20
|
+
#receiver;
|
|
21
|
+
#hasReceiver;
|
|
22
|
+
#key;
|
|
23
|
+
#hasKey;
|
|
24
|
+
/**
|
|
25
|
+
* Ruby's `KeyError.new(message=nil, receiver: nil, key: nil)`
|
|
26
|
+
* (`vendor/ruby/v3.3.11/error.c:2537` `key_err_initialize`), which sets each
|
|
27
|
+
* attribute only when its keyword was passed.
|
|
28
|
+
*
|
|
29
|
+
* @noRailsEquivalent PERMANENT
|
|
30
|
+
*/
|
|
31
|
+
constructor(message, options = {}) {
|
|
32
|
+
super(message);
|
|
33
|
+
this.#hasReceiver = "receiver" in options;
|
|
34
|
+
this.#receiver = options.receiver;
|
|
35
|
+
this.#hasKey = "key" in options;
|
|
36
|
+
this.#key = options.key;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Ruby's `KeyError#receiver` (`vendor/ruby/v3.3.11/error.c:2491` `key_err_receiver`).
|
|
40
|
+
*
|
|
41
|
+
* @noRailsEquivalent PERMANENT
|
|
42
|
+
*/
|
|
43
|
+
receiver() {
|
|
44
|
+
if (this.#hasReceiver)
|
|
45
|
+
return this.#receiver;
|
|
46
|
+
throw new ArgumentError("no receiver is available");
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Ruby's `KeyError#key` (`vendor/ruby/v3.3.11/error.c:2508` `key_err_key`).
|
|
50
|
+
*
|
|
51
|
+
* @noRailsEquivalent PERMANENT
|
|
52
|
+
*/
|
|
53
|
+
key() {
|
|
54
|
+
if (this.#hasKey)
|
|
55
|
+
return this.#key;
|
|
56
|
+
throw new ArgumentError("no key is available");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=key-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-error.js","sourceRoot":"","sources":["../lib/key-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,QAAS,SAAQ,UAAU;IACtC,SAAS,CAAU;IACnB,YAAY,CAAU;IACtB,IAAI,CAAU;IACd,OAAO,CAAU;IAEjB;;;;;;OAMG;IACH,YAAY,OAAgB,EAAE,OAAO,GAA0C,EAAE;QAC/E,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,YAAY,GAAG,UAAU,IAAI,OAAO,CAAC;QAC1C,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,KAAK,IAAI,OAAO,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACH,QAAQ;QACN,IAAI,IAAI,CAAC,YAAY;YAAE,OAAO,IAAI,CAAC,SAAS,CAAC;QAC7C,MAAM,IAAI,aAAa,CAAC,0BAA0B,CAAC,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACH,GAAG;QACD,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC,IAAI,CAAC;QACnC,MAAM,IAAI,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACjD,CAAC;CACF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ignore_keyword_hash_p` (`vendor/ruby/v3.3.11/vm_args.c:435`), the argument
|
|
3
|
+
* list a `**keyword_hash` splat contributes to a call: nothing when the hash is
|
|
4
|
+
* empty, the hash itself otherwise. Spread it into the call,
|
|
5
|
+
* `base.addIndex(name, columnName, ...keywordSplat(options))`.
|
|
6
|
+
*
|
|
7
|
+
* @noRailsEquivalent PERMANENT — Ruby core `ignore_keyword_hash_p` (`vendor/ruby/v3.3.11/vm_args.c:435`).
|
|
8
|
+
*/
|
|
9
|
+
export declare function keywordSplat<T extends object>(keywordHash: T): [] | [T];
|
|
10
|
+
/**
|
|
11
|
+
* `core_hash_merge_kwd` (`vendor/ruby/v3.3.11/vm.c:3696`), what a `**kw` splat in
|
|
12
|
+
* a hash or keyword literal compiles to: `f(name: name, **options)` is
|
|
13
|
+
* `f(coreHashMergeKwd({ name }, options))`. Each key of `kw` is stored over
|
|
14
|
+
* `hash`'s, except an `undefined`-valued one, which is an absent keyword and
|
|
15
|
+
* which a JS spread would store.
|
|
16
|
+
*
|
|
17
|
+
* @noRailsEquivalent PERMANENT — Ruby core `core_hash_merge_kwd` (`vendor/ruby/v3.3.11/vm.c:3696`).
|
|
18
|
+
*/
|
|
19
|
+
export declare function coreHashMergeKwd<H extends object, K extends object>(hash: H, kw: K): H & K;
|
|
20
|
+
/**
|
|
21
|
+
* `rb_get_kwargs` (`vendor/ruby/v3.3.11/class.c:2413`) for a header with no
|
|
22
|
+
* `**rest`: every key of `keywordHash` that `table` does not declare raises
|
|
23
|
+
* `unknown_keyword_error` (`class.c:2373`), whose message is
|
|
24
|
+
* `rb_keyword_error_new`'s (`class.c:2346`). An `undefined`-valued key is an
|
|
25
|
+
* absent keyword. The `required` / `optional` counts, the `values` out-array
|
|
26
|
+
* and the found-keyword return value are not ported.
|
|
27
|
+
*
|
|
28
|
+
* @noRailsEquivalent PERMANENT — Ruby core `rb_get_kwargs` (`vendor/ruby/v3.3.11/class.c:2413`).
|
|
29
|
+
*/
|
|
30
|
+
export declare function rbGetKwargs(keywordHash: object, table: readonly string[]): void;
|
|
31
|
+
/**
|
|
32
|
+
* `rb_scan_args_set`'s option-hash capture
|
|
33
|
+
* (`vendor/ruby/v3.3.11/include/ruby/internal/scan_args.h:400-407`) for a
|
|
34
|
+
* `(*rest, **keywords)` header: a trailing Hash is popped off `argv` as the
|
|
35
|
+
* keywords (`rb_scan_args_keyword_p`, `scan_args.h:253`), and everything else
|
|
36
|
+
* is the splat.
|
|
37
|
+
*
|
|
38
|
+
* @noRailsEquivalent PERMANENT — Ruby core `rb_scan_args_set` (`vendor/ruby/v3.3.11/include/ruby/internal/scan_args.h:400`).
|
|
39
|
+
*/
|
|
40
|
+
export declare function rbScanArgs<K extends object = Record<string, unknown>>(argv: readonly unknown[]): [unknown[], K];
|
|
41
|
+
//# sourceMappingURL=keyword-splat.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ArgumentError } from "./argument-error.js";
|
|
2
|
+
/**
|
|
3
|
+
* `ignore_keyword_hash_p` (`vendor/ruby/v3.3.11/vm_args.c:435`), the argument
|
|
4
|
+
* list a `**keyword_hash` splat contributes to a call: nothing when the hash is
|
|
5
|
+
* empty, the hash itself otherwise. Spread it into the call,
|
|
6
|
+
* `base.addIndex(name, columnName, ...keywordSplat(options))`.
|
|
7
|
+
*
|
|
8
|
+
* @noRailsEquivalent PERMANENT — Ruby core `ignore_keyword_hash_p` (`vendor/ruby/v3.3.11/vm_args.c:435`).
|
|
9
|
+
*/
|
|
10
|
+
export function keywordSplat(keywordHash) {
|
|
11
|
+
if (Object.keys(keywordHash).length === 0)
|
|
12
|
+
return [];
|
|
13
|
+
return [keywordHash];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `core_hash_merge_kwd` (`vendor/ruby/v3.3.11/vm.c:3696`), what a `**kw` splat in
|
|
17
|
+
* a hash or keyword literal compiles to: `f(name: name, **options)` is
|
|
18
|
+
* `f(coreHashMergeKwd({ name }, options))`. Each key of `kw` is stored over
|
|
19
|
+
* `hash`'s, except an `undefined`-valued one, which is an absent keyword and
|
|
20
|
+
* which a JS spread would store.
|
|
21
|
+
*
|
|
22
|
+
* @noRailsEquivalent PERMANENT — Ruby core `core_hash_merge_kwd` (`vendor/ruby/v3.3.11/vm.c:3696`).
|
|
23
|
+
*/
|
|
24
|
+
export function coreHashMergeKwd(hash, kw) {
|
|
25
|
+
for (const [key, value] of Object.entries(kw)) {
|
|
26
|
+
if (value !== undefined)
|
|
27
|
+
hash[key] = value;
|
|
28
|
+
}
|
|
29
|
+
return hash;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* `rb_get_kwargs` (`vendor/ruby/v3.3.11/class.c:2413`) for a header with no
|
|
33
|
+
* `**rest`: every key of `keywordHash` that `table` does not declare raises
|
|
34
|
+
* `unknown_keyword_error` (`class.c:2373`), whose message is
|
|
35
|
+
* `rb_keyword_error_new`'s (`class.c:2346`). An `undefined`-valued key is an
|
|
36
|
+
* absent keyword. The `required` / `optional` counts, the `values` out-array
|
|
37
|
+
* and the found-keyword return value are not ported.
|
|
38
|
+
*
|
|
39
|
+
* @noRailsEquivalent PERMANENT — Ruby core `rb_get_kwargs` (`vendor/ruby/v3.3.11/class.c:2413`).
|
|
40
|
+
*/
|
|
41
|
+
export function rbGetKwargs(keywordHash, table) {
|
|
42
|
+
const keys = Object.entries(keywordHash)
|
|
43
|
+
.filter(([key, value]) => value !== undefined && !table.includes(key))
|
|
44
|
+
.map(([key]) => `:${key}`);
|
|
45
|
+
if (keys.length > 0) {
|
|
46
|
+
throw new ArgumentError(`unknown keyword${keys.length > 1 ? "s" : ""}: ${keys.join(", ")}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* `rb_scan_args_set`'s option-hash capture
|
|
51
|
+
* (`vendor/ruby/v3.3.11/include/ruby/internal/scan_args.h:400-407`) for a
|
|
52
|
+
* `(*rest, **keywords)` header: a trailing Hash is popped off `argv` as the
|
|
53
|
+
* keywords (`rb_scan_args_keyword_p`, `scan_args.h:253`), and everything else
|
|
54
|
+
* is the splat.
|
|
55
|
+
*
|
|
56
|
+
* @noRailsEquivalent PERMANENT — Ruby core `rb_scan_args_set` (`vendor/ruby/v3.3.11/include/ruby/internal/scan_args.h:400`).
|
|
57
|
+
*/
|
|
58
|
+
export function rbScanArgs(argv) {
|
|
59
|
+
const last = argv[argv.length - 1];
|
|
60
|
+
if (last !== null && typeof last === "object" && last.constructor === Object) {
|
|
61
|
+
return [argv.slice(0, -1), { ...last }];
|
|
62
|
+
}
|
|
63
|
+
return [[...argv], {}];
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=keyword-splat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyword-splat.js","sourceRoot":"","sources":["../lib/keyword-splat.ts"],"names":[],"mappings":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AExB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACnC,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,WAAW,KAAK,MAAM,EAAE,CAAC;QAC7E,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,IAAI,EAAO,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,EAAO,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Exception } from "./exception.js";
|
|
2
|
+
/**
|
|
3
|
+
* Ruby's core `LoadError` (`vendor/ruby/v3.3.11/error.c:3342`) — a `ScriptError`, not
|
|
4
|
+
* a `StandardError`, raised by `require` when the file cannot be found. Its
|
|
5
|
+
* message is built by `rb_load_fail` (`vendor/ruby/v3.3.11/load.c:1154`) as
|
|
6
|
+
* `cannot load such file -- <path>`.
|
|
7
|
+
*
|
|
8
|
+
* @noRailsEquivalent PERMANENT — Ruby core `LoadError`, which Rails inherits
|
|
9
|
+
* rather than defines.
|
|
10
|
+
*/
|
|
11
|
+
export declare class LoadError extends Exception {
|
|
12
|
+
/**
|
|
13
|
+
* Mirrors: Ruby's `LoadError#path` — vendor/ruby/v3.3.11/error.c:3344 `rb_attr(rb_eLoadError, path, ...)`, the feature `require` could not load.
|
|
14
|
+
*
|
|
15
|
+
* @noRailsEquivalent PERMANENT
|
|
16
|
+
*/
|
|
17
|
+
path: string | null;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=load-error.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Exception } from "./exception.js";
|
|
2
|
+
/**
|
|
3
|
+
* Ruby's core `LoadError` (`vendor/ruby/v3.3.11/error.c:3342`) — a `ScriptError`, not
|
|
4
|
+
* a `StandardError`, raised by `require` when the file cannot be found. Its
|
|
5
|
+
* message is built by `rb_load_fail` (`vendor/ruby/v3.3.11/load.c:1154`) as
|
|
6
|
+
* `cannot load such file -- <path>`.
|
|
7
|
+
*
|
|
8
|
+
* @noRailsEquivalent PERMANENT — Ruby core `LoadError`, which Rails inherits
|
|
9
|
+
* rather than defines.
|
|
10
|
+
*/
|
|
11
|
+
export class LoadError extends Exception {
|
|
12
|
+
/**
|
|
13
|
+
* Mirrors: Ruby's `LoadError#path` — vendor/ruby/v3.3.11/error.c:3344 `rb_attr(rb_eLoadError, path, ...)`, the feature `require` could not load.
|
|
14
|
+
*
|
|
15
|
+
* @noRailsEquivalent PERMANENT
|
|
16
|
+
*/
|
|
17
|
+
path = null;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=load-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-error.js","sourceRoot":"","sources":["../lib/load-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,OAAO,SAAU,SAAQ,SAAS;IACtC;;;;OAIG;IACH,IAAI,GAAkB,IAAI,CAAC;CAC5B"}
|
package/dist/load.d.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { LOADED_FEATURES, loadingTable, rbFeatureProvided } from "./loaded-features.js";
|
|
2
|
+
export { LOADED_FEATURES, loadingTable, rbFeatureProvided };
|
|
3
|
+
/**
|
|
4
|
+
* Sets the import {@link loadIseqEval} (`load_iseq_eval`, `vendor/ruby/v3.3.11/load.c:744`) uses for a file no compiled build
|
|
5
|
+
* registered, as `Zeitwerk::Loader#importer` is for an autoloaded file: under
|
|
6
|
+
* vitest an application's own `import()` resolves in vite's graph, where this
|
|
7
|
+
* package's resolves in Node's (zeitwerk CLAUDE.md, "Module#autoload is a build step").
|
|
8
|
+
*
|
|
9
|
+
* @noRailsEquivalent PERMANENT
|
|
10
|
+
*/
|
|
11
|
+
export declare function setLoadImporter(fn: ((url: string) => Promise<unknown>) | null): void;
|
|
12
|
+
/**
|
|
13
|
+
* Registers the modules a compiled build bundled for files it cannot reach
|
|
14
|
+
* through `import(url)`, in place of the read `load_iseq_eval`
|
|
15
|
+
* (`vendor/ruby/v3.3.11/load.c:744`) makes: each key is resolved against `root`, and the first
|
|
16
|
+
* {@link rbFLoad} of that path imports through its thunk (RFC 0224; CLAUDE.md
|
|
17
|
+
* § "Constant lookup is an import or a registry"). Registration lasts for the
|
|
18
|
+
* process, as `$LOADED_FEATURES` does; nothing unregisters a file.
|
|
19
|
+
*
|
|
20
|
+
* @noRailsEquivalent PERMANENT
|
|
21
|
+
*/
|
|
22
|
+
export declare function registerCompiledFiles(root: string, files: Record<string, () => Promise<unknown>>): void;
|
|
23
|
+
/**
|
|
24
|
+
* `rb_file_exist_p` (`vendor/ruby/v3.3.11/file.c:1806`) for a file a compiled
|
|
25
|
+
* build registered through {@link registerCompiledFiles} and ships no source
|
|
26
|
+
* for, the existence {@link rbFRequireFile}'s search also reads.
|
|
27
|
+
*
|
|
28
|
+
* @noRailsEquivalent PERMANENT
|
|
29
|
+
*/
|
|
30
|
+
export declare function isCompiledFile(fname: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* `Dir.glob` (`vendor/ruby/v3.3.11/dir.c:3227`) of `dir` for the files a
|
|
33
|
+
* compiled build registered through {@link registerCompiledFiles} and ships
|
|
34
|
+
* no source for.
|
|
35
|
+
*
|
|
36
|
+
* @noRailsEquivalent PERMANENT
|
|
37
|
+
*/
|
|
38
|
+
export declare function compiledFilesIn(dir: string): string[];
|
|
39
|
+
/**
|
|
40
|
+
* The exports `load_iseq_eval` (`vendor/ruby/v3.3.11/load.c:744`) last
|
|
41
|
+
* answered for `fname` through {@link loadIseqEval}, read where a Rails body
|
|
42
|
+
* evaluates the file synchronously (`Mapper#draw`'s
|
|
43
|
+
* `instance_eval(File.read(route_path))`) after an awaited step loaded it.
|
|
44
|
+
* `undefined` for a file no load has reached.
|
|
45
|
+
*
|
|
46
|
+
* @noRailsEquivalent PERMANENT
|
|
47
|
+
*/
|
|
48
|
+
export declare function loadedFileExports(fname: string): Record<string, unknown> | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* `rb_f_load` (`vendor/ruby/v3.3.11/load.c:903`), `Kernel#load`: evaluates
|
|
51
|
+
* the file every time it is called, unlike `require`. ESM keeps one module
|
|
52
|
+
* record per URL, so each load imports the file under a URL no earlier load
|
|
53
|
+
* used. A Ruby file binds its top-level constants in `rb_cObject`
|
|
54
|
+
* (`rb_const_set`, `vendor/ruby/v3.3.11/variable.c:3674`); an ES module
|
|
55
|
+
* exports them, and each constant-named export is seated there. A name that
|
|
56
|
+
* is neither absolute nor explicitly relative is searched for in `$LOAD_PATH`
|
|
57
|
+
* first (`rb_find_file`, `vendor/ruby/v3.3.11/file.c:6489-6533`).
|
|
58
|
+
*
|
|
59
|
+
* @noRailsEquivalent PERMANENT
|
|
60
|
+
*/
|
|
61
|
+
export declare function rbFLoad(fname: string): Promise<true>;
|
|
62
|
+
/**
|
|
63
|
+
* Sets the record a class an {@link rbFLoad}ed file defines is added to under
|
|
64
|
+
* its superclass, the list `rb_class_subclass_add`
|
|
65
|
+
* (`vendor/ruby/v3.3.11/class.c:99`) keeps for `Class#subclasses` as a
|
|
66
|
+
* class is created. JS has no hook at `class X extends Y`, so the class is
|
|
67
|
+
* recorded where the file that defines it is evaluated.
|
|
68
|
+
*
|
|
69
|
+
* @noRailsEquivalent PERMANENT
|
|
70
|
+
*/
|
|
71
|
+
export declare function setClassDefinedHook(fn: ((superclass: object, klass: object) => void) | null): void;
|
|
72
|
+
/**
|
|
73
|
+
* `load_iseq_eval` (`vendor/ruby/v3.3.11/load.c:744`), the evaluation
|
|
74
|
+
* `Kernel#load` and `Kernel#require` share, answering the module's exports
|
|
75
|
+
* rather than seating them: a caller that reads one file's own export
|
|
76
|
+
* (`Mapper#draw`'s `drawRoutes`, a helper file whose short name another
|
|
77
|
+
* namespace's helper also seats on `TopLevel`) cannot go through
|
|
78
|
+
* {@link rbFLoad}, which answers `true`. A registered
|
|
79
|
+
* {@link registerCompiledFiles} thunk answers the file. With `fresh`, the
|
|
80
|
+
* `Kernel#load` arm, a path is evaluated again on every call after its
|
|
81
|
+
* first, under a URL no earlier load used; without it, the `require` arm,
|
|
82
|
+
* the module is evaluated once and its exports answered on every call.
|
|
83
|
+
*
|
|
84
|
+
* @noRailsEquivalent PERMANENT
|
|
85
|
+
*/
|
|
86
|
+
export declare function loadIseqEval(fname: string, fresh?: boolean): Promise<Record<string, unknown>>;
|
|
87
|
+
/** @noRailsEquivalent PERMANENT — `$LOAD_PATH`, `vendor/ruby/v3.3.11/load.c:1593`. */
|
|
88
|
+
export declare const LOAD_PATH: string[];
|
|
89
|
+
/**
|
|
90
|
+
* `Kernel#require` of a file (`require_internal`,
|
|
91
|
+
* `vendor/ruby/v3.3.11/load.c:1236`): searches `$LOAD_PATH` for
|
|
92
|
+
* `feature.js`, then `feature.ts`, and loads it once. A feature that
|
|
93
|
+
* already ends in a source extension is searched as given
|
|
94
|
+
* (`search_required`'s `IS_RBEXT` arm, `vendor/ruby/v3.3.11/load.c:1058-1072`).
|
|
95
|
+
* A miss raises `LoadError`.
|
|
96
|
+
*
|
|
97
|
+
* @noRailsEquivalent PERMANENT
|
|
98
|
+
*/
|
|
99
|
+
export declare function rbFRequireFile(feature: string): Promise<boolean>;
|
|
100
|
+
/**
|
|
101
|
+
* `rb_f_require` (`vendor/ruby/v3.3.11/load.c:1022`), `Kernel#require`,
|
|
102
|
+
* over a namespace `loadPath` table. ESM has no synchronous load, so this is
|
|
103
|
+
* the awaited step that loads `feature` once (CLAUDE.md § "An adapter file is
|
|
104
|
+
* loaded by an awaited step"); {@link rbRequireLoaded} then answers it
|
|
105
|
+
* synchronously. A miss raises `LoadError` whose `path` is `feature`, and a
|
|
106
|
+
* dependency the file cannot load raises one whose `path` is that module's.
|
|
107
|
+
* The failure is kept, so the synchronous read raises it again.
|
|
108
|
+
*
|
|
109
|
+
* @noRailsEquivalent PERMANENT
|
|
110
|
+
*/
|
|
111
|
+
export declare function rbFRequire(loadPath: Record<string, (() => Promise<unknown>) | undefined>, feature: string): Promise<boolean>;
|
|
112
|
+
/**
|
|
113
|
+
* The synchronous half of {@link rbFRequire}, a read of the features
|
|
114
|
+
* `rb_feature_provided` (`vendor/ruby/v3.3.11/load.c:695`) consults: the exports of a feature it
|
|
115
|
+
* loaded, or the `LoadError` it raised, or one whose `path` is `feature` when
|
|
116
|
+
* the load step has not run.
|
|
117
|
+
*
|
|
118
|
+
* @noRailsEquivalent PERMANENT
|
|
119
|
+
*/
|
|
120
|
+
export declare function rbRequireLoaded(feature: string): Record<string, unknown>;
|
|
121
|
+
//# sourceMappingURL=load.d.ts.map
|