зеркало из https://github.com/github/ruby.git
set real path to __FILE__ and __dir__ in Binding#irb
When reading Binding#irb, the file of the calling source is reflected in __FILE__ and __dir__.
This commit is contained in:
Родитель
29c1e9a0d4
Коммит
87958520f3
|
@ -850,6 +850,8 @@ class Binding
|
|||
IRB.setup(source_location[0], argv: [])
|
||||
workspace = IRB::WorkSpace.new(self)
|
||||
STDOUT.print(workspace.code_around_binding)
|
||||
IRB::Irb.new(workspace).run(IRB.conf)
|
||||
binding_irb = IRB::Irb.new(workspace)
|
||||
binding_irb.context.irb_path = File.expand_path(source_location[0])
|
||||
binding_irb.run(IRB.conf)
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче