1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Merge pull request #1443 from egwspiti/master

Don't raise when directory permissions don't allow file expansion.
This commit is contained in:
Kyrylo Silin 2015-06-29 12:51:38 +03:00
commit f117fded1c
3 changed files with 13 additions and 2 deletions

View file

@ -1,6 +1,7 @@
### HEAD
* Syntax highlight <tt> tags in documentation output.
* Don't raise when directory permissions don't allow file expansion ([#1432](https://github.com/pry/pry/issues/1432))
* Syntax highlight &lt;tt&gt; tags in documentation output.
* Add support for BasicObject subclasses who implement their own #inspect (#1341)
* Fix 'include RSpec::Matchers' at the top-level (#1277)
* Add 'gem-readme' command, prints the README file bundled with a rubygem

View file

@ -81,7 +81,7 @@ class Pry
expanded = Pathname.new(File.expand_path(file)).realpath.to_s
# For rbx 1.9 mode [see rubinius issue #2165]
File.exist?(expanded) ? expanded : nil
rescue Errno::ENOENT
rescue Errno::ENOENT, Errno::EACCES
nil
end

View file

@ -37,6 +37,16 @@ describe Pry do
end
end
it "should not load the pryrc if pryrc's directory permissions do not allow this" do
Dir.mktmpdir do |dir|
File.chmod 0000, dir
Pry::LOCAL_RC_FILE.replace File.join(dir, '.pryrc')
Pry.config.should_load_rc = true
expect { Pry.start(self, :input => StringIO.new("exit-all\n"), :output => StringIO.new) }.to_not raise_error
File.chmod 0777, dir
end
end
it "should not load the pryrc if it cannot expand ENV[HOME]" do
old_home = ENV['HOME']
ENV['HOME'] = nil