summaryrefslogtreecommitdiff
path: root/lib/bundler/source/path.rb
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-01-14 16:21:54 -0600
committerSamuel Giddins <segiddins@segiddins.me>2016-01-31 22:21:13 -0600
commite85b990916f16dd9a56dbafae6503f7a48d55131 (patch)
treef9244f2ab14db6abf5c0bc38ee5508ccfc94aa30 /lib/bundler/source/path.rb
parent9297bcf0135a0bd8c1df29b929267582ca66217d (diff)
downloadbundler-e85b990916f16dd9a56dbafae6503f7a48d55131.tar.gz
[RuboCop] Address Style/GuardClause
Diffstat (limited to 'lib/bundler/source/path.rb')
-rw-r--r--lib/bundler/source/path.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index 24a01b4060..605aa5ae71 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -156,10 +156,14 @@ module Bundler
end
end
end
- elsif File.exist?(expanded_path)
- raise PathError, "The path `#{expanded_path}` is not a directory."
else
- raise PathError, "The path `#{expanded_path}` does not exist."
+ message = "The path `#{expanded_path}` "
+ message << if File.exist?(expanded_path)
+ "is not a directory."
+ else
+ "does not exist."
+ end
+ raise PathError, message
end
index