Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn if bundler version older than in lockfile #8

Open
wants to merge 34 commits into
base: 2-0-dev
Choose a base branch
from

Conversation

jhhere
Copy link

@jhhere jhhere commented Oct 1, 2013

rubygems/bundler-features#17

indirect: This probably requires adding the version of Bundler that generated the lockfile to the lockfile. Since that is a change to the format of the lockfile, this change can't happen until 2.0. That said, I think that this is really important to do for 2.0, especially so that we can ask people to upgrade their old Bundler versions.

Goes on the 2-0-dev branch

@indirect
Copy link

indirect commented Oct 1, 2013

looking good! Next you probably need to add the Bundler version (Bundler::VERSION) and then add some code to LockfileParser that knows how to read in the Bundler version. Last, during install, check the version that the LockfileParser knows about, and print a warning if it is newer than the version of Bundler that is doing the installing.

@jlsuttles
Copy link
Member

@indirect created a new branch and added changes https://github.com/RGSoCBundler/bundler/compare/warn-outdated

jhhere and others added 24 commits October 4, 2013 17:18
…t Bundler version that is doing the bundle installing
…r directory - /Users/joyce/ror/rails/bundler/bundler/tmp/bundled_app/Gemfile.lock (Errno::ENOENT)
the old code was just using the version of Bundler that was running,
not actually reading the version of Bundler that was in the lockfile.
we actually want to warn people that they should upgrade, not force them
to always have to upgrade if they want to install.
it's not actually a list of locked gems, it's the LockfileParser that
has parsed the current lock. so let's just call it a lock.
we already have a LockfileParser in Bundler.lock, so we can just use
that one to get the locking Bundler version, instead of writing a new
method that just gets us the Bundler version.
running the installer will write out a new lock file, because that
is what installing does. so we save the bundler version before the
installer runs, so we can check it later to print a warning about
being out of date.
@jlsuttles
Copy link
Member

6:39 Jessica Suttles lots of failing specs though since bundler version is in lockfile now
6:40 André Arko wait really
6:40 André Arko oh right
6:40 André Arko the lockfile matcher
6:40 André Arko you could tweak the lockfile_should_be() method to ignore the ending lines?
6:40 André Arko instead of doing an exact match?
6:40 Jessica Suttles seems good
6:40 André Arko or you could have the lockfile_should_be() method add a BUNDLER section if there isn't one in the expected lockfile
6:40 André Arko not sure which one is more magic and scary

lockfile_should_be() is in spec/support/matchers.rb

@jhhere
Copy link
Author

jhhere commented Oct 10, 2013

@jlsuttles @indirect I added the BUNDLER section to the lockfile_should_be(). I'm down to 3 failing specs on my machine (2, 3, 5 on TravisCI). I think 2,3 doesn't work now...because the matcher is not_to change but I added BUNDLER?

@indirect
Copy link

Your persistence is to be commended 🎉, and I will review this very soon, I swear. :P

end

if !options[:all] && gems.empty? && sources.empty?
return Bundler.ui.info("Are you sure you want to update every single gem in your bundle?!\n\nIf yes, run bundle update --all.\nIf you want to update an individual gem, run bundle update <gem_name>.\nIf not, have a good day!")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these lines need to come back for bundle update to keep working

@jhhere
Copy link
Author

jhhere commented Nov 7, 2013

@indirect ahh this is still open, and growing stale. I haven't gotten to it.

@jhhere
Copy link
Author

jhhere commented Feb 27, 2014

at least it doesn't get moldy 🌾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants