diff options
author | Andre Arko <andre@arko.net> | 2015-05-05 14:42:41 -0700 |
---|---|---|
committer | Samuel E. Giddins <segiddins@segiddins.me> | 2015-07-16 08:32:46 -0700 |
commit | 43c1e1eeae52c2ab739a2898e506bf98b561ca9b (patch) | |
tree | 80cc92fa630b4b8e69f252f90a69b376e0cc2e67 | |
parent | 18632ebd3dd7f8726843f83465af41dcb8a782b2 (diff) | |
download | bundler-43c1e1eeae52c2ab739a2898e506bf98b561ca9b.tar.gz |
do not deprecate gems.rb, lol
-rw-r--r-- | lib/bundler/shared_helpers.rb | 14 | ||||
-rw-r--r-- | spec/deprecation_spec.rb | 15 |
2 files changed, 23 insertions, 6 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index e06881494b..87a0205299 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -20,10 +20,8 @@ module Bundler attr_accessor :gem_loaded def default_gemfile - Bundler.ui.deprecate("Gemfile and Gemfile.lock are " \ - "deprecated and will be replaced with gems.rb and " \ - "gems.locked in Bundler 2.0.0.\n") gemfile = find_gemfile + deprecate_gemfile(gemfile) raise GemfileNotFound, "Could not locate Gemfile" unless gemfile Pathname.new(gemfile) end @@ -149,6 +147,16 @@ module Bundler end end + def deprecate_gemfile(gemfile) + if gemfile && File.basename(gemfile) == "Gemfile" + Bundler.respond_to?(:ui) && Bundler.ui.deprecate( + "Gemfile and Gemfile.lock are " \ + "deprecated and will be replaced with gems.rb and " \ + "gems.locked in Bundler 2.0.\n" + ) + end + end + extend self end end diff --git a/spec/deprecation_spec.rb b/spec/deprecation_spec.rb index d7df05bb43..19c6514235 100644 --- a/spec/deprecation_spec.rb +++ b/spec/deprecation_spec.rb @@ -3,7 +3,6 @@ require "spec_helper" describe "Bundler version 1.99" do context "when bundle is run" do it "should print a single deprecation warning" do - # install_gemfile calls `bundle :install, opts` install_gemfile <<-G source "file://#{gem_repo1}" gem "rack" @@ -11,7 +10,17 @@ describe "Bundler version 1.99" do expect(err).to eq("DEPRECATION: Gemfile and Gemfile.lock are " \ "deprecated and will be replaced with gems.rb and gems.locked in " \ - "Bundler 2.0.0.") + "Bundler 2.0.") + end + + it "should not warn about gems.rb" do + create_file "gems.rb", <<-G + source "file://#{gem_repo1}" + gem "rack" + G + + bundle :install + expect(err).to lack_errors end end @@ -34,7 +43,7 @@ describe "Bundler version 1.99" do expect(err).to eq("DEPRECATION: Gemfile and Gemfile.lock are " \ "deprecated and will be replaced with gems.rb and gems.locked in " \ - "Bundler 2.0.0.") + "Bundler 2.0.") end end |