diff options
Diffstat (limited to 'lib/pry/code')
-rw-r--r-- | lib/pry/code/code_file.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/pry/code/code_file.rb b/lib/pry/code/code_file.rb index 62a0c97e..f48b4fad 100644 --- a/lib/pry/code/code_file.rb +++ b/lib/pry/code/code_file.rb @@ -58,16 +58,16 @@ class Pry # readable for some reason. # @return [String] absolute path for the given `filename`. def abs_path - code_path.detect { |path| readable?(path) } or - raise MethodSource::SourceNotFoundError, - "Cannot open #{ @filename.inspect } for reading." + code_path.detect { |path| readable?(path) } || + raise(MethodSource::SourceNotFoundError, + "Cannot open #{ @filename.inspect } for reading.") end # @param [String] path # @return [Boolean] if the path, with or without the default ext, # is a readable file then `true`, otherwise `false`. def readable?(path) - File.readable?(path) && !File.directory?(path) or + File.readable?(path) && !File.directory?(path) || File.readable?(path << DEFAULT_EXT) end |