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

shell_command: simplify the return conditions

This commit is contained in:
Kyrylo Silin 2015-06-17 16:17:51 +03:00
parent f6966b320e
commit 2b7785a64d

View file

@ -54,9 +54,7 @@ class Pry
end
def path_from_cd_path(dest)
return unless dest
return unless cd_path_exists?
return if special_case_path?(dest)
return if !(dest && cd_path_exists?) || special_case_path?(dest)
cd_path_env.split(File::PATH_SEPARATOR).each do |path|
if File.directory?(path) && path.split(File::SEPARATOR).last == dest