From 4a2b1ecdcb8cac5a5ebf4d6829b973759e9ba9d8 Mon Sep 17 00:00:00 2001 From: Dillon Welch Date: Fri, 13 Apr 2018 21:48:52 -0700 Subject: [PATCH] Add frozen_string_literal: true to remaining files See https://github.com/rack/rack/issues/1243 for history of this task --- Rakefile | 2 ++ example/protectedlobster.rb | 2 ++ lib/rack.rb | 2 ++ lib/rack/auth/abstract/handler.rb | 2 ++ lib/rack/auth/abstract/request.rb | 2 ++ lib/rack/auth/basic.rb | 2 ++ lib/rack/auth/digest/md5.rb | 2 ++ lib/rack/auth/digest/nonce.rb | 2 ++ lib/rack/auth/digest/params.rb | 2 ++ lib/rack/auth/digest/request.rb | 2 ++ lib/rack/body_proxy.rb | 2 ++ lib/rack/builder.rb | 2 ++ lib/rack/cascade.rb | 2 ++ lib/rack/chunked.rb | 2 ++ lib/rack/common_logger.rb | 2 ++ lib/rack/conditional_get.rb | 2 ++ lib/rack/config.rb | 2 ++ lib/rack/content_length.rb | 2 ++ lib/rack/content_type.rb | 2 ++ lib/rack/deflater.rb | 1 + lib/rack/directory.rb | 2 ++ lib/rack/etag.rb | 2 ++ lib/rack/events.rb | 2 ++ lib/rack/file.rb | 2 ++ lib/rack/handler.rb | 2 ++ lib/rack/handler/cgi.rb | 2 ++ lib/rack/handler/fastcgi.rb | 2 ++ lib/rack/handler/lsws.rb | 2 ++ lib/rack/handler/scgi.rb | 2 ++ lib/rack/handler/thin.rb | 2 ++ lib/rack/handler/webrick.rb | 2 ++ lib/rack/head.rb | 2 ++ lib/rack/lint.rb | 2 ++ lib/rack/lobster.rb | 2 ++ lib/rack/lock.rb | 2 ++ lib/rack/logger.rb | 2 ++ lib/rack/media_type.rb | 2 ++ lib/rack/method_override.rb | 2 ++ lib/rack/mime.rb | 2 ++ lib/rack/mock.rb | 2 ++ lib/rack/multipart.rb | 2 ++ lib/rack/multipart/generator.rb | 2 ++ lib/rack/multipart/parser.rb | 2 ++ lib/rack/multipart/uploaded_file.rb | 2 ++ lib/rack/null_logger.rb | 2 ++ lib/rack/query_parser.rb | 2 ++ lib/rack/recursive.rb | 2 ++ lib/rack/reloader.rb | 2 ++ lib/rack/request.rb | 2 ++ lib/rack/response.rb | 2 ++ lib/rack/rewindable_input.rb | 2 ++ lib/rack/runtime.rb | 2 ++ lib/rack/sendfile.rb | 2 ++ lib/rack/server.rb | 2 ++ lib/rack/session/abstract/id.rb | 2 ++ lib/rack/session/cookie.rb | 2 ++ lib/rack/session/memcache.rb | 2 ++ lib/rack/session/pool.rb | 2 ++ lib/rack/show_exceptions.rb | 2 ++ lib/rack/show_status.rb | 2 ++ lib/rack/static.rb | 2 ++ lib/rack/tempfile_reaper.rb | 2 ++ lib/rack/urlmap.rb | 2 ++ lib/rack/utils.rb | 2 ++ test/builder/an_underscore_app.rb | 2 ++ test/builder/anything.rb | 2 ++ test/cgi/rackup_stub.rb | 2 ++ test/gemloader.rb | 2 ++ test/helper.rb | 2 ++ test/registering_handler/rack/handler/registering_myself.rb | 2 ++ test/spec_auth_basic.rb | 2 ++ test/spec_auth_digest.rb | 2 ++ test/spec_body_proxy.rb | 2 ++ test/spec_builder.rb | 2 ++ test/spec_cascade.rb | 2 ++ test/spec_cgi.rb | 2 ++ test/spec_chunked.rb | 2 ++ test/spec_common_logger.rb | 2 ++ test/spec_conditional_get.rb | 2 ++ test/spec_config.rb | 2 ++ test/spec_content_length.rb | 2 ++ test/spec_content_type.rb | 2 ++ test/spec_deflater.rb | 4 +++- test/spec_directory.rb | 2 ++ test/spec_etag.rb | 2 ++ test/spec_events.rb | 2 ++ test/spec_fastcgi.rb | 2 ++ test/spec_file.rb | 2 ++ test/spec_handler.rb | 2 ++ test/spec_head.rb | 2 ++ test/spec_lint.rb | 2 ++ test/spec_lobster.rb | 2 ++ test/spec_lock.rb | 2 ++ test/spec_logger.rb | 2 ++ test/spec_media_type.rb | 2 ++ test/spec_method_override.rb | 2 ++ test/spec_mime.rb | 2 ++ test/spec_mock.rb | 2 ++ test/spec_multipart.rb | 2 ++ test/spec_null_logger.rb | 2 ++ test/spec_recursive.rb | 2 ++ test/spec_request.rb | 2 ++ test/spec_response.rb | 2 ++ test/spec_rewindable_input.rb | 2 ++ test/spec_runtime.rb | 2 ++ test/spec_sendfile.rb | 2 ++ test/spec_server.rb | 2 ++ test/spec_session_abstract_id.rb | 2 ++ test/spec_session_abstract_session_hash.rb | 2 ++ test/spec_session_cookie.rb | 2 ++ test/spec_session_memcache.rb | 2 ++ test/spec_session_pool.rb | 2 ++ test/spec_show_exceptions.rb | 2 ++ test/spec_show_status.rb | 2 ++ test/spec_static.rb | 2 ++ test/spec_tempfile_reaper.rb | 2 ++ test/spec_thin.rb | 2 ++ test/spec_urlmap.rb | 2 ++ test/spec_utils.rb | 2 ++ test/spec_version.rb | 2 ++ test/spec_webrick.rb | 2 ++ test/testrequest.rb | 2 ++ test/unregistered_handler/rack/handler/unregistered.rb | 2 ++ .../rack/handler/unregistered_long_one.rb | 2 ++ 124 files changed, 248 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index c112f1da8..0804aa25d 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Rakefile for Rack. -*-ruby-*- desc "Run all the tests" diff --git a/example/protectedlobster.rb b/example/protectedlobster.rb index 26b23661f..ec1609bd5 100644 --- a/example/protectedlobster.rb +++ b/example/protectedlobster.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack' require 'rack/lobster' diff --git a/lib/rack.rb b/lib/rack.rb index f1417d2d7..26fe83948 100644 --- a/lib/rack.rb +++ b/lib/rack.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Copyright (C) 2007, 2008, 2009, 2010 Christian Neukirchen # # Rack is freely distributable under the terms of an MIT-style license. diff --git a/lib/rack/auth/abstract/handler.rb b/lib/rack/auth/abstract/handler.rb index c657691e1..27dc8c6e2 100644 --- a/lib/rack/auth/abstract/handler.rb +++ b/lib/rack/auth/abstract/handler.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack module Auth # Rack::Auth::AbstractHandler implements common authentication functionality. diff --git a/lib/rack/auth/abstract/request.rb b/lib/rack/auth/abstract/request.rb index b738cc98a..23da4bf27 100644 --- a/lib/rack/auth/abstract/request.rb +++ b/lib/rack/auth/abstract/request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/request' module Rack diff --git a/lib/rack/auth/basic.rb b/lib/rack/auth/basic.rb index 9c5892141..dfe2ce963 100644 --- a/lib/rack/auth/basic.rb +++ b/lib/rack/auth/basic.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/auth/abstract/handler' require 'rack/auth/abstract/request' diff --git a/lib/rack/auth/digest/md5.rb b/lib/rack/auth/digest/md5.rb index ddee35def..36afdd51a 100644 --- a/lib/rack/auth/digest/md5.rb +++ b/lib/rack/auth/digest/md5.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/auth/abstract/handler' require 'rack/auth/digest/request' require 'rack/auth/digest/params' diff --git a/lib/rack/auth/digest/nonce.rb b/lib/rack/auth/digest/nonce.rb index 57089cb30..6c1f28a3a 100644 --- a/lib/rack/auth/digest/nonce.rb +++ b/lib/rack/auth/digest/nonce.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'digest/md5' module Rack diff --git a/lib/rack/auth/digest/params.rb b/lib/rack/auth/digest/params.rb index 3ac615c8f..f611b3c35 100644 --- a/lib/rack/auth/digest/params.rb +++ b/lib/rack/auth/digest/params.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack module Auth module Digest diff --git a/lib/rack/auth/digest/request.rb b/lib/rack/auth/digest/request.rb index 105c76747..a3ab47439 100644 --- a/lib/rack/auth/digest/request.rb +++ b/lib/rack/auth/digest/request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/auth/abstract/request' require 'rack/auth/digest/params' require 'rack/auth/digest/nonce' diff --git a/lib/rack/body_proxy.rb b/lib/rack/body_proxy.rb index 7fcfe3167..22c8cad4f 100644 --- a/lib/rack/body_proxy.rb +++ b/lib/rack/body_proxy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class BodyProxy def initialize(body, &block) diff --git a/lib/rack/builder.rb b/lib/rack/builder.rb index 11f596bd8..fc36b3713 100644 --- a/lib/rack/builder.rb +++ b/lib/rack/builder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack # Rack::Builder implements a small DSL to iteratively construct Rack # applications. diff --git a/lib/rack/cascade.rb b/lib/rack/cascade.rb index 6b8f415ae..51064318e 100644 --- a/lib/rack/cascade.rb +++ b/lib/rack/cascade.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack # Rack::Cascade tries a request on several apps, and returns the # first response that is not 404 or 405 (or in a list of configurable diff --git a/lib/rack/chunked.rb b/lib/rack/chunked.rb index 3076931c4..65114671b 100644 --- a/lib/rack/chunked.rb +++ b/lib/rack/chunked.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/utils' module Rack diff --git a/lib/rack/common_logger.rb b/lib/rack/common_logger.rb index 7855f0c30..119d92fad 100644 --- a/lib/rack/common_logger.rb +++ b/lib/rack/common_logger.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/body_proxy' module Rack diff --git a/lib/rack/conditional_get.rb b/lib/rack/conditional_get.rb index 441dd3823..e9d037cf2 100644 --- a/lib/rack/conditional_get.rb +++ b/lib/rack/conditional_get.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/utils' module Rack diff --git a/lib/rack/config.rb b/lib/rack/config.rb index dc255d27e..41f6f7dd5 100644 --- a/lib/rack/config.rb +++ b/lib/rack/config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack # Rack::Config modifies the environment using the block given during # initialization. diff --git a/lib/rack/content_length.rb b/lib/rack/content_length.rb index 2df7dfc81..c72f96ad6 100644 --- a/lib/rack/content_length.rb +++ b/lib/rack/content_length.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/utils' require 'rack/body_proxy' diff --git a/lib/rack/content_type.rb b/lib/rack/content_type.rb index 78ba43b71..56fa1274a 100644 --- a/lib/rack/content_type.rb +++ b/lib/rack/content_type.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/utils' module Rack diff --git a/lib/rack/deflater.rb b/lib/rack/deflater.rb index d1fb73ab3..07282137b 100644 --- a/lib/rack/deflater.rb +++ b/lib/rack/deflater.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "zlib" require "time" # for Time.httpdate require 'rack/utils' diff --git a/lib/rack/directory.rb b/lib/rack/directory.rb index 89cfe807a..d64df8092 100644 --- a/lib/rack/directory.rb +++ b/lib/rack/directory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'time' require 'rack/utils' require 'rack/mime' diff --git a/lib/rack/etag.rb b/lib/rack/etag.rb index 5a8c6452a..cea0e8a25 100644 --- a/lib/rack/etag.rb +++ b/lib/rack/etag.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack' require 'digest/sha2' diff --git a/lib/rack/events.rb b/lib/rack/events.rb index 3782a22eb..106d66776 100644 --- a/lib/rack/events.rb +++ b/lib/rack/events.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/response' require 'rack/body_proxy' diff --git a/lib/rack/file.rb b/lib/rack/file.rb index 09eb0afb8..de0116ee5 100644 --- a/lib/rack/file.rb +++ b/lib/rack/file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'time' require 'rack/utils' require 'rack/mime' diff --git a/lib/rack/handler.rb b/lib/rack/handler.rb index 70a77fa97..0a59ab36d 100644 --- a/lib/rack/handler.rb +++ b/lib/rack/handler.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack # *Handlers* connect web servers with Rack. # diff --git a/lib/rack/handler/cgi.rb b/lib/rack/handler/cgi.rb index 528076946..42dbddf99 100644 --- a/lib/rack/handler/cgi.rb +++ b/lib/rack/handler/cgi.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/content_length' require 'rack/rewindable_input' diff --git a/lib/rack/handler/fastcgi.rb b/lib/rack/handler/fastcgi.rb index e918dc94b..977bfd93e 100644 --- a/lib/rack/handler/fastcgi.rb +++ b/lib/rack/handler/fastcgi.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'fcgi' require 'socket' require 'rack/content_length' diff --git a/lib/rack/handler/lsws.rb b/lib/rack/handler/lsws.rb index d2cfd7935..e876a8484 100644 --- a/lib/rack/handler/lsws.rb +++ b/lib/rack/handler/lsws.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'lsapi' require 'rack/content_length' require 'rack/rewindable_input' diff --git a/lib/rack/handler/scgi.rb b/lib/rack/handler/scgi.rb index beda9c3e3..6f22d6303 100644 --- a/lib/rack/handler/scgi.rb +++ b/lib/rack/handler/scgi.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'scgi' require 'stringio' require 'rack/content_length' diff --git a/lib/rack/handler/thin.rb b/lib/rack/handler/thin.rb index ca8806463..2a33edc4a 100644 --- a/lib/rack/handler/thin.rb +++ b/lib/rack/handler/thin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "thin" require "thin/server" require "thin/logging" diff --git a/lib/rack/handler/webrick.rb b/lib/rack/handler/webrick.rb index d0fcd2136..92f066051 100644 --- a/lib/rack/handler/webrick.rb +++ b/lib/rack/handler/webrick.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'webrick' require 'stringio' require 'rack/content_length' diff --git a/lib/rack/head.rb b/lib/rack/head.rb index 6f1d74728..c257ae4d5 100644 --- a/lib/rack/head.rb +++ b/lib/rack/head.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/body_proxy' module Rack diff --git a/lib/rack/lint.rb b/lib/rack/lint.rb index 683ba6841..66e88253f 100644 --- a/lib/rack/lint.rb +++ b/lib/rack/lint.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/utils' require 'forwardable' diff --git a/lib/rack/lobster.rb b/lib/rack/lobster.rb index 4d6e39f2b..199bfebf6 100644 --- a/lib/rack/lobster.rb +++ b/lib/rack/lobster.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'zlib' require 'rack/request' diff --git a/lib/rack/lock.rb b/lib/rack/lock.rb index b5a41e8e1..96366cd30 100644 --- a/lib/rack/lock.rb +++ b/lib/rack/lock.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'thread' require 'rack/body_proxy' diff --git a/lib/rack/logger.rb b/lib/rack/logger.rb index 01fc321c7..6c4bede0c 100644 --- a/lib/rack/logger.rb +++ b/lib/rack/logger.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'logger' module Rack diff --git a/lib/rack/media_type.rb b/lib/rack/media_type.rb index 7e6cd3a85..4782b6abd 100644 --- a/lib/rack/media_type.rb +++ b/lib/rack/media_type.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack # Rack::MediaType parse media type and parameters out of content_type string diff --git a/lib/rack/method_override.rb b/lib/rack/method_override.rb index 06df21f7b..260ee470d 100644 --- a/lib/rack/method_override.rb +++ b/lib/rack/method_override.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class MethodOverride HTTP_METHODS = %w[GET HEAD PUT POST DELETE OPTIONS PATCH LINK UNLINK] diff --git a/lib/rack/mime.rb b/lib/rack/mime.rb index d82dc1319..3c0653f04 100644 --- a/lib/rack/mime.rb +++ b/lib/rack/mime.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack module Mime # Returns String with mime type if found, otherwise use +fallback+. diff --git a/lib/rack/mock.rb b/lib/rack/mock.rb index 914bf3b53..a61269b69 100644 --- a/lib/rack/mock.rb +++ b/lib/rack/mock.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'uri' require 'stringio' require 'rack' diff --git a/lib/rack/multipart.rb b/lib/rack/multipart.rb index db59ee59a..31ac29ebb 100644 --- a/lib/rack/multipart.rb +++ b/lib/rack/multipart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/multipart/parser' module Rack diff --git a/lib/rack/multipart/generator.rb b/lib/rack/multipart/generator.rb index f0b70a8d6..e086a0020 100644 --- a/lib/rack/multipart/generator.rb +++ b/lib/rack/multipart/generator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack module Multipart class Generator diff --git a/lib/rack/multipart/parser.rb b/lib/rack/multipart/parser.rb index 727d2deb8..427dcccc8 100644 --- a/lib/rack/multipart/parser.rb +++ b/lib/rack/multipart/parser.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/utils' module Rack diff --git a/lib/rack/multipart/uploaded_file.rb b/lib/rack/multipart/uploaded_file.rb index 924b1f089..d01f2d6f3 100644 --- a/lib/rack/multipart/uploaded_file.rb +++ b/lib/rack/multipart/uploaded_file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack module Multipart class UploadedFile diff --git a/lib/rack/null_logger.rb b/lib/rack/null_logger.rb index abc612062..3eff73d68 100644 --- a/lib/rack/null_logger.rb +++ b/lib/rack/null_logger.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class NullLogger def initialize(app) diff --git a/lib/rack/query_parser.rb b/lib/rack/query_parser.rb index be74bc069..4364b9503 100644 --- a/lib/rack/query_parser.rb +++ b/lib/rack/query_parser.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class QueryParser DEFAULT_SEP = /[&;] */n diff --git a/lib/rack/recursive.rb b/lib/rack/recursive.rb index 7645d284a..6c5fc89c5 100644 --- a/lib/rack/recursive.rb +++ b/lib/rack/recursive.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'uri' module Rack diff --git a/lib/rack/reloader.rb b/lib/rack/reloader.rb index 296dd6a1f..5d9617fab 100644 --- a/lib/rack/reloader.rb +++ b/lib/rack/reloader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com # Rack::Reloader is subject to the terms of an MIT-style license. # See COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/lib/rack/request.rb b/lib/rack/request.rb index 119c1b816..9c8828d83 100644 --- a/lib/rack/request.rb +++ b/lib/rack/request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/utils' require 'rack/media_type' diff --git a/lib/rack/response.rb b/lib/rack/response.rb index a9f0c2a36..e201685a2 100644 --- a/lib/rack/response.rb +++ b/lib/rack/response.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/request' require 'rack/utils' require 'rack/body_proxy' diff --git a/lib/rack/rewindable_input.rb b/lib/rack/rewindable_input.rb index f14b8f592..26dd9cb48 100644 --- a/lib/rack/rewindable_input.rb +++ b/lib/rack/rewindable_input.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # -*- encoding: binary -*- require 'tempfile' require 'rack/utils' diff --git a/lib/rack/runtime.rb b/lib/rack/runtime.rb index bb15bdb1b..23da12c72 100644 --- a/lib/rack/runtime.rb +++ b/lib/rack/runtime.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/utils' module Rack diff --git a/lib/rack/sendfile.rb b/lib/rack/sendfile.rb index bd0af9cb1..6390e1db2 100644 --- a/lib/rack/sendfile.rb +++ b/lib/rack/sendfile.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/file' require 'rack/body_proxy' diff --git a/lib/rack/server.rb b/lib/rack/server.rb index ec0806961..4e2656943 100644 --- a/lib/rack/server.rb +++ b/lib/rack/server.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'optparse' require 'fileutils' diff --git a/lib/rack/session/abstract/id.rb b/lib/rack/session/abstract/id.rb index 1bb8d5d06..edd2dfb74 100644 --- a/lib/rack/session/abstract/id.rb +++ b/lib/rack/session/abstract/id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # AUTHOR: blink ; blink#ruby-lang@irc.freenode.net # bugrep: Andreas Zehnder diff --git a/lib/rack/session/cookie.rb b/lib/rack/session/cookie.rb index 71bb96f4f..3ff585c61 100644 --- a/lib/rack/session/cookie.rb +++ b/lib/rack/session/cookie.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'openssl' require 'zlib' require 'rack/request' diff --git a/lib/rack/session/memcache.rb b/lib/rack/session/memcache.rb index 4cf5ea09e..d6001709e 100644 --- a/lib/rack/session/memcache.rb +++ b/lib/rack/session/memcache.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # AUTHOR: blink ; blink#ruby-lang@irc.freenode.net require 'rack/session/abstract/id' diff --git a/lib/rack/session/pool.rb b/lib/rack/session/pool.rb index 4c9c25c7a..d3a134668 100644 --- a/lib/rack/session/pool.rb +++ b/lib/rack/session/pool.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # AUTHOR: blink ; blink#ruby-lang@irc.freenode.net # THANKS: # apeiros, for session id generation, expiry setup, and threadiness diff --git a/lib/rack/show_exceptions.rb b/lib/rack/show_exceptions.rb index 6d7c52538..86554498e 100644 --- a/lib/rack/show_exceptions.rb +++ b/lib/rack/show_exceptions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'ostruct' require 'erb' require 'rack/request' diff --git a/lib/rack/show_status.rb b/lib/rack/show_status.rb index 54db8f471..aea9aa180 100644 --- a/lib/rack/show_status.rb +++ b/lib/rack/show_status.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'erb' require 'rack/request' require 'rack/utils' diff --git a/lib/rack/static.rb b/lib/rack/static.rb index 17f476494..f8024f71e 100644 --- a/lib/rack/static.rb +++ b/lib/rack/static.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rack/file" require "rack/utils" diff --git a/lib/rack/tempfile_reaper.rb b/lib/rack/tempfile_reaper.rb index d82998061..73b6c1c8d 100644 --- a/lib/rack/tempfile_reaper.rb +++ b/lib/rack/tempfile_reaper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rack/body_proxy' module Rack diff --git a/lib/rack/urlmap.rb b/lib/rack/urlmap.rb index 58d8ed1b0..103e011dc 100644 --- a/lib/rack/urlmap.rb +++ b/lib/rack/urlmap.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'set' module Rack diff --git a/lib/rack/utils.rb b/lib/rack/utils.rb index 98ceee8a2..e1008dc26 100644 --- a/lib/rack/utils.rb +++ b/lib/rack/utils.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # -*- encoding: binary -*- # frozen_string_literal: true require 'uri' diff --git a/test/builder/an_underscore_app.rb b/test/builder/an_underscore_app.rb index 7ce1a0cc9..cbccfcfa6 100644 --- a/test/builder/an_underscore_app.rb +++ b/test/builder/an_underscore_app.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AnUnderscoreApp def self.call(env) [200, {'Content-Type' => 'text/plain'}, ['OK']] diff --git a/test/builder/anything.rb b/test/builder/anything.rb index c07f82cda..452100b65 100644 --- a/test/builder/anything.rb +++ b/test/builder/anything.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Anything def self.call(env) [200, {'Content-Type' => 'text/plain'}, ['OK']] diff --git a/test/cgi/rackup_stub.rb b/test/cgi/rackup_stub.rb index a216cdc39..36feb2ea2 100755 --- a/test/cgi/rackup_stub.rb +++ b/test/cgi/rackup_stub.rb @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + # -*- ruby -*- $:.unshift '../../lib' diff --git a/test/gemloader.rb b/test/gemloader.rb index 22be69758..f38c80360 100644 --- a/test/gemloader.rb +++ b/test/gemloader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rubygems' project = 'rack' gemspec = File.expand_path("#{project}.gemspec", Dir.pwd) diff --git a/test/helper.rb b/test/helper.rb index aa9c0e0af..9a26e6ac2 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' module Rack diff --git a/test/registering_handler/rack/handler/registering_myself.rb b/test/registering_handler/rack/handler/registering_myself.rb index 4964953b8..21b605167 100644 --- a/test/registering_handler/rack/handler/registering_myself.rb +++ b/test/registering_handler/rack/handler/registering_myself.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack module Handler class RegisteringMyself diff --git a/test/spec_auth_basic.rb b/test/spec_auth_basic.rb index 45d28576f..c26f473a2 100644 --- a/test/spec_auth_basic.rb +++ b/test/spec_auth_basic.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/auth/basic' require 'rack/lint' diff --git a/test/spec_auth_digest.rb b/test/spec_auth_digest.rb index 7230bb684..7a2e4c66e 100644 --- a/test/spec_auth_digest.rb +++ b/test/spec_auth_digest.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/auth/digest/md5' require 'rack/lint' diff --git a/test/spec_body_proxy.rb b/test/spec_body_proxy.rb index 4db447a0a..0b8b60d2a 100644 --- a/test/spec_body_proxy.rb +++ b/test/spec_body_proxy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/body_proxy' require 'stringio' diff --git a/test/spec_builder.rb b/test/spec_builder.rb index 32e18d5e2..40e602e88 100644 --- a/test/spec_builder.rb +++ b/test/spec_builder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/builder' require 'rack/lint' diff --git a/test/spec_cascade.rb b/test/spec_cascade.rb index 180ce46eb..0188b53c7 100644 --- a/test/spec_cascade.rb +++ b/test/spec_cascade.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack' require 'rack/cascade' diff --git a/test/spec_cgi.rb b/test/spec_cgi.rb index 77020c2f6..b20d08868 100644 --- a/test/spec_cgi.rb +++ b/test/spec_cgi.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'helper' if defined? LIGHTTPD_PID diff --git a/test/spec_chunked.rb b/test/spec_chunked.rb index a56db8b7e..36eab95be 100644 --- a/test/spec_chunked.rb +++ b/test/spec_chunked.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/chunked' require 'rack/lint' diff --git a/test/spec_common_logger.rb b/test/spec_common_logger.rb index 3589576b8..90ff59865 100644 --- a/test/spec_common_logger.rb +++ b/test/spec_common_logger.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/common_logger' require 'rack/lint' diff --git a/test/spec_conditional_get.rb b/test/spec_conditional_get.rb index 58f37ad5e..c129b29e5 100644 --- a/test/spec_conditional_get.rb +++ b/test/spec_conditional_get.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'time' require 'rack/conditional_get' diff --git a/test/spec_config.rb b/test/spec_config.rb index 16f0a6649..8c116b1b1 100644 --- a/test/spec_config.rb +++ b/test/spec_config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/builder' require 'rack/config' diff --git a/test/spec_content_length.rb b/test/spec_content_length.rb index 89752bbec..92728fbe6 100644 --- a/test/spec_content_length.rb +++ b/test/spec_content_length.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/content_length' require 'rack/lint' diff --git a/test/spec_content_type.rb b/test/spec_content_type.rb index daf75355d..d6567efdc 100644 --- a/test/spec_content_type.rb +++ b/test/spec_content_type.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/content_type' require 'rack/lint' diff --git a/test/spec_deflater.rb b/test/spec_deflater.rb index fc159ff1d..b4a526b3a 100644 --- a/test/spec_deflater.rb +++ b/test/spec_deflater.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'stringio' require 'time' # for Time#httpdate @@ -402,7 +404,7 @@ def each 'Content-Type' => 'text/plain' }) - buf = '' + buf = ''.dup raw_bytes = 0 inflater = auto_inflater body.each do |part| diff --git a/test/spec_directory.rb b/test/spec_directory.rb index 10584f377..a493ef720 100644 --- a/test/spec_directory.rb +++ b/test/spec_directory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/directory' require 'rack/lint' diff --git a/test/spec_etag.rb b/test/spec_etag.rb index 74795759b..d79a77e4c 100644 --- a/test/spec_etag.rb +++ b/test/spec_etag.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/etag' require 'rack/lint' diff --git a/test/spec_events.rb b/test/spec_events.rb index 7fc7b055c..8c079361c 100644 --- a/test/spec_events.rb +++ b/test/spec_events.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'helper' require 'rack/events' diff --git a/test/spec_fastcgi.rb b/test/spec_fastcgi.rb index 5a48327b1..eee69aeff 100644 --- a/test/spec_fastcgi.rb +++ b/test/spec_fastcgi.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'helper' if defined? LIGHTTPD_PID diff --git a/test/spec_file.rb b/test/spec_file.rb index 4eeb3ca04..2736affba 100644 --- a/test/spec_file.rb +++ b/test/spec_file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/file' require 'rack/lint' diff --git a/test/spec_handler.rb b/test/spec_handler.rb index dff474c98..c38cf4e98 100644 --- a/test/spec_handler.rb +++ b/test/spec_handler.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/handler' diff --git a/test/spec_head.rb b/test/spec_head.rb index 17b4a3497..d3027b0ef 100644 --- a/test/spec_head.rb +++ b/test/spec_head.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/head' require 'rack/lint' diff --git a/test/spec_lint.rb b/test/spec_lint.rb index c7b195f96..c4f327120 100644 --- a/test/spec_lint.rb +++ b/test/spec_lint.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'stringio' require 'tempfile' diff --git a/test/spec_lobster.rb b/test/spec_lobster.rb index fd4e70826..d4fcff475 100644 --- a/test/spec_lobster.rb +++ b/test/spec_lobster.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/lobster' require 'rack/lint' diff --git a/test/spec_lock.rb b/test/spec_lock.rb index c6f7c05ec..8b48db605 100644 --- a/test/spec_lock.rb +++ b/test/spec_lock.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/lint' require 'rack/lock' diff --git a/test/spec_logger.rb b/test/spec_logger.rb index ea503e1d0..0d5b161c9 100644 --- a/test/spec_logger.rb +++ b/test/spec_logger.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'stringio' require 'rack/lint' diff --git a/test/spec_media_type.rb b/test/spec_media_type.rb index 1d9f0fc36..1491acaad 100644 --- a/test/spec_media_type.rb +++ b/test/spec_media_type.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/media_type' diff --git a/test/spec_method_override.rb b/test/spec_method_override.rb index bb72af9f3..3159ca2d1 100644 --- a/test/spec_method_override.rb +++ b/test/spec_method_override.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'stringio' require 'rack/method_override' diff --git a/test/spec_mime.rb b/test/spec_mime.rb index 569233b49..b9258eb64 100644 --- a/test/spec_mime.rb +++ b/test/spec_mime.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/mime' diff --git a/test/spec_mock.rb b/test/spec_mock.rb index c79923215..10d098a35 100644 --- a/test/spec_mock.rb +++ b/test/spec_mock.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'yaml' require 'rack/lint' diff --git a/test/spec_multipart.rb b/test/spec_multipart.rb index 980600c92..914ffe8bb 100644 --- a/test/spec_multipart.rb +++ b/test/spec_multipart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # coding: utf-8 require 'minitest/autorun' diff --git a/test/spec_null_logger.rb b/test/spec_null_logger.rb index 3002d97fc..eb89e3067 100644 --- a/test/spec_null_logger.rb +++ b/test/spec_null_logger.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/lint' require 'rack/mock' diff --git a/test/spec_recursive.rb b/test/spec_recursive.rb index 4a60e6004..be1e97e6e 100644 --- a/test/spec_recursive.rb +++ b/test/spec_recursive.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/lint' require 'rack/recursive' diff --git a/test/spec_request.rb b/test/spec_request.rb index 82343c0cc..ca51a9c38 100644 --- a/test/spec_request.rb +++ b/test/spec_request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'stringio' require 'cgi' diff --git a/test/spec_response.rb b/test/spec_response.rb index b24cfd16b..9bfe788d1 100644 --- a/test/spec_response.rb +++ b/test/spec_response.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack' require 'rack/response' diff --git a/test/spec_rewindable_input.rb b/test/spec_rewindable_input.rb index 6090d64ca..932e9de37 100644 --- a/test/spec_rewindable_input.rb +++ b/test/spec_rewindable_input.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'stringio' require 'rack/rewindable_input' diff --git a/test/spec_runtime.rb b/test/spec_runtime.rb index f7f52ad9a..a47c0e2b5 100644 --- a/test/spec_runtime.rb +++ b/test/spec_runtime.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/lint' require 'rack/mock' diff --git a/test/spec_sendfile.rb b/test/spec_sendfile.rb index 1eb9413c0..1f9af7589 100644 --- a/test/spec_sendfile.rb +++ b/test/spec_sendfile.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'fileutils' require 'rack/lint' diff --git a/test/spec_server.rb b/test/spec_server.rb index 4864a87a4..2ce32269e 100644 --- a/test/spec_server.rb +++ b/test/spec_server.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack' require 'rack/server' diff --git a/test/spec_session_abstract_id.rb b/test/spec_session_abstract_id.rb index a6568f198..5591f9ac0 100644 --- a/test/spec_session_abstract_id.rb +++ b/test/spec_session_abstract_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' ### WARNING: there be hax in this file. diff --git a/test/spec_session_abstract_session_hash.rb b/test/spec_session_abstract_session_hash.rb index 76b34a01e..cb66b3730 100644 --- a/test/spec_session_abstract_session_hash.rb +++ b/test/spec_session_abstract_session_hash.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/session/abstract/id' diff --git a/test/spec_session_cookie.rb b/test/spec_session_cookie.rb index 1c9f857af..1bdacd258 100644 --- a/test/spec_session_cookie.rb +++ b/test/spec_session_cookie.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/session/cookie' require 'rack/lint' diff --git a/test/spec_session_memcache.rb b/test/spec_session_memcache.rb index 93a03d120..253f9f246 100644 --- a/test/spec_session_memcache.rb +++ b/test/spec_session_memcache.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' begin require 'rack/session/memcache' diff --git a/test/spec_session_pool.rb b/test/spec_session_pool.rb index 2d0616915..d6887a852 100644 --- a/test/spec_session_pool.rb +++ b/test/spec_session_pool.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'thread' require 'rack/lint' diff --git a/test/spec_show_exceptions.rb b/test/spec_show_exceptions.rb index cd44c8168..40d3b5867 100644 --- a/test/spec_show_exceptions.rb +++ b/test/spec_show_exceptions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/show_exceptions' require 'rack/lint' diff --git a/test/spec_show_status.rb b/test/spec_show_status.rb index d32dc7cb9..c8ce1b2bc 100644 --- a/test/spec_show_status.rb +++ b/test/spec_show_status.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/show_status' require 'rack/lint' diff --git a/test/spec_static.rb b/test/spec_static.rb index 634f8acf7..140dde62d 100644 --- a/test/spec_static.rb +++ b/test/spec_static.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/static' require 'rack/lint' diff --git a/test/spec_tempfile_reaper.rb b/test/spec_tempfile_reaper.rb index b7c625639..f6b79641c 100644 --- a/test/spec_tempfile_reaper.rb +++ b/test/spec_tempfile_reaper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/tempfile_reaper' require 'rack/lint' diff --git a/test/spec_thin.rb b/test/spec_thin.rb index 85b225ed9..afc74b6a6 100644 --- a/test/spec_thin.rb +++ b/test/spec_thin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' begin require 'rack/handler/thin' diff --git a/test/spec_urlmap.rb b/test/spec_urlmap.rb index f88ee606d..d6fb8a47b 100644 --- a/test/spec_urlmap.rb +++ b/test/spec_urlmap.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/urlmap' require 'rack/mock' diff --git a/test/spec_utils.rb b/test/spec_utils.rb index 143ad30a6..62ac1a232 100644 --- a/test/spec_utils.rb +++ b/test/spec_utils.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # -*- encoding: utf-8 -*- require 'minitest/autorun' require 'rack/utils' diff --git a/test/spec_version.rb b/test/spec_version.rb index 6ab0a74ca..215803970 100644 --- a/test/spec_version.rb +++ b/test/spec_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # -*- encoding: utf-8 -*- require 'minitest/autorun' require 'rack' diff --git a/test/spec_webrick.rb b/test/spec_webrick.rb index 855fa9eb5..3cd478d83 100644 --- a/test/spec_webrick.rb +++ b/test/spec_webrick.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'rack/mock' require 'thread' diff --git a/test/testrequest.rb b/test/testrequest.rb index cacd23d50..68790b281 100644 --- a/test/testrequest.rb +++ b/test/testrequest.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'yaml' require 'net/http' require 'rack/lint' diff --git a/test/unregistered_handler/rack/handler/unregistered.rb b/test/unregistered_handler/rack/handler/unregistered.rb index 3ca5a72c5..e98468cc6 100644 --- a/test/unregistered_handler/rack/handler/unregistered.rb +++ b/test/unregistered_handler/rack/handler/unregistered.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack module Handler # this class doesn't do anything, we're just seeing if we get it. diff --git a/test/unregistered_handler/rack/handler/unregistered_long_one.rb b/test/unregistered_handler/rack/handler/unregistered_long_one.rb index 2c2fae170..87c6c2543 100644 --- a/test/unregistered_handler/rack/handler/unregistered_long_one.rb +++ b/test/unregistered_handler/rack/handler/unregistered_long_one.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack module Handler # this class doesn't do anything, we're just seeing if we get it.