我已经编写了一个ruby gem ,我希望有一个rake任务将gem发布到我自己的GemInABox存储库 : http://my-gem-repo.com : GemInABox 。
实现这一目标的最简单方法是什么?
另外,我想阻止默认发布到Rubygems.org 。
I have written a ruby gem and I would like to have a rake task for publishing the gem to my own GemInABox repository : http://my-gem-repo.com.
What is the simplest way of achieving this goal?
Also, I would like to prevent the default publishing to Rubygems.org.
最满意答案
有关托管自己宝石的信息,请访问http://guides.rubygems.org/run-your-own-gem-server/
根据该站点和https://github.com/cwninja/geminabox上的自述文件设置服务器
要释放你的宝石:
gem build my_ruby_gem.gemspec #push all versions to the gem server gem inabox第一次运行gem inabox时,您将配置目标。
对于rake任务,你可以将这个Rakefile放在你的gem源中:
#!/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]系统调用肯定是黑客攻击,但它们是使其工作的简单方法。 需要更好的rake任务: https : //github.com/cwninja/geminabox/issues/59
Information on hosting your own gem can be found at http://guides.rubygems.org/run-your-own-gem-server/
Setup the server according to that site and the README on https://github.com/cwninja/geminabox
To release your gem:
gem build my_ruby_gem.gemspec #push all versions to the gem server gem inaboxThe first time you run gem inabox, you will configure the destination.
For rake tasks, you could put this Rakefile in your gem source:
#!/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]The system calls are definitely hacks, but they are a simple way to make it work. Better rake tasks are requested in: https://github.com/cwninja/geminabox/issues/59
更多推荐
发布评论