diff options
author | Daniel Trierweiler <trierweiler@dievision.de> | 2017-02-13 14:54:43 +0100 |
---|---|---|
committer | Daniel Trierweiler <trierweiler@dievision.de> | 2017-02-13 14:54:43 +0100 |
commit | aa9fe85f0551d236227ec853ea06e17669f026a9 (patch) | |
tree | 9d8657694d5e8f337084572137c70c1b0d888310 | |
parent | 09358d459565c39314eea933020c8f848b3cfce0 (diff) | |
download | bundler-aa9fe85f0551d236227ec853ea06e17669f026a9.tar.gz |
Add the option to use the --key parameter for gemstash with private gems
-rw-r--r-- | lib/bundler/gem_helper.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb index 73cbf9e0d1..8cb2485782 100644 --- a/lib/bundler/gem_helper.rb +++ b/lib/bundler/gem_helper.rb @@ -94,6 +94,7 @@ module Bundler 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 @@ -181,6 +182,10 @@ module Bundler end end + def gem_key + ENV["gem_key"].to_s.downcase if ENV["gem_key"] + end + def gem_push? !%w(n no nil false off 0).include?(ENV["gem_push"].to_s.downcase) end |