Refactor FileHelper to use keyword arguments.

This commit is contained in:
Robin Ward
2017-05-24 13:42:52 -04:00
parent 87ac758f05
commit cdbe027c1c
12 changed files with 81 additions and 15 deletions

View File

@ -7,7 +7,7 @@ class FileHelper
filename =~ images_regexp
end
def self.download(url, max_file_size, tmp_file_name, follow_redirect=false, read_timeout=5)
def self.download(url, max_file_size:, tmp_file_name:, follow_redirect: false, read_timeout: 5)
url = "https:" + url if url.start_with?("//")
raise Discourse::InvalidParameters.new(:url) unless url =~ /^https?:\/\//