lib/bundler/definition.rb in bundler-1.10.0.pre vs lib/bundler/definition.rb in bundler-1.10.0.pre.1

- old
+ new

@@ -247,9 +247,19 @@ if Bundler.settings[:frozen] Bundler.ui.error "Cannot write a changed lockfile while frozen." return end + if @locked_bundler_version + locked_major = @locked_bundler_version.segments.first + current_major = Gem::Version.create(Bundler::VERSION).segments.first + + if locked_major < current_major + Bundler.ui.warn "Warning: the lockfile is being updated to Bundler #{Bundler::VERSION.split('.').first}, " \ + "after which you will be unable to return to Bundler #{@locked_bundler_version.segments.first}." + end + end + File.open(file, 'wb'){|f| f.puts(contents) } rescue Errno::EACCES raise Bundler::InstallError, "There was an error while trying to write to Gemfile.lock. It is likely that \n" \ "you need to allow write permissions for the file at path: \n" \