summaryrefslogtreecommitdiff
path: root/lib/bundler/cli/gem.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2021-08-04 08:43:07 +0200
committerHiroshi SHIBATA <[email protected]>2021-08-31 19:06:14 +0900
commita3b3fdc3cdff57a6ec6da703841b75a41edbe42c (patch)
tree4e155bf584f61096d5f4ac804cc14653960c5a33 /lib/bundler/cli/gem.rb
parent8adc606271210acad490e93c47c3e1501407fb27 (diff)
[rubygems/rubygems] Take advantage of `target` being a `Pathname`
https://github.com/rubygems/rubygems/commit/c31b8cd232
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4789
Diffstat (limited to 'lib/bundler/cli/gem.rb')
-rw-r--r--lib/bundler/cli/gem.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb
index 43c3321053..a034aea324 100644
--- a/lib/bundler/cli/gem.rb
+++ b/lib/bundler/cli/gem.rb
@@ -185,7 +185,7 @@ module Bundler
)
end
- if File.exist?(target) && !File.directory?(target)
+ if target.exist? && !target.directory?
Bundler.ui.error "Couldn't create a new gem named `#{gem_name}` because there's an existing file named `#{gem_name}`."
exit Bundler::BundlerError.all_errors[Bundler::GenericSystemCallError]
end