Skip to content

Commit

Permalink
Append '.gemspec' extension only when it is not present.
Browse files Browse the repository at this point in the history
This avoids confusing messages such as:

~~~
$ gem build *.gemspec
ERROR:  Gemspec file not found: *.gemspec.gemspec
~~~

Fixes #3953
  • Loading branch information
voxik committed Sep 17, 2020
1 parent 15e431b commit 160d135
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rubygems/commands/build_command.rb
Expand Up @@ -79,7 +79,7 @@ def find_gemspec
end

def build_gem(gem_name)
gemspec = File.exist?(gem_name) ? gem_name : "#{gem_name}.gemspec"
gemspec = File.extname(gem_name) == ".gemspec" ? gem_name : "#{gem_name}.gemspec"

if File.exist?(gemspec)
spec = Gem::Specification.load(gemspec)
Expand Down

0 comments on commit 160d135

Please sign in to comment.