summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Deering <mdeering@mdeering.com>2017-05-31 16:59:30 -0600
committerMichael Deering <mdeering@mdeering.com>2017-05-31 16:59:30 -0600
commit2803c9a5795315ac1d8579bf202c2f6f6a97a11f (patch)
tree79165e9182f0fc22a785c37d58864cfb68b769c7
parent765729c57112d9a7d0b1813a56525f76bf2b1175 (diff)
downloadbundler-2803c9a5795315ac1d8579bf202c2f6f6a97a11f.tar.gz
List the remote host correctly in rake task desc.
-rw-r--r--lib/bundler/gem_helper.rb18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb
index 3c1680a194..6a0906a200 100644
--- a/lib/bundler/gem_helper.rb
+++ b/lib/bundler/gem_helper.rb
@@ -50,7 +50,7 @@ module Bundler
install_gem(built_gem_path, :local)
end
- desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to RubyGems\n" \
+ desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to #{gem_push_host}\n" \
"To prevent publishing in RubyGems use `gem_push=no rake release`"
task "release", [:remote] => ["build", "release:guard_clean",
"release:source_control_push", "release:rubygem_push"] do
@@ -92,18 +92,14 @@ module Bundler
protected
def rubygem_push(path)
- allowed_push_host = nil
gem_command = "gem push '#{path}'"
gem_command += " --key #{gem_key}" if gem_key
- if @gemspec.respond_to?(:metadata)
- allowed_push_host = @gemspec.metadata["allowed_push_host"]
- gem_command += " --host #{allowed_push_host}" if allowed_push_host
- end
+ gem_command += " --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(gem_command)
- Bundler.ui.confirm "Pushed #{name} #{version} to #{allowed_push_host ? allowed_push_host : "rubygems.org."}"
+ Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_push_host}"
end
def built_gem_path
@@ -116,6 +112,14 @@ module Bundler
Bundler.ui.confirm "Pushed git commits and tags."
end
+ def allowed_push_host
+ @gemspec.metadata["allowed_push_host"] if @gemspec.respond_to?(:metadata)
+ end
+
+ def gem_push_host
+ allowed_push_host || "rubygems.org"
+ end
+
def perform_git_push(options = "")
cmd = "git push #{options}"
out, code = sh_with_code(cmd)