summaryrefslogtreecommitdiff
path: root/lib/pry/code
diff options
context:
space:
mode:
authorKyrylo Silin <silin@kyrylo.org>2018-11-18 00:22:56 +0800
committerKyrylo Silin <silin@kyrylo.org>2018-11-18 00:22:56 +0800
commitccf3c3daa9dbdab981c9c6fa5c685a07dd0cdd9f (patch)
treea10f66252279e360e9d3e3ed5958e951db1613c3 /lib/pry/code
parent9e8a637394df3167b25e8a3bf5a3a8218c3bf2dc (diff)
downloadpry-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.rb8
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