[rubygems/rubygems] Remove unnecessary gem_name method

https://github.com/rubygems/rubygems/commit/d1bb122651
This commit is contained in:
bronzdoc 2019-08-23 15:19:54 -06:00 коммит произвёл Hiroshi SHIBATA
Родитель b11cfed4c4
Коммит 92be07b1e1
1 изменённых файлов: 2 добавлений и 5 удалений

Просмотреть файл

@ -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)