2013-04-11 48 views
2

我已经写了一个ruby gem,我想要将宝石发布到我的自己的GemInABox存储库http://my-gem-repo.com如何将我的红宝石发布到我自己的存储库?

实现此目标的最简单方法是什么?

此外,我想阻止默认发布到Rubygems.org

gem build my_ruby_gem.gemspec 
#push all versions to the gem server 
gem inabox 

第一次:

+2

http://guides.rubygems.org/run-your-own-gem-server/ – 2013-04-11 06:11:50

+1

谢谢。你介意写一个完整的答案,我会接受吗? – viebel 2013-04-11 06:37:45

+0

你正在使用哪种宝石回购,'GemInABox'? – 2013-04-11 12:38:22

回答

5

上托管自己的宝石的信息可以在http://guides.rubygems.org/run-your-own-gem-server/

安装服务器根据该网站和https://github.com/cwninja/geminabox

自述释放你的宝石被发现你运行宝石inabox,你会配置目的地。

进行耙的任务,你可以把这个Rake文件在你的宝石来源:

#!/usr/bin/env rake 
desc "build the gem" 
task :build do 
    system("gem build *.gemspec") 
end 

desc "push the gem to the gem inabox server" 
task :release do 
    system("gem inabox") 
end 

desc "build and release the gem" 
task :build_and_release => [:build,:release] 

系统调用肯定是黑客,但他们是一个简单的方法,使其工作。更好的耙子任务请求: https://github.com/cwninja/geminabox/issues/59