Is possible have a git branch dependency, inside mygem.gemspec?
I\'m thinking something similar to the following:
gem.add_runtime_dependency \'oauth2
I just was trying to figure this problem out as well. And I just came up with the following solution (which I'm not sure if your publishing your gem or have rights to redistribute that oauth2 gem).
In your gem that requires oauth2 gem run this.
git submodule add git@github.com:lgs/oauth2.git lib/oauth2
If you require a different branch than the default
cd lib/oauth2 && git checkout
cd .. && git add lib/oauth2
git commit -m "adding outh2 submodule"
In your gemspec add this above your require version line
$:.push File.expand_path('../lib/oauth2/lib', __FILE__)
Also you'll need to add all of the oauth2 gem's runtime dependencies to your gemspec. I haven't figured out a way around this yet.
This is what I did, and it works for us because our gem is required via git so I'm not sure if this would work for a rubygems published gem.