From 92be07b1e1a9ca3b0e2588817629c23ab1201701 Mon Sep 17 00:00:00 2001 From: bronzdoc Date: Fri, 23 Aug 2019 15:19:54 -0600 Subject: [rubygems/rubygems] Remove unnecessary gem_name method https://github.com/rubygems/rubygems/commit/d1bb122651 --- lib/rubygems/commands/build_command.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/rubygems') diff --git a/lib/rubygems/commands/build_command.rb b/lib/rubygems/commands/build_command.rb index c7d5fd31f5..0ea5582aae 100644 --- a/lib/rubygems/commands/build_command.rb +++ b/lib/rubygems/commands/build_command.rb @@ -57,15 +57,12 @@ Gems can be saved to a specified filename with the output option: end def execute + gem_name = get_one_optional_argument || find_gemspec build_gem(gem_name) end private - def gem_name - get_one_optional_argument || find_gemspec - end - def find_gemspec gemspecs = Dir.glob("*.gemspec").sort @@ -77,7 +74,7 @@ Gems can be saved to a specified filename with the output option: gemspecs.first end - def build_gem(gem_name = get_one_optional_argument) + def build_gem(gem_name) gemspec = File.exist?(gem_name) ? gem_name : "#{gem_name}.gemspec" if File.exist?(gemspec) -- cgit v1.2.3