diff options
| author | 0xAB <0xAB@protonmail.com> | 2017-08-23 04:08:03 +0100 |
|---|---|---|
| committer | 0xAB <0xAB@protonmail.com> | 2017-08-23 04:11:26 +0100 |
| commit | fb8b57958e5754751d4a4c675a3988c2c2f37872 (patch) | |
| tree | ddfb03763b52c7fa63d673ec81cebfc3230c0382 | |
| parent | 56984ef909020b4cac4ac8f5f586159f50c0f25b (diff) | |
| download | pry-and-fakefs.tar.gz | |
Provide better fakefs integration by default.pry-and-fakefs
Fix #1593
See also https://github.com/fakefs/fakefs/issues/362
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | lib/pry/history.rb | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 332a5993..605ac0b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### HEAD +* Provide better fakefs integration by default. ([#1631](https://github.com/pry/pry/1631)) * Add text helpers for background colors ([#1624](https://github.com/pry/pry/pull/1624)) * Fix string literal methods completion. ([#1590](https://github.com/pry/pry/pull/1590)) * Make sure Pry::WrappedModule::Candidate#source_location returns non-nil value when `.name` has diff --git a/lib/pry/history.rb b/lib/pry/history.rb index 72cbc81c..9bdedcc2 100644 --- a/lib/pry/history.rb +++ b/lib/pry/history.rb @@ -2,6 +2,7 @@ class Pry # The History class is responsible for maintaining the user's input history, # both internally and within Readline. class History + OPEN_SYSERRORS = [Errno::EACCES, Errno::ENOENT] attr_accessor :loader, :saver, :pusher, :clearer # @return [Fixnum] Number of lines in history when Pry first loaded. @@ -136,7 +137,7 @@ class Pry file.sync = true end end - rescue Errno::EACCES + rescue *OPEN_SYSERRORS warn 'History not saved; unable to open your history file for writing.' @history_file = false end |
