diff options
author | bronzdoc <lsagastume1990@gmail.com> | 2019-08-18 14:04:08 -0600 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-09-05 18:42:49 +0900 |
commit | bcf51dd76332bc28ee75494c51828a36774ff99f (patch) | |
tree | ac5d4f419e2f7caabaf9537ee52f702a82223e5d /lib/rubygems | |
parent | 68937fe0e4bf6e0943fe165e0a157058cff760fe (diff) | |
download | ruby-bcf51dd76332bc28ee75494c51828a36774ff99f.tar.gz |
[rubygems/rubygems] Improve gemspec assignment and error message
https://github.com/rubygems/rubygems/commit/dc70c5a192
Diffstat (limited to 'lib/rubygems')
-rw-r--r-- | lib/rubygems/commands/build_command.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/rubygems/commands/build_command.rb b/lib/rubygems/commands/build_command.rb index 27d8140428..bc37ab9a94 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: 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) |