Ruby Gemspec Dependency: Is possible have a git branch dependency?

前端 未结 4 1610
慢半拍i
慢半拍i 2020-12-08 03:51

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

I\'m thinking something similar to the following:

gem.add_runtime_dependency \'oauth2         


        
4条回答
  •  醉梦人生
    2020-12-08 04:45

    I found a work-around pretty straight forward:

    Say your are in a project P and you want to use the self made gem tools which itself uses an OS gem oauth2.

    If you made a patch within oauth2 and need that patch in your gem tools, you won't be able to fix this issue in the gem according to the accepted answer.

    However, you can speficy the version you want within your projet P's Gemfile, and this will be the version used by tools on runtime:

    gem 'oauth2', github: 'lgs/oauth2'
    

    Here is a real life example of mine.

提交回复
热议问题