summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Lance <stefan@lances.net>2015-06-28 10:53:06 -0400
committerSamuel E. Giddins <segiddins@segiddins.me>2015-07-16 08:35:42 -0700
commit4fbb9fbc328b1e57564d09d562381321d6c0ca25 (patch)
treeb1ae398dbcc0661c36d3f1349cc2b609c7c65914
parentf806564a9d5752044fa7f89b33d1ea386d01c9dc (diff)
downloadbundler-4fbb9fbc328b1e57564d09d562381321d6c0ca25.tar.gz
Change `given_flags?` to `options_given?`
-rw-r--r--lib/bundler/cli.rb5
-rw-r--r--lib/bundler/settings.rb2
-rw-r--r--spec/deprecation_spec.rb13
3 files changed, 16 insertions, 4 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index d20b121a7e..d889c32bf4 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -15,6 +15,7 @@ module Bundler
def initialize(*args)
super
+
custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
ENV["BUNDLE_GEMFILE"] = File.expand_path(custom_gemfile) if custom_gemfile
@@ -26,7 +27,7 @@ module Bundler
raise InvalidOption, e.message
ensure
self.options ||= {}
- Bundler.settings[:given_flags] = given_flags?
+ Bundler.settings[:options_given] = options_given?
Bundler.ui = UI::Shell.new(options)
Bundler.ui.level = "debug" if options["verbose"]
end
@@ -409,7 +410,7 @@ module Bundler
private
- def given_flags?
+ def options_given?
!self.options.empty?
end
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 61515a1787..652578a84a 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -27,7 +27,7 @@ module Bundler
end
def []=(key, value)
- if self[:given_flags]
+ if self[:options_given]
Bundler.ui.deprecate "Starting in Bundler 2.0, flags passed to commands "\
"will no longer be automatically remembered. Instead please set flags " \
"you want remembered between commands using `bundle config "\
diff --git a/spec/deprecation_spec.rb b/spec/deprecation_spec.rb
index 7ef0351b59..48cec3ae04 100644
--- a/spec/deprecation_spec.rb
+++ b/spec/deprecation_spec.rb
@@ -12,7 +12,18 @@ describe "Bundler version 1.99" do
expect(err).to lack_errors
end
- context "with flags" do
+ 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"
source "file://#{gem_repo1}"