Skip to content

Commit

Permalink
Merge pull request #1250 from q-centrix/frozen_string_literal_changes
Browse files Browse the repository at this point in the history
Add frozen_string_literal: true to remaining files
  • Loading branch information
tenderlove committed Apr 14, 2018
2 parents 4786af0 + 4a2b1ec commit dc204b1
Show file tree
Hide file tree
Showing 124 changed files with 248 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Rakefile
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Rakefile for Rack. -*-ruby-*-

desc "Run all the tests"
Expand Down
2 changes: 2 additions & 0 deletions example/protectedlobster.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack'
require 'rack/lobster'

Expand Down
2 changes: 2 additions & 0 deletions lib/rack.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (C) 2007, 2008, 2009, 2010 Christian Neukirchen <purl.org/net/chneukirchen>
#
# Rack is freely distributable under the terms of an MIT-style license.
Expand Down
2 changes: 2 additions & 0 deletions 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.
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/auth/abstract/request.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/request'

module Rack
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/auth/basic.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/auth/abstract/handler'
require 'rack/auth/abstract/request'

Expand Down
2 changes: 2 additions & 0 deletions 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'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/auth/digest/nonce.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'digest/md5'

module Rack
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/auth/digest/params.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rack
module Auth
module Digest
Expand Down
2 changes: 2 additions & 0 deletions 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'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/body_proxy.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rack
class BodyProxy
def initialize(body, &block)
Expand Down
2 changes: 2 additions & 0 deletions 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.
Expand Down
2 changes: 2 additions & 0 deletions 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
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/chunked.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/utils'

module Rack
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/common_logger.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/body_proxy'

module Rack
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/conditional_get.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/utils'

module Rack
Expand Down
2 changes: 2 additions & 0 deletions 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.
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/content_length.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/utils'
require 'rack/body_proxy'

Expand Down
2 changes: 2 additions & 0 deletions lib/rack/content_type.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/utils'

module Rack
Expand Down
1 change: 1 addition & 0 deletions lib/rack/deflater.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require "zlib"
require "time" # for Time.httpdate
require 'rack/utils'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/directory.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'time'
require 'rack/utils'
require 'rack/mime'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/etag.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack'
require 'digest/sha2'

Expand Down
2 changes: 2 additions & 0 deletions lib/rack/events.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/response'
require 'rack/body_proxy'

Expand Down
2 changes: 2 additions & 0 deletions lib/rack/file.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'time'
require 'rack/utils'
require 'rack/mime'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/handler.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rack
# *Handlers* connect web servers with Rack.
#
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/handler/cgi.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/content_length'
require 'rack/rewindable_input'

Expand Down
2 changes: 2 additions & 0 deletions lib/rack/handler/fastcgi.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'fcgi'
require 'socket'
require 'rack/content_length'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/handler/lsws.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'lsapi'
require 'rack/content_length'
require 'rack/rewindable_input'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/handler/scgi.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'scgi'
require 'stringio'
require 'rack/content_length'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/handler/thin.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "thin"
require "thin/server"
require "thin/logging"
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/handler/webrick.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'webrick'
require 'stringio'
require 'rack/content_length'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/head.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/body_proxy'

module Rack
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/lint.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/utils'
require 'forwardable'

Expand Down
2 changes: 2 additions & 0 deletions lib/rack/lobster.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'zlib'

require 'rack/request'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/lock.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'thread'
require 'rack/body_proxy'

Expand Down
2 changes: 2 additions & 0 deletions lib/rack/logger.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'logger'

module Rack
Expand Down
2 changes: 2 additions & 0 deletions 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

Expand Down
2 changes: 2 additions & 0 deletions 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]
Expand Down
2 changes: 2 additions & 0 deletions 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+.
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/mock.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'uri'
require 'stringio'
require 'rack'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/multipart.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/multipart/parser'

module Rack
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/multipart/generator.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rack
module Multipart
class Generator
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/multipart/parser.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/utils'

module Rack
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/multipart/uploaded_file.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rack
module Multipart
class UploadedFile
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/null_logger.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rack
class NullLogger
def initialize(app)
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/query_parser.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rack
class QueryParser
DEFAULT_SEP = /[&;] */n
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/recursive.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'uri'

module Rack
Expand Down
2 changes: 2 additions & 0 deletions 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.
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/request.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/utils'
require 'rack/media_type'

Expand Down
2 changes: 2 additions & 0 deletions lib/rack/response.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/request'
require 'rack/utils'
require 'rack/body_proxy'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/rewindable_input.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# -*- encoding: binary -*-
require 'tempfile'
require 'rack/utils'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/runtime.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/utils'

module Rack
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/sendfile.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/file'
require 'rack/body_proxy'

Expand Down
2 changes: 2 additions & 0 deletions lib/rack/server.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'optparse'
require 'fileutils'

Expand Down
2 changes: 2 additions & 0 deletions lib/rack/session/abstract/id.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# AUTHOR: blink <blinketje@gmail.com>; blink#ruby-lang@irc.freenode.net
# bugrep: Andreas Zehnder

Expand Down
2 changes: 2 additions & 0 deletions lib/rack/session/cookie.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'openssl'
require 'zlib'
require 'rack/request'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/session/memcache.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# AUTHOR: blink <blinketje@gmail.com>; blink#ruby-lang@irc.freenode.net

require 'rack/session/abstract/id'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/session/pool.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# AUTHOR: blink <blinketje@gmail.com>; blink#ruby-lang@irc.freenode.net
# THANKS:
# apeiros, for session id generation, expiry setup, and threadiness
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/show_exceptions.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'ostruct'
require 'erb'
require 'rack/request'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/show_status.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'erb'
require 'rack/request'
require 'rack/utils'
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/static.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "rack/file"
require "rack/utils"

Expand Down
2 changes: 2 additions & 0 deletions lib/rack/tempfile_reaper.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rack/body_proxy'

module Rack
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/urlmap.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'set'

module Rack
Expand Down
2 changes: 2 additions & 0 deletions lib/rack/utils.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# -*- encoding: binary -*-
# frozen_string_literal: true
require 'uri'
Expand Down
2 changes: 2 additions & 0 deletions 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']]
Expand Down
2 changes: 2 additions & 0 deletions test/builder/anything.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class Anything
def self.call(env)
[200, {'Content-Type' => 'text/plain'}, ['OK']]
Expand Down

0 comments on commit dc204b1

Please sign in to comment.