summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRose Weixel <rose.weixel@gmail.com>2015-07-26 19:53:49 -0400
committerRose Weixel <rose.weixel@gmail.com>2015-07-26 19:53:49 -0400
commited59ad7dc25c5848550b0d5118a58501035d8abe (patch)
tree1e806ae7c7419c18f5f15be721b8dba7982d44d5
parent52f01da3ed19a59dfb4bc6e338bb34ad7984ade7 (diff)
downloadbundler-ed59ad7dc25c5848550b0d5118a58501035d8abe.tar.gz
push logic for dealing with string 'false' down to Settings class
-rw-r--r--lib/bundler/cli/gem.rb8
-rw-r--r--lib/bundler/settings.rb6
2 files changed, 5 insertions, 9 deletions
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb
index 5a180a029d..cef64f27a8 100644
--- a/lib/bundler/cli/gem.rb
+++ b/lib/bundler/cli/gem.rb
@@ -162,14 +162,8 @@ module Bundler
exit 1
end
- def sanitized_test_framework
- test_framework = options[:test] || Bundler.settings["gem.test"]
-
- test_framework == "false" ? false : test_framework
- end
-
def ask_and_set_test_framework
- test_framework = sanitized_test_framework
+ test_framework = options[:test] || Bundler.settings["gem.test"]
if test_framework.nil?
Bundler.ui.confirm "Do you want to generate tests with your gem?"
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index c675089a5a..4ce1ecc996 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -17,9 +17,11 @@ module Bundler
value = (@local_config[key] || ENV[key] || @global_config[key] || DEFAULT_CONFIG[name])
case
- when !value.nil? && is_bool(name)
+ when value.nil?
+ nil
+ when is_bool(name) || value == "false"
to_bool(value)
- when !value.nil? && is_num(name)
+ when is_num(name)
value.to_i
else
value