rubocop: fix various style issues.

This commit is contained in:
evazion
2019-12-22 16:21:58 -06:00
parent 09f6a84660
commit 309821bf73
288 changed files with 912 additions and 962 deletions

View File

@@ -3,7 +3,7 @@ require 'resolv'
module Downloads
class File
include ActiveModel::Validations
class Error < Exception ; end
class Error < Exception; end
RETRIABLE_ERRORS = [Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::EIO, Errno::EHOSTUNREACH, Errno::ECONNREFUSED, Timeout::Error, IOError]
@@ -12,7 +12,7 @@ module Downloads
validate :validate_url
def initialize(url, referer=nil)
def initialize(url, referer = nil)
@url = Addressable::URI.parse(url) rescue nil
@referer = referer
validate!
@@ -59,7 +59,7 @@ module Downloads
else
raise Error.new("HTTP error code: #{res.code} #{res.message}")
end
end # def
end
# Prevent Cloudflare from potentially mangling the image. See issue #3528.
def uncached_url
@@ -87,7 +87,7 @@ module Downloads
timeout: 10,
stream_body: true,
headers: strategy.headers,
connection_adapter: ValidatingConnectionAdapter,
connection_adapter: ValidatingConnectionAdapter
}.deep_merge(Danbooru.config.httparty_options)
end