Ruby Gemspec 依赖:是否可能有 git 分支依赖? [英] Ruby Gemspec Dependency: Is possible have a git branch dependency?

查看:20
本文介绍了Ruby Gemspec 依赖:是否可能有 git 分支依赖?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可能在 mygem.gemspec 中有一个 git 分支依赖项?

Is possible have a git branch dependency, inside mygem.gemspec?

我正在考虑类似于以下内容:

I'm thinking something similar to the following:

gem.add_runtime_dependency 'oauth2', :git => 'git@github.com:lgs/oauth2.git'

...但它不起作用.

推荐答案

这是不可能的,而且很可能永远不会,因为 RubyGems 允许 gem 开发人员要求用户有特定的版本控制是相当严厉的安装系统以访问 gem.Gems 应该是独立的,具有最少数量的依赖项,以便人们可以在尽可能广泛的应用程序中使用它们.

This is not possible, and likely never will be because it would be rather heavy-handed for RubyGems to allow gem developers to require that users have a specific version control system installed to access a gem. Gems should be self-contained with a minimal number of dependencies so that people can use them in as wide an array of application as possible.

如果您想为自己的内部项目执行此操作,我的建议是使用 Bundler 非常支持好吧.

If you want to do this for your own internal projects, my suggestion would be to use Bundler which supports this quite well.

这篇关于Ruby Gemspec 依赖:是否可能有 git 分支依赖?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆