Bundler用geminabox发行的佣金释放? [英] Bundler's rake release with geminabox?
问题描述
有没有一种配置捆绑器的方法,当我进行 rake版本
时,它将把gem提交到我自己的gem服务器(盒子中的宝石实例)而不是rubygems?
理想情况下,此配置是
Rubygems实际上是硬编码到捆绑程序中的,我发现只有一种方法
以下猴子补丁应该可以为您提供所需的东西:
模块Bundler
类GemHelper
受保护的
def rubygem_push(path)
如果Pathname.new(〜/ .gem / nexus)。expand_path.exist?
sh( gem nexus'#{path}'))
Bundler.ui。确认将#{name}#{version}推送到https://< your-url-here> / 。
else
提高您的Nexus凭据尚未设置。运行`gem nexus#{path}`来推送您的gem并设置凭据。
结束
结束
结束
结束
就上述而言,它是Nexus而不是Geminabox的概念。
就从git省略它,恐怕我们没有运气。但是,您可以在项目之间适当地共享它,因此只需要将其检入一个位置即可,而不必检查多个位置。希望这会有所帮助!
Is there a way to configure bundler so that when I do rake release
it would submit the gem to my own gem server (a gem in a box instance) rather than to rubygems?
Ideally this configuration would be something I can omit from my git repository.
Rubygems is actually hard-coded into bundler and I've found only one way around it.
The following monkeypatch should get you what you want:
module Bundler
class GemHelper
protected
def rubygem_push(path)
if Pathname.new("~/.gem/nexus").expand_path.exist?
sh("gem nexus '#{path}'")
Bundler.ui.confirm "Pushed #{name} #{version} to https://<your-url-here>/."
else
raise "Your Nexus credentials aren't set. Run `gem nexus #{path}` to push your gem and set credentials."
end
end
end
end
The above is for Nexus instead of Geminabox, but the concept should apply to either.
As far as omitting it from git, I'm afraid we're out of luck. However, you can share this appropriately between projects so it will only have to be checked into one place rather than many. Hope this helps!
这篇关于Bundler用geminabox发行的佣金释放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!