I'm hosting a private gem on Gemfury and would like to override rake release
task to push to my Gemfury private URL instead of Rubygems.
I'de like to keep the Git tag creation though.
Any ideas where I should begin to?
Here is what my Rakefile looks like:
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task default: :spec
task test: :spec
Actually found the answer:
Rakefile
require 'bundler/gem_tasks'
require 'rubygems/builder'
require 'gemfury'
require 'gemfury/command'
# Override rubygem_push to push to gemfury instead when doing `rake release`
module Bundler
class GemHelper
def rubygem_push(path)
::Gemfury::Command::App.start(['push', path])
end
end
end
Now when doing:
rake release
It create git tags and push to my Gemfury private gem repository.
You'll want to create a file in ~/.gem/gemfury
with your secret key:
---
:gemfury_api_key: 1H...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With