summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Metcalfe <git@patrickmetcalfe.com>2015-04-22 20:48:12 -0500
committerPatrick Metcalfe <git@patrickmetcalfe.com>2015-04-22 20:48:12 -0500
commitafbad470462b0878ea2cd2ee42cbec1121c288a5 (patch)
treeb8714ed1a398661d38b4fc3d96cd3f6efd04d7aa
parent83782981216ccc4f9143ec7e518687c54bc29307 (diff)
downloadbundler-afbad470462b0878ea2cd2ee42cbec1121c288a5.tar.gz
use default settings instead
-rw-r--r--lib/bundler/cli.rb2
-rw-r--r--lib/bundler/fetcher.rb6
-rw-r--r--spec/bundler/settings_spec.rb4
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 9b09946234..50133d2978 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -20,7 +20,7 @@ module Bundler
current_cmd = args.last[:current_command].name
custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
ENV['BUNDLE_GEMFILE'] = File.expand_path(custom_gemfile) if custom_gemfile
- Bundler::Retry.attempts = options[:retry] || Bundler.settings[:retry] || Bundler::Retry::DEFAULT_ATTEMPTS
+ Bundler.settings[:retry] = options[:retry] if options[:retry]
Bundler.rubygems.ui = UI::RGProxy.new(Bundler.ui)
auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
rescue UnknownArgumentError => e
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index b29e8dfb8a..42c6eb6717 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -58,9 +58,9 @@ module Bundler
attr_accessor :disable_endpoint, :api_timeout, :redirect_limit, :max_retries
end
- self.redirect_limit = 5 # How many redirects to allow in one request
- self.api_timeout = 10 # How long to wait for each API call
- self.max_retries = 3 # How many retries for the API call
+ self.redirect_limit = Bundler.settings[:redirect] # How many redirects to allow in one request
+ self.api_timeout = Bundler.settings[:timeout] # How long to wait for each API call
+ self.max_retries = Bundler.settings[:retry] # How many retries for the API call
def initialize(remote)
@remote = remote
diff --git a/spec/bundler/settings_spec.rb b/spec/bundler/settings_spec.rb
index 9f9e3e7626..e1dd61bead 100644
--- a/spec/bundler/settings_spec.rb
+++ b/spec/bundler/settings_spec.rb
@@ -19,12 +19,12 @@ describe Bundler::Settings do
context "when not set" do
context "when default value present" do
it "retrieves value" do
- expect(Bundler.settings[:retry]).to be 3
+ expect(settings[:retry]).to be 3
end
end
it "returns nil" do
- expect(Bundler.settings[:buttermilk]).to be nil
+ expect(settings[:buttermilk]).to be nil
end
end
end