Skip to content

Instantly share code, notes, and snippets.

@tylerhunt
Created February 7, 2014 00:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tylerhunt/8855577 to your computer and use it in GitHub Desktop.
Save tylerhunt/8855577 to your computer and use it in GitHub Desktop.
Monkey-patch for Bundler's release Rake task to push to Gemfury instead of RubyGems.org.
source 'https://rubygems.org/'
gem 'gemfury', '~> 0.4.20'
require 'bundler/gem_tasks'
require 'gemfury'
require 'gemfury/command'
GEMFURY_ACCOUNT = '<Gemfury account>'
# Monkey patch the Bundler Rake task helpers to push the released gem to
# Gemfury instead of RubyGems.org.
module Bundler
class GemHelper
unless instance_methods.include?(:rubygem_push)
fail 'Rake task monkey patch misapplied'
end
def rubygem_push(path, account=GEMFURY_ACCOUNT)
::Gemfury::Command::App.start(['push', path, "--as=#{GEMFURY_ACCOUNT}"])
Bundler.ui.confirm "Pushed #{name} #{version} to Gemfury as #{account}"
end
end
end
@twmills
Copy link

twmills commented Mar 31, 2014

What format does the < Gemfury account > value take?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment