From c9960af024a6a4b0cd6bcd5ef3e4120b7f9a4a90 Mon Sep 17 00:00:00 2001 From: Stefan Lance Date: Sun, 28 Jun 2015 10:53:06 -0400 Subject: Change `given_flags?` to `options_given?` --- lib/bundler/cli.rb | 2 +- lib/bundler/settings.rb | 2 +- spec/deprecation_spec.rb | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 5c3e10177b..fd3401eaf9 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -31,7 +31,7 @@ module Bundler raise InvalidOption, e.message ensure self.options ||= {} - Bundler.settings[:given_flags] = !options.empty? + Bundler.settings[:options_given] = !options.empty? Bundler.ui = UI::Shell.new(options) Bundler.ui.level = "debug" if options["verbose"] diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 8507182a60..8587eb3e8a 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -54,7 +54,7 @@ module Bundler end def []=(key, value) - if self[:given_flags] + if self[:options_given] Bundler::SharedHelpers.major_deprecation \ "Starting in Bundler 2.0, flags passed to commands "\ "will no longer be automatically remembered. Instead please set flags " \ diff --git a/spec/deprecation_spec.rb b/spec/deprecation_spec.rb index 0b6cdde085..25bc348563 100644 --- a/spec/deprecation_spec.rb +++ b/spec/deprecation_spec.rb @@ -13,6 +13,17 @@ describe "Bundler version 1.99" do expect(err).to lack_errors end + it "should print a Gemfile deprecation warning" do + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "rack" + G + + expect(err).to include("DEPRECATION: Gemfile and Gemfile.lock are " \ + "deprecated and will be replaced with gems.rb and gems.locked in " \ + "Bundler 2.0.") + end + context "with flags" do it "should print a deprecation warning about autoremembering flags" do install_gemfile <<-G, :path => "vendor/bundle" -- cgit v1.2.1