-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: 2-0-dev
Are you sure you want to change the base?
Changes from all commits
e4181c9
d1db691
acf250d
d523de5
2008cc2
b390d4b
b6fa002
518ab34
a940844
7b27bfa
e41ca07
28be5bc
916e7e8
c068c86
8c92027
cdd978b
4176b2b
ffaa321
d31ea37
779b9fd
4ffaba4
41e02ab
7509d31
615450b
fc976f0
5341c85
f09bf73
fe94b13
9ba0128
fd1d799
ba0103c
27eea6f
0b1932c
2d115e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -300,6 +300,10 @@ def to_lock | |
handled << dep.name | ||
end | ||
|
||
out << "\n" | ||
out << "BUNDLER\n" | ||
out << " #{Bundler::VERSION}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. after thinking about this a bit more, I think this should be |
||
|
||
out | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ module Bundler | |
# We're doing this because we might write tests that deal | ||
# with other versions of bundler and we are unsure how to | ||
# handle this better. | ||
VERSION = "1.4.0.rc.1" unless defined?(::Bundler::VERSION) | ||
VERSION = "1.4.0.rc.1" unless defined?(Bundler::VERSION) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please keep the :: on, I remember there was a bug at some point that meant this only worked with it |
||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
let(:bundle_show_message) {"Use `bundle show [gemname]` to see where a bundled gem is installed."} | ||
let(:bundle_deployment_message) {"It was installed into ./vendor"} | ||
let(:bundle_complete_message) {"Your bundle is complete!"} | ||
let(:bundle_updated_message) {"Your bundle is updated!"} | ||
let(:bundle_updated_message) {"Run `bundle update GEM` to update a specific gem. Run `bundle update --force` if you really want to update all gems."} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of changing the message you should be able to change all three |
||
|
||
describe "for fresh bundle install" do | ||
it "without any options" do | ||
|
@@ -120,22 +120,22 @@ | |
|
||
it "with --without one group" do | ||
bundle :install, :without => :emo | ||
bundle :update | ||
expect(out).to include("Gems in the group emo were not installed") | ||
bundle :update | ||
expect(out).to include(bundle_updated_message) | ||
end | ||
|
||
it "with --without two groups" do | ||
bundle "install --without emo test" | ||
bundle :update | ||
expect(out).to include("Gems in the groups emo and test were not installed") | ||
bundle :update | ||
expect(out).to include(bundle_updated_message) | ||
end | ||
|
||
it "with --without more groups" do | ||
bundle "install --without emo obama test" | ||
bundle :update | ||
expect(out).to include("Gems in the groups emo, obama and test were not installed") | ||
bundle :update | ||
expect(out).to include(bundle_updated_message) | ||
end | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -761,6 +761,9 @@ | |
|
||
DEPENDENCIES | ||
omg! | ||
|
||
BUNDLER | ||
#{Bundler::VERSION} | ||
L | ||
end | ||
|
||
|
@@ -775,17 +778,19 @@ def set_lockfile_mtime_to_known_value | |
source "file://#{gem_repo2}" | ||
gem "rack" | ||
G | ||
set_lockfile_mtime_to_known_value | ||
#set_lockfile_mtime_to_known_value | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if this can be commented out then just delete it I think |
||
end | ||
|
||
it "generates Gemfile.lock with \\n line endings" do | ||
set_lockfile_mtime_to_known_value | ||
expect(File.read(bundled_app("Gemfile.lock"))).not_to match("\r\n") | ||
should_be_installed "rack 1.0" | ||
end | ||
|
||
context "during updates" do | ||
|
||
it "preserves Gemfile.lock \\n line endings" do | ||
set_lockfile_mtime_to_known_value | ||
update_repo2 | ||
|
||
expect { bundle "update --force" }.to change { File.mtime(bundled_app('Gemfile.lock')) } | ||
|
@@ -794,6 +799,7 @@ def set_lockfile_mtime_to_known_value | |
end | ||
|
||
it "preserves Gemfile.lock \\n\\r line endings" do | ||
set_lockfile_mtime_to_known_value | ||
update_repo2 | ||
win_lock = File.read(bundled_app("Gemfile.lock")).gsub(/\n/, "\r\n") | ||
File.open(bundled_app("Gemfile.lock"), "wb"){|f| f.puts(win_lock) } | ||
|
@@ -808,6 +814,7 @@ def set_lockfile_mtime_to_known_value | |
context "when nothing changes" do | ||
|
||
it "preserves Gemfile.lock \\n line endings" do | ||
File.mtime(bundled_app('Gemfile.lock')) | ||
expect { ruby <<-RUBY | ||
require 'rubygems' | ||
require 'bundler' | ||
|
@@ -817,9 +824,9 @@ def set_lockfile_mtime_to_known_value | |
end | ||
|
||
it "preserves Gemfile.lock \\n\\r line endings" do | ||
mtime = File.mtime(bundled_app('Gemfile.lock')) | ||
win_lock = File.read(bundled_app("Gemfile.lock")).gsub(/\n/, "\r\n") | ||
File.open(bundled_app("Gemfile.lock"), "wb"){|f| f.puts(win_lock) } | ||
set_lockfile_mtime_to_known_value | ||
|
||
expect { ruby <<-RUBY | ||
require 'rubygems' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
require "spec_helper" | ||
|
||
describe "lockfile" do | ||
include Bundler::GemHelpers | ||
|
||
it "prints out the Bundler version that generated the lockfile" do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this test should be in the file |
||
|
||
install_gemfile <<-G | ||
source "file://#{gem_repo1}" | ||
|
||
gem "rails" | ||
G | ||
|
||
lockfile_should_be <<-G | ||
GEM | ||
remote: file:#{gem_repo1}/ | ||
specs: | ||
actionmailer (2.3.2) | ||
activesupport (= 2.3.2) | ||
actionpack (2.3.2) | ||
activesupport (= 2.3.2) | ||
activerecord (2.3.2) | ||
activesupport (= 2.3.2) | ||
activeresource (2.3.2) | ||
activesupport (= 2.3.2) | ||
activesupport (2.3.2) | ||
rails (2.3.2) | ||
actionmailer (= 2.3.2) | ||
actionpack (= 2.3.2) | ||
activerecord (= 2.3.2) | ||
activeresource (= 2.3.2) | ||
rake (= 10.0.2) | ||
rake (10.0.2) | ||
|
||
PLATFORMS | ||
#{generic(Gem::Platform.local)} | ||
|
||
DEPENDENCIES | ||
rails | ||
|
||
BUNDLER | ||
#{Bundler::VERSION} | ||
G | ||
|
||
end | ||
|
||
it "warns if the bundler version is older than the version that created" do | ||
gemfile <<-G | ||
source "file://#{gem_repo1}" | ||
|
||
gem "rails" | ||
G | ||
|
||
lockfile <<-L | ||
GEM | ||
remote: file:#{gem_repo1}/ | ||
specs: | ||
actionmailer (2.3.2) | ||
activesupport (= 2.3.2) | ||
actionpack (2.3.2) | ||
activesupport (= 2.3.2) | ||
activerecord (2.3.2) | ||
activesupport (= 2.3.2) | ||
activeresource (2.3.2) | ||
activesupport (= 2.3.2) | ||
activesupport (2.3.2) | ||
rails (2.3.2) | ||
actionmailer (= 2.3.2) | ||
actionpack (= 2.3.2) | ||
activerecord (= 2.3.2) | ||
activeresource (= 2.3.2) | ||
rake (= 10.0.2) | ||
rake (10.0.2) | ||
|
||
PLATFORMS | ||
#{generic(Gem::Platform.local)} | ||
|
||
DEPENDENCIES | ||
rails | ||
|
||
BUNDLER | ||
100.1 | ||
L | ||
|
||
bundle :install | ||
expect(out).to include("You're using an older version of Bundler (#{ | ||
Bundler::VERSION}) than the one specified in your Gemfile (100.1)") | ||
end | ||
|
||
end |
There was a problem hiding this comment.
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