mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Pry.config.history.file now has File.expand_path() applied before being saved
This commit is contained in:
parent
8426fbe350
commit
fed3335e10
1 changed files with 5 additions and 5 deletions
|
@ -1,6 +1,5 @@
|
|||
require "pry/command_processor.rb"
|
||||
|
||||
# @attr prompt
|
||||
class Pry
|
||||
|
||||
attr_accessor :input
|
||||
|
@ -78,7 +77,7 @@ class Pry
|
|||
self.class.nesting = v
|
||||
end
|
||||
|
||||
# @return [Boolean] Whether current session is the top-level session.
|
||||
# @return [Boolean] Whether top-level session has ended.
|
||||
def finished_top_level_session?
|
||||
nesting.empty?
|
||||
end
|
||||
|
@ -228,7 +227,7 @@ class Pry
|
|||
eval_string
|
||||
end
|
||||
|
||||
# FIXME should delete this method? it's exposing an implementation detail!
|
||||
# Output the result or pass to an exception handler (if result is an exception).
|
||||
def show_result(result)
|
||||
if last_result_is_exception?
|
||||
exception_handler.call output, result
|
||||
|
@ -348,8 +347,9 @@ class Pry
|
|||
|
||||
# Save readline history to a file.
|
||||
def save_history
|
||||
File.open Pry.config.history.file, 'w' do |f|
|
||||
f.write Readline::HISTORY.to_a.join("\n")
|
||||
history_file = File.expand_path(Pry.config.history.file)
|
||||
File.open(history_file, 'w') do |f|
|
||||
f.write Readline::HISTORY.to_a.join("\n")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue