ruby-changes:57554
From: bronzdoc <ko1@a...>
Date: Thu, 5 Sep 2019 20:20:04 +0900 (JST)
Subject: [ruby-changes:57554] bcf51dd763 (master): [rubygems/rubygems] Improve gemspec assignment and error message
https://git.ruby-lang.org/ruby.git/commit/?id=bcf51dd763 From bcf51dd76332bc28ee75494c51828a36774ff99f Mon Sep 17 00:00:00 2001 From: bronzdoc <lsagastume1990@g...> Date: Sun, 18 Aug 2019 14:04:08 -0600 Subject: [rubygems/rubygems] Improve gemspec assignment and error message https://github.com/rubygems/rubygems/commit/dc70c5a192 diff --git a/lib/rubygems/commands/build_command.rb b/lib/rubygems/commands/build_command.rb index 27d8140..bc37ab9 100644 --- a/lib/rubygems/commands/build_command.rb +++ b/lib/rubygems/commands/build_command.rb @@ -62,10 +62,8 @@ Gems can be saved to a specified filename with the output option: https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/build_command.rb#L62 private - def build_gem(gemspec = get_one_optional_argument) - unless File.exist?(gemspec) - gemspec += ".gemspec" if File.exist?(gemspec + ".gemspec") - end + def build_gem(gem_name = get_one_optional_argument) + gemspec = File.exist?(gem_name) ? gem_name : "#{gem_name}.gemspec" if File.exist?(gemspec) spec = Gem::Specification.load(gemspec) diff --git a/test/rubygems/test_gem_commands_build_command.rb b/test/rubygems/test_gem_commands_build_command.rb index 58fc964..6d44d48 100644 --- a/test/rubygems/test_gem_commands_build_command.rb +++ b/test/rubygems/test_gem_commands_build_command.rb @@ -189,7 +189,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_build_command.rb#L189 end assert_equal '', @ui.output - assert_equal "ERROR: Gemspec file not found: some_gem\n", @ui.error + assert_equal "ERROR: Gemspec file not found: some_gem.gemspec\n", @ui.error end def test_execute_outside_dir -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/