1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Prepare to release bundler-2.1.0

This commit is contained in:
Hiroshi SHIBATA 2019-12-14 19:49:16 +09:00 committed by SHIBATA Hiroshi
parent e2b192f7d5
commit 38002a8adb
Notes: git 2019-12-15 16:41:38 +09:00
146 changed files with 4685 additions and 459 deletions

View file

@ -73,8 +73,7 @@ module Bundler
def build_gem
file_name = nil
gem = ENV["GEM_COMMAND"] ? ENV["GEM_COMMAND"] : "gem"
sh("#{gem} build -V #{spec_path}".shellsplit) do
sh("#{gem_command} build -V #{spec_path}".shellsplit) do
file_name = File.basename(built_gem_path)
SharedHelpers.filesystem_access(File.join(base, "pkg")) {|p| FileUtils.mkdir_p(p) }
FileUtils.mv(built_gem_path, "pkg")
@ -85,11 +84,10 @@ module Bundler
def install_gem(built_gem_path = nil, local = false)
built_gem_path ||= build_gem
gem = ENV["GEM_COMMAND"] ? ENV["GEM_COMMAND"] : "gem"
cmd = "#{gem} install #{built_gem_path}"
cmd = "#{gem_command} install #{built_gem_path}"
cmd += " --local" if local
out, status = sh_with_status(cmd.shellsplit)
unless status.success? && out[/Successfully installed/]
_, status = sh_with_status(cmd.shellsplit)
unless status.success?
raise "Couldn't install gem, run `gem install #{built_gem_path}' for more detailed output"
end
Bundler.ui.confirm "#{name} (#{version}) installed."
@ -98,13 +96,13 @@ module Bundler
protected
def rubygem_push(path)
gem_command = %W[gem push #{path}]
gem_command << "--key" << gem_key if gem_key
gem_command << "--host" << allowed_push_host if allowed_push_host
cmd = %W[#{gem_command} push #{path}]
cmd << "--key" << gem_key if gem_key
cmd << "--host" << allowed_push_host if allowed_push_host
unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file?
raise "Your rubygems.org credentials aren't set. Run `gem push` to set them."
end
sh_with_input(gem_command)
sh_with_input(cmd)
Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_push_host}"
end
@ -211,5 +209,9 @@ module Bundler
def gem_push?
!%w[n no nil false off 0].include?(ENV["gem_push"].to_s.downcase)
end
def gem_command
ENV["GEM_COMMAND"] ? ENV["GEM_COMMAND"] : "gem"
end
end
end