如何将我的ruby gem发布到我自己的存储库?(How to publish my ruby gem to my own repository?)

编程入门 行业动态 更新时间:2024-10-27 16:36:05
如何将我的ruby gem发布到我自己的存储库?(How to publish my ruby gem to my own repository?)

我已经编写了一个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 inabox

The 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

更多推荐

本文发布于:2023-04-29 13:12:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1336434.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自己的   到我   如何将   ruby   repository

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!