diff options
author | Kyrylo Silin <silin@kyrylo.org> | 2018-11-18 00:22:56 +0800 |
---|---|---|
committer | Kyrylo Silin <silin@kyrylo.org> | 2018-11-18 00:22:56 +0800 |
commit | ccf3c3daa9dbdab981c9c6fa5c685a07dd0cdd9f (patch) | |
tree | a10f66252279e360e9d3e3ed5958e951db1613c3 /lib/pry/code | |
parent | 9e8a637394df3167b25e8a3bf5a3a8218c3bf2dc (diff) | |
download | pry-ccf3c3daa9dbdab981c9c6fa5c685a07dd0cdd9f.tar.gz |
rubocop: fix offences of the Style/AndOr cop
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 |