diff options
author | aycabta <[email protected]> | 2019-11-19 20:58:11 +0900 |
---|---|---|
committer | aycabta <[email protected]> | 2019-11-20 08:19:58 +0900 |
commit | bc0da8e3ff409f09888ffe98e6e66b503ebc8083 (patch) | |
tree | cdd65b9033ce8cfff0d3e608cfb8838e2de29afc /lib/irb/init.rb | |
parent | ff41663403d3eb76d95f465cb94e14d2faaa04d1 (diff) |
Generate history file path correctly when $HOME/.irbrc doesn't exist
Diffstat (limited to 'lib/irb/init.rb')
-rw-r--r-- | lib/irb/init.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/irb/init.rb b/lib/irb/init.rb index 5dd0c12c32..00357468c9 100644 --- a/lib/irb/init.rb +++ b/lib/irb/init.rb @@ -274,11 +274,11 @@ module IRB # :nodoc: if home = ENV["HOME"] yield proc{|rc| home+"/.irb#{rc}"} end - home = Dir.pwd - yield proc{|rc| home+"/.irb#{rc}"} - yield proc{|rc| home+"/irb#{rc.sub(/\A_?/, '.')}"} - yield proc{|rc| home+"/_irb#{rc}"} - yield proc{|rc| home+"/$irb#{rc}"} + current_dir = Dir.pwd + yield proc{|rc| current_dir+"/.irb#{rc}"} + yield proc{|rc| current_dir+"/irb#{rc.sub(/\A_?/, '.')}"} + yield proc{|rc| current_dir+"/_irb#{rc}"} + yield proc{|rc| current_dir+"/$irb#{rc}"} end # loading modules |