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.27 Rakefile
clc-chef-metal-vsphere-0.3.26 Rakefile
clc-chef-metal-vsphere-0.3.25 Rakefile
clc-chef-metal-vsphere-0.3.24 Rakefile
clc-chef-metal-vsphere-0.3.23 Rakefile
clc-chef-metal-vsphere-0.3.22 Rakefile
clc-chef-metal-vsphere-0.3.21 Rakefile
clc-chef-metal-vsphere-0.3.20 Rakefile
clc-chef-metal-vsphere-0.3.19 Rakefile
clc-chef-metal-vsphere-0.3.18 Rakefile
clc-chef-metal-vsphere-0.3.17 Rakefile
clc-chef-metal-vsphere-0.3.16 Rakefile
clc-chef-metal-vsphere-0.3.15 Rakefile
clc-chef-metal-vsphere-0.3.14 Rakefile
clc-chef-metal-vsphere-0.3.13 Rakefile
clc-chef-metal-vsphere-0.3.12 Rakefile
clc-chef-metal-vsphere-0.3.11 Rakefile
clc-chef-metal-vsphere-0.3.10 Rakefile
clc-chef-metal-vsphere-0.3.9 Rakefile
clc-chef-metal-vsphere-0.3.8 Rakefile