From ccf3c3daa9dbdab981c9c6fa5c685a07dd0cdd9f Mon Sep 17 00:00:00 2001 From: Kyrylo Silin Date: Sun, 18 Nov 2018 00:22:56 +0800 Subject: rubocop: fix offences of the Style/AndOr cop --- lib/pry/code/code_file.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/pry/code') 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 -- cgit v1.2.1