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

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

问题描述



我在想类似以下内容:
$
可能有一个git分支依赖项, b $ b

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

...但它没有工作。 解决方案

这是不可能的,而且可能永远不会,因为RubyGems允许gem开发人员要求用户安装特定的版本控制系统才能访问gem。宝石应该是自包含的,只有少量的依赖关系,这样人们可以在尽可能广泛的应用程序中使用它们。



如果你想这样做你自己的内部项目,我的建议是使用 Bundler ,它支持这一点。


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'

... but it doesn't work.

解决方案

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.

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天全站免登陆