[rubygems/rubygems] Move build gem logic to its own method

https://github.com/rubygems/rubygems/commit/a16eacd650
This commit is contained in:
bronzdoc 2019-08-17 08:54:17 -06:00 коммит произвёл Hiroshi SHIBATA
Родитель fea91d69a3
Коммит 95326150fa
1 изменённых файлов: 9 добавлений и 7 удалений

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

@ -57,13 +57,17 @@ Gems can be saved to a specified filename with the output option:
end
def execute
gemspec = get_one_gem_name
build_gem
end
unless File.exist? gemspec
gemspec += '.gemspec' if File.exist? gemspec + '.gemspec'
private
def build_gem(gemspec = get_one_gem_name)
unless File.exist?(gemspec)
gemspec += ".gemspec" if File.exist?(gemspec + ".gemspec")
end
if File.exist? gemspec
if File.exist?(gemspec)
spec = Gem::Specification.load(gemspec)
if options[:build_path]
@ -77,12 +81,10 @@ Gems can be saved to a specified filename with the output option:
else
alert_error "Gemspec file not found: #{gemspec}"
terminate_interaction 1
terminate_interaction(1)
end
end
private
def build_package(spec)
if spec
Gem::Package.build(