Forum: Ruby [Bundler] Using a Git repository as ruby gem server

3f524a8aa88a0610561f622463d3b91b?d=identicon&s=25 Manfred Ruhl (manfred_ruhl)
on 2017-03-29 09:52
Hello everyone!

As surely everyone knows, one can specify a Git repository in the
Gemfile as a gem source, like

gem 'mygem', :git =>'

However, this doesn't fully accomplish my needs. Imagine my repository
has some tagged commits, like "1.1.0", "1.1.1", "1.2.0" etc. If I
specify a dependency on "mygem" with a version requirement of, say, "~>
1.1.0, <= 1.2.0", how can I pull the commit with the best-matching
version number? Right now, it would only check out one particular commit
(HEAD on master branch), scanning its gemspec and either deliver it if
it doesn't contradict the requirements or returns an error if it does,
rather than searching through all commits for the best fit. Is there any
way I can do that? I really would not like to use an additional gem
server besides my Git repository.

Kind regards,
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.