From a02da1012bb391ae01affac7454ea28996fd7dbf Mon Sep 17 00:00:00 2001 From: bronzdoc Date: Sun, 18 Aug 2019 14:57:41 -0600 Subject: [rubygems/rubygems] Build the first gemspec we found if no gemspec is specified https://github.com/rubygems/rubygems/commit/ab186266b7 --- lib/rubygems/commands/build_command.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/rubygems/commands/build_command.rb b/lib/rubygems/commands/build_command.rb index bc37ab9a94..69203d3ebc 100644 --- a/lib/rubygems/commands/build_command.rb +++ b/lib/rubygems/commands/build_command.rb @@ -57,11 +57,19 @@ Gems can be saved to a specified filename with the output option: end def execute - build_gem + build_gem(gem_name) end private + def gem_name + get_one_optional_argument || find_gemspecs.first + end + + def find_gemspecs + Dir.glob("*.gemspec").sort + end + def build_gem(gem_name = get_one_optional_argument) gemspec = File.exist?(gem_name) ? gem_name : "#{gem_name}.gemspec" -- cgit v1.2.3