mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
29c1e9a0d4
commit
87958520f3
Notes:
git
2019-10-11 09:33:56 +09:00
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue