summaryrefslogtreecommitdiff
path: root/lib/bundler/fetcher.rb
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-01-14 16:34:08 -0600
committerSamuel Giddins <segiddins@segiddins.me>2016-01-31 22:21:13 -0600
commitb1afbe3a2ff7623c9a0e8504bc85af4bd8156059 (patch)
tree832de2112b4c7a44d081302eec030c74448c3712 /lib/bundler/fetcher.rb
parent8b64c9785abfcdafe1e8420f61d51e924ba434a1 (diff)
downloadbundler-b1afbe3a2ff7623c9a0e8504bc85af4bd8156059.tar.gz
[RuboCop] Fix Style/MutableConstant
Diffstat (limited to 'lib/bundler/fetcher.rb')
-rw-r--r--lib/bundler/fetcher.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index 8c9da09684..63f61070e3 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -53,13 +53,13 @@ module Bundler
# Exceptions classes that should bypass retry attempts. If your password didn't work the
# first time, it's not going to the third time.
- FAIL_ERRORS = [AuthenticationRequiredError, BadAuthenticationError, FallbackError]
+ FAIL_ERRORS = [AuthenticationRequiredError, BadAuthenticationError, FallbackError].freeze
NET_ERRORS = [:HTTPBadGateway, :HTTPBadRequest, :HTTPFailedDependency,
:HTTPForbidden, :HTTPInsufficientStorage, :HTTPMethodNotAllowed,
:HTTPMovedPermanently, :HTTPNoContent, :HTTPNotFound,
:HTTPNotImplemented, :HTTPPreconditionFailed, :HTTPRequestEntityTooLarge,
:HTTPRequestURITooLong, :HTTPUnauthorized, :HTTPUnprocessableEntity,
- :HTTPUnsupportedMediaType, :HTTPVersionNotSupported]
+ :HTTPUnsupportedMediaType, :HTTPVersionNotSupported].freeze
FAIL_ERRORS << Gem::Requirement::BadRequirementError if defined?(Gem::Requirement::BadRequirementError)
FAIL_ERRORS.push(*NET_ERRORS.map {|e| SharedHelpers.const_get_safely(e, Net) }.compact)
@@ -150,10 +150,10 @@ module Bundler
fetchers.shift until fetchers.first.available?
- if remote_uri.scheme == "file" || Bundler::Fetcher.disable_endpoint
- @use_api = false
+ @use_api = if remote_uri.scheme == "file" || Bundler::Fetcher.disable_endpoint
+ false
else
- @use_api = fetchers.first.api_fetcher?
+ fetchers.first.api_fetcher?
end
end
@@ -207,7 +207,7 @@ module Bundler
private
- FETCHERS = [CompactIndex, Dependency, Index]
+ FETCHERS = [CompactIndex, Dependency, Index].freeze
def cis
env_cis = {
@@ -267,7 +267,7 @@ module Bundler
Errno::EINVAL, Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::EAGAIN,
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
Net::HTTP::Persistent::Error, Zlib::BufError
- ]
+ ].freeze
def bundler_cert_store
store = OpenSSL::X509::Store.new