lib/io_streams/utils.rb in iostreams-1.1.0 vs lib/io_streams/utils.rb in iostreams-1.1.1
- old
+ new
@@ -1,6 +1,6 @@
-require 'uri'
+require "uri"
module IOStreams
module Utils
MAX_TEMP_FILE_NAME_ATTEMPTS = 5
# Lazy load dependent gem so that it remains a soft dependency.
@@ -22,11 +22,11 @@
end
# Yields the path to a temporary file_name.
#
# File is deleted upon completion if present.
- def self.temp_file_name(basename, extension = '')
+ def self.temp_file_name(basename, extension = "")
result = nil
::Dir::Tmpname.create([basename, extension], IOStreams.temp_dir, max_try: MAX_TEMP_FILE_NAME_ATTEMPTS) do |tmpname|
begin
result = yield(tmpname)
ensure
@@ -38,10 +38,10 @@
class URI
attr_reader :scheme, :hostname, :path, :user, :password, :port, :query
def initialize(url)
- url = url.gsub(' ', '%20')
+ url = url.gsub(" ", "%20")
uri = ::URI.parse(url)
@scheme = uri.scheme
@hostname = uri.hostname
@path = CGI.unescape(uri.path)
@user = uri.user