Skip to content

Commit 160d135

Browse files
committed
Append '.gemspec' extension only when it is not present.
This avoids confusing messages such as: ~~~ $ gem build *.gemspec ERROR: Gemspec file not found: *.gemspec.gemspec ~~~ Fixes #3953
1 parent 15e431b commit 160d135

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/rubygems/commands/build_command.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def find_gemspec
7979
end
8080

8181
def build_gem(gem_name)
82-
gemspec = File.exist?(gem_name) ? gem_name : "#{gem_name}.gemspec"
82+
gemspec = File.extname(gem_name) == ".gemspec" ? gem_name : "#{gem_name}.gemspec"
8383

8484
if File.exist?(gemspec)
8585
spec = Gem::Specification.load(gemspec)

0 commit comments

Comments
 (0)