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

Version Path
clc-chef-metal-vsphere-0.3.47 Rakefile
clc-chef-metal-vsphere-0.3.46 Rakefile
clc-chef-metal-vsphere-0.3.45 Rakefile
clc-chef-metal-vsphere-0.3.44 Rakefile
clc-chef-metal-vsphere-0.3.43 Rakefile
clc-chef-metal-vsphere-0.3.42 Rakefile
clc-chef-metal-vsphere-0.3.41 Rakefile
clc-chef-metal-vsphere-0.3.40 Rakefile
clc-chef-metal-vsphere-0.3.39 Rakefile
clc-chef-metal-vsphere-0.3.38 Rakefile
clc-chef-metal-vsphere-0.3.37 Rakefile
clc-chef-metal-vsphere-0.3.36 Rakefile
clc-chef-metal-vsphere-0.3.35 Rakefile
clc-chef-metal-vsphere-0.3.34 Rakefile
clc-chef-metal-vsphere-0.3.33 Rakefile
clc-chef-metal-vsphere-0.3.32 Rakefile
clc-chef-metal-vsphere-0.3.31 Rakefile
clc-chef-metal-vsphere-0.3.30 Rakefile
clc-chef-metal-vsphere-0.3.29 Rakefile
clc-chef-metal-vsphere-0.3.28 Rakefile