summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Lance <stefan@lances.net>2015-06-28 10:53:06 -0400
committerSamuel Giddins <segiddins@segiddins.me>2016-07-05 15:11:19 -0300
commitc9960af024a6a4b0cd6bcd5ef3e4120b7f9a4a90 (patch)
treefdd2820eb04d1d0995fe356b8f625aa995cfc16a
parent91c28aa1b62a9c71f07ef51152957fac099b9f63 (diff)
downloadbundler-c9960af024a6a4b0cd6bcd5ef3e4120b7f9a4a90.tar.gz
Change `given_flags?` to `options_given?`
-rw-r--r--lib/bundler/cli.rb2
-rw-r--r--lib/bundler/settings.rb2
-rw-r--r--spec/deprecation_spec.rb11
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"