From: "shioyama (Chris Salzberg)" Date: 2022-08-09T13:38:43+00:00 Subject: [ruby-core:109456] [Ruby master Bug#18960] Module#using raises RuntimeError when called at toplevel from wrapped script Issue #18960 has been reported by shioyama (Chris Salzberg). ---------------------------------------- Bug #18960: Module#using raises RuntimeError when called at toplevel from wrapped script https://bugs.ruby-lang.org/issues/18960 * Author: shioyama (Chris Salzberg) * Status: Open * Priority: Normal * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- I noticed that this file works when loaded with `load`, but fails if you pass `true` (or a module) as the `wrap` argument. ```ruby # using.rb using Module.new ``` This works: ```ruby load "./using.rb" ``` This doesn't: ```ruby load "./using.rb", true # raises RuntimeError (main.using is permitted only at toplevel) ``` I believe the latter should work. -- https://bugs.ruby-lang.org/ Unsubscribe: