Skip to content

Commit 328d28d

Browse files
authored
Merge pull request #144 from technicalpickles/frozen-string-literal
Use frozen string literals
2 parents 3473e27 + 4a22c42 commit 328d28d

File tree

10 files changed

+16
-16
lines changed

10 files changed

+16
-16
lines changed

lib/net/http.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# frozen_string_literal: false
1+
# frozen_string_literal: true
22
#
33
# = net/http.rb
44
#
@@ -1615,8 +1615,8 @@ def connect
16151615
write_timeout: @write_timeout,
16161616
continue_timeout: @continue_timeout,
16171617
debug_output: @debug_output)
1618-
buf = "CONNECT #{conn_address}:#{@port} HTTP/#{HTTPVersion}\r\n"
1619-
buf << "Host: #{@address}:#{@port}\r\n"
1618+
buf = +"CONNECT #{conn_address}:#{@port} HTTP/#{HTTPVersion}\r\n" \
1619+
"Host: #{@address}:#{@port}\r\n"
16201620
if proxy_user
16211621
credential = ["#{proxy_user}:#{proxy_pass}"].pack('m0')
16221622
buf << "Proxy-Authorization: Basic #{credential}\r\n"

lib/net/http/backward.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# frozen_string_literal: false
1+
# frozen_string_literal: true
22
# for backward compatibility
33

44
# :enddoc:

lib/net/http/exceptions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# frozen_string_literal: false
1+
# frozen_string_literal: true
22
module Net
33
# Net::HTTP exception class.
44
# You cannot use Net::HTTPExceptions directly; instead, you must use

lib/net/http/generic_request.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# frozen_string_literal: false
1+
# frozen_string_literal: true
22
#
33
# \HTTPGenericRequest is the parent of the Net::HTTPRequest class.
44
#
@@ -316,7 +316,7 @@ def encode_multipart_form_data(out, params, opt)
316316
boundary ||= SecureRandom.urlsafe_base64(40)
317317
chunked_p = chunked?
318318

319-
buf = ''
319+
buf = +''
320320
params.each do |key, value, h={}|
321321
key = quote_string(key, charset)
322322
filename =
@@ -401,7 +401,7 @@ def write_header(sock, ver, path)
401401
if /[\r\n]/ =~ reqline
402402
raise ArgumentError, "A Request-Line must not contain CR or LF"
403403
end
404-
buf = ""
404+
buf = +''
405405
buf << reqline << "\r\n"
406406
each_capitalized do |k,v|
407407
buf << "#{k}: #{v}\r\n"

lib/net/http/header.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# frozen_string_literal: false
1+
# frozen_string_literal: true
22
#
33
# The \HTTPHeader module provides access to \HTTP headers.
44
#

lib/net/http/proxy_delta.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# frozen_string_literal: false
1+
# frozen_string_literal: true
22
module Net::HTTP::ProxyDelta #:nodoc: internal use only
33
private
44

lib/net/http/request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# frozen_string_literal: false
1+
# frozen_string_literal: true
22

33
# This class is the base class for \Net::HTTP request classes.
44
# The class should not be used directly;

lib/net/http/requests.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# frozen_string_literal: false
1+
# frozen_string_literal: true
22

33
# HTTP/1.1 methods --- RFC2616
44

lib/net/http/response.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# frozen_string_literal: false
1+
# frozen_string_literal: true
22

33
# This class is the base class for \Net::HTTP response classes.
44
#
@@ -273,7 +273,7 @@ def code_type #:nodoc:
273273

274274
def error! #:nodoc:
275275
message = @code
276-
message += ' ' + @message.dump if @message
276+
message = "#{message} #{@message.dump}" if @message
277277
raise error_type().new(message, self)
278278
end
279279

@@ -648,7 +648,7 @@ def procdest(dest, block)
648648
if block
649649
Net::ReadAdapter.new(block)
650650
else
651-
dest || ''
651+
dest || +''
652652
end
653653
end
654654

lib/net/https.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# frozen_string_literal: false
1+
# frozen_string_literal: true
22
=begin
33
44
= net/https -- SSL/TLS enhancement for Net::HTTP.

0 commit comments

Comments
 (0)