thought-driven / bummr

Update your gems in separate commits. Identify any that fail your build.
MIT License
234 stars 23 forks source link

Gem does not get updated if current version has more than 3 digits #15

Closed monfresh closed 8 years ago

monfresh commented 8 years ago

For example, I had Rails 4.2.5.1, but it did not get updated to 4.2.6:

rails not updated from 4.2.5.1, requested ~> 4.2.0 to latest: 4.2.6
monfresh commented 8 years ago

Output from bundle outdated:

* rails (newest 4.2.6, installed 4.2.5.1, requested ~> 4.2.0) in group "default"
lpender commented 8 years ago

I'm not sure why this would be, I don't think it has to do with the 4 digits.

The command I'm running behind the scenes is:

bundle update --source rails

monfresh commented 8 years ago

I'm pretty sure it was the regex that was an issue. If you enter the old regex in rubular.com:

 \* (.*) \(newest (\d.*\d), installed (\d.*\d)[\),\s]

and test against this string:

* rails (newest 4.2.6, installed 4.2.5.1, requested ~> 4.2.0) in group "default"

it won't find any matches

monfresh commented 8 years ago

Same with the latest regex

monfresh commented 8 years ago

My bad. I had an extra space at the beginning. Seems like rubular.com doesn't like that. Is the leading space necessary in the gem?

monfresh commented 8 years ago

also, bundle update rails worked for me. I didn't try with the --source flag.

lpender commented 8 years ago

Here's my inspiration for using the --source flag.

http://ilikestuffblog.com/2012/07/01/you-should-update-one-gem-at-a-time-with-bundler-heres-how/

It doesn't appear to be very well understood, but it seems to use a more conservative update strategy.

I'm open to removing the flag

monfresh commented 8 years ago

Hmm. From the documentation, I don't see how it's more conservative. It seems to only apply when you have a git or path source specified in the gemfile. But even then, I've always used bundle update without any flags, and the git or path sources were always updated.

I can try to reproduce again to see if it's the source flag that's causing the issue.

lpender commented 8 years ago

Read the article as well as the documentation.

monfresh commented 8 years ago

I read the article, but I'm not convinced. It's 4 years old. A lot could have changed since then. From reading the Bundler specs, it doesn't look the source option does anything special besides using the source specified in the Gemfile:

https://github.com/bundler/bundler/blob/dfdeb0f89e7e88fcdfd001da089f09af3a77d2b4/spec/update/path_spec.rb

https://github.com/bundler/bundler/blob/dfdeb0f89e7e88fcdfd001da089f09af3a77d2b4/spec/update/git_spec.rb#L40-L57

lpender commented 8 years ago

https://github.com/lpender/bummr/pull/27

lpender commented 8 years ago

@monfresh I removed the --source flag in 0.1.3