Sha256: d87e68d14b5159270e9bae968edb38fa25b947df4288338d43928a0234d0f687
Contents?: true
Size: 839 Bytes
Versions: 71
Compression:
Stored size: 839 Bytes
Contents
require 'bundler' require 'bundler/gem_tasks' def gem_server @gem_server ||= ENV['GEM_SERVER'] || 'rubygems.org' end module Bundler class GemHelper unless gem_server == 'rubygems.org' unless method_defined?(:rubygem_push) raise NoMethodError, "Monkey patching Bundler::GemHelper#rubygem_push failed: did the Bundler API change???" end def rubygem_push(path) print "Username: " username = STDIN.gets.chomp print "Password: " password = STDIN.gets.chomp gem_server_url = "https://#{username}:#{password}@#{gem_server}/" sh %{gem push #{path} --host #{gem_server_url}} Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_server}" end puts "Monkey patched Bundler::GemHelper#rubygem_push to push to #{gem_server}." end end end
Version data entries
71 entries across 71 versions & 2 rubygems