diff --git a/Gemfile b/Gemfile
index bfe220596..8e884cfde 100644
--- a/Gemfile
+++ b/Gemfile
@@ -29,8 +29,7 @@ gem "validates_email_format_of"
gem "validate_url"
# Background queue uses sidekiq
-# TODO: Upgrade to sidekiq 7.0
-gem "sidekiq", "<7"
+gem "sidekiq", "~> 7.0"
# Run cron jobs alongside sidekiq. Only use this for jobs that need
# to run once across a cluster. We're still using "regular" cron
# for jobs that need to run on every machine
diff --git a/Gemfile.lock b/Gemfile.lock
index 4fee999d2..b2630f5b4 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -368,6 +368,7 @@ GEM
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
+ logger (1.6.0)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
@@ -447,23 +448,23 @@ GEM
activesupport (>= 3.0.0)
raabro (1.4.0)
racc (1.8.1)
- rack (2.2.9)
+ rack (3.1.7)
rack-attack (6.7.0)
rack (>= 1.0, < 4)
rack-cors (2.0.2)
rack (>= 2.0.0)
rack-mini-profiler (3.3.1)
rack (>= 1.2.0)
- rack-protection (3.2.0)
+ rack-protection (4.0.0)
base64 (>= 0.1.0)
- rack (~> 2.2, >= 2.2.4)
- rack-session (1.0.2)
- rack (< 3)
+ rack (>= 3.0.0, < 4)
+ rack-session (2.0.0)
+ rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
- rackup (1.0.0)
- rack (< 3)
- webrick
+ rackup (2.1.0)
+ rack (>= 3)
+ webrick (~> 1.8)
rails (7.1.3.4)
actioncable (= 7.1.3.4)
actionmailbox (= 7.1.3.4)
@@ -521,7 +522,10 @@ GEM
rdoc (6.7.0)
psych (>= 4.0.0)
recaptcha (5.17.0)
- redis (4.8.1)
+ redis (5.2.0)
+ redis-client (>= 0.22.0)
+ redis-client (0.22.2)
+ connection_pool
regexp_parser (2.9.2)
reline (0.5.9)
io-console (~> 0.5)
@@ -628,10 +632,12 @@ GEM
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
shellany (0.0.1)
- sidekiq (6.5.12)
- connection_pool (>= 2.2.5, < 3)
- rack (~> 2.0)
- redis (>= 4.5.0, < 5)
+ sidekiq (7.3.0)
+ concurrent-ruby (< 2)
+ connection_pool (>= 2.3.0)
+ logger
+ rack (>= 2.2.4)
+ redis-client (>= 0.22.2)
sidekiq-cron (1.12.0)
fugit (~> 1.8)
globalid (>= 1.0.1)
@@ -844,7 +850,7 @@ DEPENDENCIES
sanitize
searchkick
selenium-webdriver
- sidekiq (< 7)
+ sidekiq (~> 7.0)
sidekiq-cron
simplecov
sitemap_generator
diff --git a/sorbet/rbi/gems/logger@1.6.0.rbi b/sorbet/rbi/gems/logger@1.6.0.rbi
new file mode 100644
index 000000000..5b699ff01
--- /dev/null
+++ b/sorbet/rbi/gems/logger@1.6.0.rbi
@@ -0,0 +1,903 @@
+# typed: false
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `logger` gem.
+# Please instead update this file by running `bin/tapioca gem logger`.
+
+
+# \Class \Logger provides a simple but sophisticated logging utility that
+# you can use to create one or more
+# {event logs}[https://en.wikipedia.org/wiki/Logging_(software)#Event_logs]
+# for your program.
+# Each such log contains a chronological sequence of entries
+# that provides a record of the program's activities.
+#
+# == About the Examples
+#
+# All examples on this page assume that \Logger has been required:
+#
+# require 'logger'
+#
+# == Synopsis
+#
+# Create a log with Logger.new:
+#
+# # Single log file.
+# logger = Logger.new('t.log')
+# # Size-based rotated logging: 3 10-megabyte files.
+# logger = Logger.new('t.log', 3, 10485760)
+# # Period-based rotated logging: daily (also allowed: 'weekly', 'monthly').
+# logger = Logger.new('t.log', 'daily')
+# # Log to an IO stream.
+# logger = Logger.new($stdout)
+#
+# Add entries (level, message) with Logger#add:
+#
+# logger.add(Logger::DEBUG, 'Maximal debugging info')
+# logger.add(Logger::INFO, 'Non-error information')
+# logger.add(Logger::WARN, 'Non-error warning')
+# logger.add(Logger::ERROR, 'Non-fatal error')
+# logger.add(Logger::FATAL, 'Fatal error')
+# logger.add(Logger::UNKNOWN, 'Most severe')
+#
+# Close the log with Logger#close:
+#
+# logger.close
+#
+# == Entries
+#
+# You can add entries with method Logger#add:
+#
+# logger.add(Logger::DEBUG, 'Maximal debugging info')
+# logger.add(Logger::INFO, 'Non-error information')
+# logger.add(Logger::WARN, 'Non-error warning')
+# logger.add(Logger::ERROR, 'Non-fatal error')
+# logger.add(Logger::FATAL, 'Fatal error')
+# logger.add(Logger::UNKNOWN, 'Most severe')
+#
+# These shorthand methods also add entries:
+#
+# logger.debug('Maximal debugging info')
+# logger.info('Non-error information')
+# logger.warn('Non-error warning')
+# logger.error('Non-fatal error')
+# logger.fatal('Fatal error')
+# logger.unknown('Most severe')
+#
+# When you call any of these methods,
+# the entry may or may not be written to the log,
+# depending on the entry's severity and on the log level;
+# see {Log Level}[rdoc-ref:Logger@Log+Level]
+#
+# An entry always has:
+#
+# - A severity (the required argument to #add).
+# - An automatically created timestamp.
+#
+# And may also have:
+#
+# - A message.
+# - A program name.
+#
+# Example:
+#
+# logger = Logger.new($stdout)
+# logger.add(Logger::INFO, 'My message.', 'mung')
+# # => I, [2022-05-07T17:21:46.536234 #20536] INFO -- mung: My message.
+#
+# The default format for an entry is:
+#
+# "%s, [%s #%d] %5s -- %s: %s\n"
+#
+# where the values to be formatted are:
+#
+# - \Severity (one letter).
+# - Timestamp.
+# - Process id.
+# - \Severity (word).
+# - Program name.
+# - Message.
+#
+# You can use a different entry format by:
+#
+# - Setting a custom format proc (affects following entries);
+# see {formatter=}[Logger.html#attribute-i-formatter].
+# - Calling any of the methods above with a block
+# (affects only the one entry).
+# Doing so can have two benefits:
+#
+# - Context: the block can evaluate the entire program context
+# and create a context-dependent message.
+# - Performance: the block is not evaluated unless the log level
+# permits the entry actually to be written:
+#
+# logger.error { my_slow_message_generator }
+#
+# Contrast this with the string form, where the string is
+# always evaluated, regardless of the log level:
+#
+# logger.error("#{my_slow_message_generator}")
+#
+# === \Severity
+#
+# The severity of a log entry has two effects:
+#
+# - Determines whether the entry is selected for inclusion in the log;
+# see {Log Level}[rdoc-ref:Logger@Log+Level].
+# - Indicates to any log reader (whether a person or a program)
+# the relative importance of the entry.
+#
+# === Timestamp
+#
+# The timestamp for a log entry is generated automatically
+# when the entry is created.
+#
+# The logged timestamp is formatted by method
+# {Time#strftime}[rdoc-ref:Time#strftime]
+# using this format string:
+#
+# '%Y-%m-%dT%H:%M:%S.%6N'
+#
+# Example:
+#
+# logger = Logger.new($stdout)
+# logger.add(Logger::INFO)
+# # => I, [2022-05-07T17:04:32.318331 #20536] INFO -- : nil
+#
+# You can set a different format using method #datetime_format=.
+#
+# === Message
+#
+# The message is an optional argument to an entry method:
+#
+# logger = Logger.new($stdout)
+# logger.add(Logger::INFO, 'My message')
+# # => I, [2022-05-07T18:15:37.647581 #20536] INFO -- : My message
+#
+# For the default entry formatter, Logger::Formatter,
+# the message object may be:
+#
+# - A string: used as-is.
+# - An Exception: message.message is used.
+# - Anything else: message.inspect is used.
+#
+# *Note*: Logger::Formatter does not escape or sanitize
+# the message passed to it.
+# Developers should be aware that malicious data (user input)
+# may be in the message, and should explicitly escape untrusted data.
+#
+# You can use a custom formatter to escape message data;
+# see the example at {formatter=}[Logger.html#attribute-i-formatter].
+#
+# === Program Name
+#
+# The program name is an optional argument to an entry method:
+#
+# logger = Logger.new($stdout)
+# logger.add(Logger::INFO, 'My message', 'mung')
+# # => I, [2022-05-07T18:17:38.084716 #20536] INFO -- mung: My message
+#
+# The default program name for a new logger may be set in the call to
+# Logger.new via optional keyword argument +progname+:
+#
+# logger = Logger.new('t.log', progname: 'mung')
+#
+# The default program name for an existing logger may be set
+# by a call to method #progname=:
+#
+# logger.progname = 'mung'
+#
+# The current program name may be retrieved with method
+# {progname}[Logger.html#attribute-i-progname]:
+#
+# logger.progname # => "mung"
+#
+# == Log Level
+#
+# The log level setting determines whether an entry is actually
+# written to the log, based on the entry's severity.
+#
+# These are the defined severities (least severe to most severe):
+#
+# logger = Logger.new($stdout)
+# logger.add(Logger::DEBUG, 'Maximal debugging info')
+# # => D, [2022-05-07T17:57:41.776220 #20536] DEBUG -- : Maximal debugging info
+# logger.add(Logger::INFO, 'Non-error information')
+# # => I, [2022-05-07T17:59:14.349167 #20536] INFO -- : Non-error information
+# logger.add(Logger::WARN, 'Non-error warning')
+# # => W, [2022-05-07T18:00:45.337538 #20536] WARN -- : Non-error warning
+# logger.add(Logger::ERROR, 'Non-fatal error')
+# # => E, [2022-05-07T18:02:41.592912 #20536] ERROR -- : Non-fatal error
+# logger.add(Logger::FATAL, 'Fatal error')
+# # => F, [2022-05-07T18:05:24.703931 #20536] FATAL -- : Fatal error
+# logger.add(Logger::UNKNOWN, 'Most severe')
+# # => A, [2022-05-07T18:07:54.657491 #20536] ANY -- : Most severe
+#
+# The default initial level setting is Logger::DEBUG, the lowest level,
+# which means that all entries are to be written, regardless of severity:
+#
+# logger = Logger.new($stdout)
+# logger.level # => 0
+# logger.add(0, "My message")
+# # => D, [2022-05-11T15:10:59.773668 #20536] DEBUG -- : My message
+#
+# You can specify a different setting in a new logger
+# using keyword argument +level+ with an appropriate value:
+#
+# logger = Logger.new($stdout, level: Logger::ERROR)
+# logger = Logger.new($stdout, level: 'error')
+# logger = Logger.new($stdout, level: :error)
+# logger.level # => 3
+#
+# With this level, entries with severity Logger::ERROR and higher
+# are written, while those with lower severities are not written:
+#
+# logger = Logger.new($stdout, level: Logger::ERROR)
+# logger.add(3)
+# # => E, [2022-05-11T15:17:20.933362 #20536] ERROR -- : nil
+# logger.add(2) # Silent.
+#
+# You can set the log level for an existing logger
+# with method #level=:
+#
+# logger.level = Logger::ERROR
+#
+# These shorthand methods also set the level:
+#
+# logger.debug! # => 0
+# logger.info! # => 1
+# logger.warn! # => 2
+# logger.error! # => 3
+# logger.fatal! # => 4
+#
+# You can retrieve the log level with method #level.
+#
+# logger.level = Logger::ERROR
+# logger.level # => 3
+#
+# These methods return whether a given
+# level is to be written:
+#
+# logger.level = Logger::ERROR
+# logger.debug? # => false
+# logger.info? # => false
+# logger.warn? # => false
+# logger.error? # => true
+# logger.fatal? # => true
+#
+# == Log File Rotation
+#
+# By default, a log file is a single file that grows indefinitely
+# (until explicitly closed); there is no file rotation.
+#
+# To keep log files to a manageable size,
+# you can use _log_ _file_ _rotation_, which uses multiple log files:
+#
+# - Each log file has entries for a non-overlapping
+# time interval.
+# - Only the most recent log file is open and active;
+# the others are closed and inactive.
+#
+# === Size-Based Rotation
+#
+# For size-based log file rotation, call Logger.new with:
+#
+# - Argument +logdev+ as a file path.
+# - Argument +shift_age+ with a positive integer:
+# the number of log files to be in the rotation.
+# - Argument +shift_size+ as a positive integer:
+# the maximum size (in bytes) of each log file;
+# defaults to 1048576 (1 megabyte).
+#
+# Examples:
+#
+# logger = Logger.new('t.log', 3) # Three 1-megabyte files.
+# logger = Logger.new('t.log', 5, 10485760) # Five 10-megabyte files.
+#
+# For these examples, suppose:
+#
+# logger = Logger.new('t.log', 3)
+#
+# Logging begins in the new log file, +t.log+;
+# the log file is "full" and ready for rotation
+# when a new entry would cause its size to exceed +shift_size+.
+#
+# The first time +t.log+ is full:
+#
+# - +t.log+ is closed and renamed to +t.log.0+.
+# - A new file +t.log+ is opened.
+#
+# The second time +t.log+ is full:
+#
+# - +t.log.0 is renamed as +t.log.1+.
+# - +t.log+ is closed and renamed to +t.log.0+.
+# - A new file +t.log+ is opened.
+#
+# Each subsequent time that +t.log+ is full,
+# the log files are rotated:
+#
+# - +t.log.1+ is removed.
+# - +t.log.0 is renamed as +t.log.1+.
+# - +t.log+ is closed and renamed to +t.log.0+.
+# - A new file +t.log+ is opened.
+#
+# === Periodic Rotation
+#
+# For periodic rotation, call Logger.new with:
+#
+# - Argument +logdev+ as a file path.
+# - Argument +shift_age+ as a string period indicator.
+#
+# Examples:
+#
+# logger = Logger.new('t.log', 'daily') # Rotate log files daily.
+# logger = Logger.new('t.log', 'weekly') # Rotate log files weekly.
+# logger = Logger.new('t.log', 'monthly') # Rotate log files monthly.
+#
+# Example:
+#
+# logger = Logger.new('t.log', 'daily')
+#
+# When the given period expires:
+#
+# - The base log file, +t.log+ is closed and renamed
+# with a date-based suffix such as +t.log.20220509+.
+# - A new log file +t.log+ is opened.
+# - Nothing is removed.
+#
+# The default format for the suffix is '%Y%m%d',
+# which produces a suffix similar to the one above.
+# You can set a different format using create-time option
+# +shift_period_suffix+;
+# see details and suggestions at
+# {Time#strftime}[rdoc-ref:Time#strftime].
+class Logger
+ include ::Logger::Severity
+
+ # :call-seq:
+ # Logger.new(logdev, shift_age = 0, shift_size = 1048576, **options)
+ #
+ # With the single argument +logdev+,
+ # returns a new logger with all default options:
+ #
+ # Logger.new('t.log') # => #
+ #
+ # Argument +logdev+ must be one of:
+ #
+ # - A string filepath: entries are to be written
+ # to the file at that path; if the file at that path exists,
+ # new entries are appended.
+ # - An IO stream (typically +$stdout+, +$stderr+. or an open file):
+ # entries are to be written to the given stream.
+ # - +nil+ or +File::NULL+: no entries are to be written.
+ #
+ # Examples:
+ #
+ # Logger.new('t.log')
+ # Logger.new($stdout)
+ #
+ # The keyword options are:
+ #
+ # - +level+: sets the log level; default value is Logger::DEBUG.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level]:
+ #
+ # Logger.new('t.log', level: Logger::ERROR)
+ #
+ # - +progname+: sets the default program name; default is +nil+.
+ # See {Program Name}[rdoc-ref:Logger@Program+Name]:
+ #
+ # Logger.new('t.log', progname: 'mung')
+ #
+ # - +formatter+: sets the entry formatter; default is +nil+.
+ # See {formatter=}[Logger.html#attribute-i-formatter].
+ # - +datetime_format+: sets the format for entry timestamp;
+ # default is +nil+.
+ # See #datetime_format=.
+ # - +binmode+: sets whether the logger writes in binary mode;
+ # default is +false+.
+ # - +shift_period_suffix+: sets the format for the filename suffix
+ # for periodic log file rotation; default is '%Y%m%d'.
+ # See {Periodic Rotation}[rdoc-ref:Logger@Periodic+Rotation].
+ #
+ # @return [Logger] a new instance of Logger
+ #
+ # source://logger//logger.rb#578
+ def initialize(logdev, shift_age = T.unsafe(nil), shift_size = T.unsafe(nil), level: T.unsafe(nil), progname: T.unsafe(nil), formatter: T.unsafe(nil), datetime_format: T.unsafe(nil), binmode: T.unsafe(nil), shift_period_suffix: T.unsafe(nil)); end
+
+ # Writes the given +msg+ to the log with no formatting;
+ # returns the number of characters written,
+ # or +nil+ if no log device exists:
+ #
+ # logger = Logger.new($stdout)
+ # logger << 'My message.' # => 10
+ #
+ # Output:
+ #
+ # My message.
+ #
+ # source://logger//logger.rb#684
+ def <<(msg); end
+
+ # Creates a log entry, which may or may not be written to the log,
+ # depending on the entry's severity and on the log level.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level]
+ # and {Entries}[rdoc-ref:Logger@Entries] for details.
+ #
+ # Examples:
+ #
+ # logger = Logger.new($stdout, progname: 'mung')
+ # logger.add(Logger::INFO)
+ # logger.add(Logger::ERROR, 'No good')
+ # logger.add(Logger::ERROR, 'No good', 'gnum')
+ #
+ # Output:
+ #
+ # I, [2022-05-12T16:25:31.469726 #36328] INFO -- mung: mung
+ # E, [2022-05-12T16:25:55.349414 #36328] ERROR -- mung: No good
+ # E, [2022-05-12T16:26:35.841134 #36328] ERROR -- gnum: No good
+ #
+ # These convenience methods have implicit severity:
+ #
+ # - #debug.
+ # - #info.
+ # - #warn.
+ # - #error.
+ # - #fatal.
+ # - #unknown.
+ #
+ # source://logger//logger.rb#651
+ def add(severity, message = T.unsafe(nil), progname = T.unsafe(nil)); end
+
+ # Closes the logger; returns +nil+:
+ #
+ # logger = Logger.new('t.log')
+ # logger.close # => nil
+ # logger.info('foo') # Prints "log writing failed. closed stream"
+ #
+ # Related: Logger#reopen.
+ #
+ # source://logger//logger.rb#731
+ def close; end
+
+ # Returns the date-time format; see #datetime_format=.
+ #
+ # source://logger//logger.rb#438
+ def datetime_format; end
+
+ # Sets the date-time format.
+ #
+ # Argument +datetime_format+ should be either of these:
+ #
+ # - A string suitable for use as a format for method
+ # {Time#strftime}[rdoc-ref:Time#strftime].
+ # - +nil+: the logger uses '%Y-%m-%dT%H:%M:%S.%6N'.
+ #
+ # source://logger//logger.rb#432
+ def datetime_format=(datetime_format); end
+
+ # Equivalent to calling #add with severity Logger::DEBUG.
+ #
+ # source://logger//logger.rb#690
+ def debug(progname = T.unsafe(nil), &block); end
+
+ # Sets the log level to Logger::DEBUG.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level].
+ #
+ # source://logger//logger.rb#487
+ def debug!; end
+
+ # Returns +true+ if the log level allows entries with severity
+ # Logger::DEBUG to be written, +false+ otherwise.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level].
+ #
+ # @return [Boolean]
+ #
+ # source://logger//logger.rb#482
+ def debug?; end
+
+ # Equivalent to calling #add with severity Logger::ERROR.
+ #
+ # source://logger//logger.rb#708
+ def error(progname = T.unsafe(nil), &block); end
+
+ # Sets the log level to Logger::ERROR.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level].
+ #
+ # source://logger//logger.rb#520
+ def error!; end
+
+ # Returns +true+ if the log level allows entries with severity
+ # Logger::ERROR to be written, +false+ otherwise.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level].
+ #
+ # @return [Boolean]
+ #
+ # source://logger//logger.rb#515
+ def error?; end
+
+ # Equivalent to calling #add with severity Logger::FATAL.
+ #
+ # source://logger//logger.rb#714
+ def fatal(progname = T.unsafe(nil), &block); end
+
+ # Sets the log level to Logger::FATAL.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level].
+ #
+ # source://logger//logger.rb#531
+ def fatal!; end
+
+ # Returns +true+ if the log level allows entries with severity
+ # Logger::FATAL to be written, +false+ otherwise.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level].
+ #
+ # @return [Boolean]
+ #
+ # source://logger//logger.rb#526
+ def fatal?; end
+
+ # Sets or retrieves the logger entry formatter proc.
+ #
+ # When +formatter+ is +nil+, the logger uses Logger::Formatter.
+ #
+ # When +formatter+ is a proc, a new entry is formatted by the proc,
+ # which is called with four arguments:
+ #
+ # - +severity+: The severity of the entry.
+ # - +time+: A Time object representing the entry's timestamp.
+ # - +progname+: The program name for the entry.
+ # - +msg+: The message for the entry (string or string-convertible object).
+ #
+ # The proc should return a string containing the formatted entry.
+ #
+ # This custom formatter uses
+ # {String#dump}[rdoc-ref:String#dump]
+ # to escape the message string:
+ #
+ # logger = Logger.new($stdout, progname: 'mung')
+ # original_formatter = logger.formatter || Logger::Formatter.new
+ # logger.formatter = proc { |severity, time, progname, msg|
+ # original_formatter.call(severity, time, progname, msg.dump)
+ # }
+ # logger.add(Logger::INFO, "hello \n ''")
+ # logger.add(Logger::INFO, "\f\x00\xff\\\"")
+ #
+ # Output:
+ #
+ # I, [2022-05-13T13:16:29.637488 #8492] INFO -- mung: "hello \n ''"
+ # I, [2022-05-13T13:16:29.637610 #8492] INFO -- mung: "\f\x00\xFF\\\""
+ #
+ # source://logger//logger.rb#473
+ def formatter; end
+
+ # Sets or retrieves the logger entry formatter proc.
+ #
+ # When +formatter+ is +nil+, the logger uses Logger::Formatter.
+ #
+ # When +formatter+ is a proc, a new entry is formatted by the proc,
+ # which is called with four arguments:
+ #
+ # - +severity+: The severity of the entry.
+ # - +time+: A Time object representing the entry's timestamp.
+ # - +progname+: The program name for the entry.
+ # - +msg+: The message for the entry (string or string-convertible object).
+ #
+ # The proc should return a string containing the formatted entry.
+ #
+ # This custom formatter uses
+ # {String#dump}[rdoc-ref:String#dump]
+ # to escape the message string:
+ #
+ # logger = Logger.new($stdout, progname: 'mung')
+ # original_formatter = logger.formatter || Logger::Formatter.new
+ # logger.formatter = proc { |severity, time, progname, msg|
+ # original_formatter.call(severity, time, progname, msg.dump)
+ # }
+ # logger.add(Logger::INFO, "hello \n ''")
+ # logger.add(Logger::INFO, "\f\x00\xff\\\"")
+ #
+ # Output:
+ #
+ # I, [2022-05-13T13:16:29.637488 #8492] INFO -- mung: "hello \n ''"
+ # I, [2022-05-13T13:16:29.637610 #8492] INFO -- mung: "\f\x00\xFF\\\""
+ #
+ # source://logger//logger.rb#473
+ def formatter=(_arg0); end
+
+ # Equivalent to calling #add with severity Logger::INFO.
+ #
+ # source://logger//logger.rb#696
+ def info(progname = T.unsafe(nil), &block); end
+
+ # Sets the log level to Logger::INFO.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level].
+ #
+ # source://logger//logger.rb#498
+ def info!; end
+
+ # Returns +true+ if the log level allows entries with severity
+ # Logger::INFO to be written, +false+ otherwise.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level].
+ #
+ # @return [Boolean]
+ #
+ # source://logger//logger.rb#493
+ def info?; end
+
+ # Logging severity threshold (e.g. Logger::INFO).
+ #
+ # source://logger//logger.rb#383
+ def level; end
+
+ # Sets the log level; returns +severity+.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level].
+ #
+ # Argument +severity+ may be an integer, a string, or a symbol:
+ #
+ # logger.level = Logger::ERROR # => 3
+ # logger.level = 3 # => 3
+ # logger.level = 'error' # => "error"
+ # logger.level = :error # => :error
+ #
+ # Logger#sev_threshold= is an alias for Logger#level=.
+ #
+ # source://logger//logger.rb#399
+ def level=(severity); end
+
+ # Creates a log entry, which may or may not be written to the log,
+ # depending on the entry's severity and on the log level.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level]
+ # and {Entries}[rdoc-ref:Logger@Entries] for details.
+ #
+ # Examples:
+ #
+ # logger = Logger.new($stdout, progname: 'mung')
+ # logger.add(Logger::INFO)
+ # logger.add(Logger::ERROR, 'No good')
+ # logger.add(Logger::ERROR, 'No good', 'gnum')
+ #
+ # Output:
+ #
+ # I, [2022-05-12T16:25:31.469726 #36328] INFO -- mung: mung
+ # E, [2022-05-12T16:25:55.349414 #36328] ERROR -- mung: No good
+ # E, [2022-05-12T16:26:35.841134 #36328] ERROR -- gnum: No good
+ #
+ # These convenience methods have implicit severity:
+ #
+ # - #debug.
+ # - #info.
+ # - #warn.
+ # - #error.
+ # - #fatal.
+ # - #unknown.
+ #
+ # source://logger//logger.rb#651
+ def log(severity, message = T.unsafe(nil), progname = T.unsafe(nil)); end
+
+ # Program name to include in log messages.
+ #
+ # source://logger//logger.rb#422
+ def progname; end
+
+ # Program name to include in log messages.
+ #
+ # source://logger//logger.rb#422
+ def progname=(_arg0); end
+
+ # Sets the logger's output stream:
+ #
+ # - If +logdev+ is +nil+, reopens the current output stream.
+ # - If +logdev+ is a filepath, opens the indicated file for append.
+ # - If +logdev+ is an IO stream
+ # (usually $stdout, $stderr, or an open File object),
+ # opens the stream for append.
+ #
+ # Example:
+ #
+ # logger = Logger.new('t.log')
+ # logger.add(Logger::ERROR, 'one')
+ # logger.close
+ # logger.add(Logger::ERROR, 'two') # Prints 'log writing failed. closed stream'
+ # logger.reopen
+ # logger.add(Logger::ERROR, 'three')
+ # logger.close
+ # File.readlines('t.log')
+ # # =>
+ # # ["# Logfile created on 2022-05-12 14:21:19 -0500 by logger.rb/v1.5.0\n",
+ # # "E, [2022-05-12T14:21:27.596726 #22428] ERROR -- : one\n",
+ # # "E, [2022-05-12T14:23:05.847241 #22428] ERROR -- : three\n"]
+ #
+ # source://logger//logger.rb#619
+ def reopen(logdev = T.unsafe(nil)); end
+
+ # Logging severity threshold (e.g. Logger::INFO).
+ #
+ # source://logger//logger.rb#383
+ def sev_threshold; end
+
+ # Sets the log level; returns +severity+.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level].
+ #
+ # Argument +severity+ may be an integer, a string, or a symbol:
+ #
+ # logger.level = Logger::ERROR # => 3
+ # logger.level = 3 # => 3
+ # logger.level = 'error' # => "error"
+ # logger.level = :error # => :error
+ #
+ # Logger#sev_threshold= is an alias for Logger#level=.
+ #
+ # source://logger//logger.rb#399
+ def sev_threshold=(severity); end
+
+ # Equivalent to calling #add with severity Logger::UNKNOWN.
+ #
+ # source://logger//logger.rb#720
+ def unknown(progname = T.unsafe(nil), &block); end
+
+ # Equivalent to calling #add with severity Logger::WARN.
+ #
+ # source://logger//logger.rb#702
+ def warn(progname = T.unsafe(nil), &block); end
+
+ # Sets the log level to Logger::WARN.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level].
+ #
+ # source://logger//logger.rb#509
+ def warn!; end
+
+ # Returns +true+ if the log level allows entries with severity
+ # Logger::WARN to be written, +false+ otherwise.
+ # See {Log Level}[rdoc-ref:Logger@Log+Level].
+ #
+ # @return [Boolean]
+ #
+ # source://logger//logger.rb#504
+ def warn?; end
+
+ # Adjust the log level during the block execution for the current Fiber only
+ #
+ # logger.with_level(:debug) do
+ # logger.debug { "Hello" }
+ # end
+ #
+ # source://logger//logger.rb#408
+ def with_level(severity); end
+
+ private
+
+ # source://logger//logger.rb#744
+ def format_message(severity, datetime, progname, msg); end
+
+ # source://logger//logger.rb#740
+ def format_severity(severity); end
+end
+
+# Default formatter for log messages.
+class Logger::Formatter
+ # @return [Formatter] a new instance of Formatter
+ #
+ # source://logger//logger/formatter.rb#11
+ def initialize; end
+
+ # source://logger//logger/formatter.rb#15
+ def call(severity, time, progname, msg); end
+
+ # Returns the value of attribute datetime_format.
+ #
+ # source://logger//logger/formatter.rb#9
+ def datetime_format; end
+
+ # Sets the attribute datetime_format
+ #
+ # @param value the value to set the attribute datetime_format to.
+ #
+ # source://logger//logger/formatter.rb#9
+ def datetime_format=(_arg0); end
+
+ private
+
+ # source://logger//logger/formatter.rb#21
+ def format_datetime(time); end
+
+ # source://logger//logger/formatter.rb#25
+ def msg2str(msg); end
+end
+
+# source://logger//logger/formatter.rb#7
+Logger::Formatter::DatetimeFormat = T.let(T.unsafe(nil), String)
+
+# source://logger//logger/formatter.rb#6
+Logger::Formatter::Format = T.let(T.unsafe(nil), String)
+
+# Device used for logging messages.
+class Logger::LogDevice
+ include ::Logger::Period
+ include ::MonitorMixin
+
+ # @return [LogDevice] a new instance of LogDevice
+ #
+ # source://logger//logger/log_device.rb#14
+ def initialize(log = T.unsafe(nil), shift_age: T.unsafe(nil), shift_size: T.unsafe(nil), shift_period_suffix: T.unsafe(nil), binmode: T.unsafe(nil)); end
+
+ # source://logger//logger/log_device.rb#52
+ def close; end
+
+ # Returns the value of attribute dev.
+ #
+ # source://logger//logger/log_device.rb#10
+ def dev; end
+
+ # Returns the value of attribute filename.
+ #
+ # source://logger//logger/log_device.rb#11
+ def filename; end
+
+ # source://logger//logger/log_device.rb#62
+ def reopen(log = T.unsafe(nil)); end
+
+ # source://logger//logger/log_device.rb#31
+ def write(message); end
+
+ private
+
+ # source://logger//logger/log_device.rb#119
+ def add_log_header(file); end
+
+ # source://logger//logger/log_device.rb#125
+ def check_shift_log; end
+
+ # source://logger//logger/log_device.rb#103
+ def create_logfile(filename); end
+
+ # source://logger//logger/log_device.rb#145
+ def lock_shift_log; end
+
+ # source://logger//logger/log_device.rb#95
+ def open_logfile(filename); end
+
+ # source://logger//logger/log_device.rb#79
+ def set_dev(log); end
+
+ # source://logger//logger/log_device.rb#176
+ def shift_log_age; end
+
+ # source://logger//logger/log_device.rb#188
+ def shift_log_period(period_end); end
+end
+
+module Logger::Period
+ private
+
+ # source://logger//logger/period.rb#9
+ def next_rotate_time(now, shift_age); end
+
+ # source://logger//logger/period.rb#31
+ def previous_period_end(now, shift_age); end
+
+ class << self
+ # source://logger//logger/period.rb#9
+ def next_rotate_time(now, shift_age); end
+
+ # source://logger//logger/period.rb#31
+ def previous_period_end(now, shift_age); end
+ end
+end
+
+# source://logger//logger/period.rb#7
+Logger::Period::SiD = T.let(T.unsafe(nil), Integer)
+
+# \Severity label for logging (max 5 chars).
+#
+# source://logger//logger.rb#738
+Logger::SEV_LABEL = T.let(T.unsafe(nil), Array)
+
+# Logging severity.
+module Logger::Severity
+ class << self
+ # source://logger//logger/severity.rb#29
+ def coerce(severity); end
+ end
+end
+
+# source://logger//logger/severity.rb#19
+Logger::Severity::LEVELS = T.let(T.unsafe(nil), Hash)
diff --git a/sorbet/rbi/gems/rack-protection@3.2.0.rbi b/sorbet/rbi/gems/rack-protection@4.0.0.rbi
similarity index 77%
rename from sorbet/rbi/gems/rack-protection@3.2.0.rbi
rename to sorbet/rbi/gems/rack-protection@4.0.0.rbi
index 0832cf21e..33f7c0d41 100644
--- a/sorbet/rbi/gems/rack-protection@3.2.0.rbi
+++ b/sorbet/rbi/gems/rack-protection@4.0.0.rbi
@@ -8,18 +8,15 @@
# source://rack-protection//lib/rack/protection/version.rb#3
module Rack
class << self
- # source://rack/2.2.9/lib/rack/version.rb#26
+ # source://rack/3.1.7/lib/rack/version.rb#18
def release; end
-
- # source://rack/2.2.9/lib/rack/version.rb#19
- def version; end
end
end
# source://rack-protection//lib/rack/protection/version.rb#4
module Rack::Protection
class << self
- # source://rack-protection//lib/rack/protection.rb#28
+ # source://rack-protection//lib/rack/protection.rb#26
def new(app, options = T.unsafe(nil)); end
end
end
@@ -67,6 +64,7 @@ end
# Here is server.rb:
#
# require 'rack/protection'
+# require 'rack/session'
#
# app = Rack::Builder.app do
# use Rack::Session::Cookie, secret: 'secret'
@@ -111,71 +109,71 @@ end
# :authenticity_param option:
# use Rack::Protection::AuthenticityToken, authenticity_param: 'your_token_param_name'
#
-# source://rack-protection//lib/rack/protection/authenticity_token.rb#97
+# source://rack-protection//lib/rack/protection/authenticity_token.rb#98
class Rack::Protection::AuthenticityToken < ::Rack::Protection::Base
# @return [Boolean]
#
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#112
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#113
def accepts?(env); end
# source://rack-protection//lib/rack/protection/base.rb#24
def default_options; end
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#124
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#125
def mask_authenticity_token(session, path: T.unsafe(nil), method: T.unsafe(nil)); end
private
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#206
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#207
def compare_with_global_token(token, session); end
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#210
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#211
def compare_with_per_form_token(token, session, request); end
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#202
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#203
def compare_with_real_token(token, session); end
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#231
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#232
def decode_token(token); end
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#227
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#228
def encode_token(token); end
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#219
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#220
def global_token(session); end
# Creates a masked version of the authenticity token that varies
# on each request. The masking is used to mitigate SSL attacks
# like BREACH.
#
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#177
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#178
def mask_token(token); end
# @return [Boolean]
#
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#198
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#199
def masked_token?(token); end
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#223
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#224
def per_form_token(session, path, method); end
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#215
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#216
def real_token(session); end
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#141
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#142
def set_token(session); end
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#235
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#236
def token_hmac(session, identifier); end
# Essentially the inverse of +mask_token+.
#
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#185
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#186
def unmask_token(masked_token); end
# @return [Boolean]
#
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#194
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#195
def unmasked_token?(token); end
# Checks the client's masked token to see if it matches the
@@ -183,25 +181,25 @@ class Rack::Protection::AuthenticityToken < ::Rack::Protection::Base
#
# @return [Boolean]
#
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#147
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#148
def valid_token?(env, token); end
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#243
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#244
def xor_byte_strings(s1, s2); end
class << self
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#108
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#109
def random_token; end
- # source://rack-protection//lib/rack/protection/authenticity_token.rb#104
+ # source://rack-protection//lib/rack/protection/authenticity_token.rb#105
def token(session, path: T.unsafe(nil), method: T.unsafe(nil)); end
end
end
-# source://rack-protection//lib/rack/protection/authenticity_token.rb#136
+# source://rack-protection//lib/rack/protection/authenticity_token.rb#137
Rack::Protection::AuthenticityToken::GLOBAL_TOKEN_IDENTIFIER = T.let(T.unsafe(nil), String)
-# source://rack-protection//lib/rack/protection/authenticity_token.rb#98
+# source://rack-protection//lib/rack/protection/authenticity_token.rb#99
Rack::Protection::AuthenticityToken::TOKEN_LENGTH = T.let(T.unsafe(nil), Integer)
# source://rack-protection//lib/rack/protection/base.rb#11
@@ -320,7 +318,7 @@ Rack::Protection::Base::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
# https://scotthelme.co.uk/csp-cheat-sheet/
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/
#
-# Sets the 'Content-Security-Policy[-Report-Only]' header.
+# Sets the 'content-security-policy[-report-only]' header.
#
# Options: ContentSecurityPolicy configuration is a complex topic with
# several levels of support that has evolved over time.
@@ -391,190 +389,6 @@ class Rack::Protection::CookieTossing < ::Rack::Protection::Base
def session_key; end
end
-# Rack::Protection::EncryptedCookie provides simple cookie based session management.
-# By default, the session is a Ruby Hash stored as base64 encoded marshalled
-# data set to :key (default: rack.session). The object that encodes the
-# session data is configurable and must respond to +encode+ and +decode+.
-# Both methods must take a string and return a string.
-#
-# When the secret key is set, cookie data is checked for data integrity.
-# The old_secret key is also accepted and allows graceful secret rotation.
-# A legacy_hmac_secret is also accepted and is used to upgrade existing
-# sessions to the new encryption scheme.
-#
-# There is also a legacy_hmac_coder option which can be set if a non-default
-# coder was used for legacy session cookies.
-#
-# Example:
-#
-# use Rack::Protection::EncryptedCookie,
-# :key => 'rack.session',
-# :domain => 'foo.com',
-# :path => '/',
-# :expire_after => 2592000,
-# :secret => 'change_me',
-# :old_secret => 'old_secret'
-#
-# All parameters are optional.
-#
-# Example using legacy HMAC options
-#
-# Rack::Protection:EncryptedCookie.new(application, {
-# # The secret used for legacy HMAC cookies
-# legacy_hmac_secret: 'legacy secret',
-# # legacy_hmac_coder will default to Rack::Protection::EncryptedCookie::Base64::Marshal
-# legacy_hmac_coder: Rack::Protection::EncryptedCookie::Identity.new,
-# # legacy_hmac will default to OpenSSL::Digest::SHA1
-# legacy_hmac: OpenSSL::Digest::SHA256
-# })
-#
-#
-# Rack::Protection::EncryptedCookie.new(application, {
-# :coder => Rack::Protection::EncryptedCookie::Identity.new
-# })
-#
-#
-# Rack::Protection::EncryptedCookie.new(application, {
-# :coder => Class.new {
-# def encode(str); str.reverse; end
-# def decode(str); str.reverse; end
-# }.new
-# })
-#
-# source://rack-protection//lib/rack/protection/encrypted_cookie.rb#64
-class Rack::Protection::EncryptedCookie < ::Rack::Session::Abstract::Persisted
- # @return [EncryptedCookie] a new instance of EncryptedCookie
- #
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#143
- def initialize(app, options = T.unsafe(nil)); end
-
- # Returns the value of attribute coder.
- #
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#141
- def coder; end
-
- private
-
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#252
- def delete_session(_req, _session_id, options); end
-
- # @return [Boolean]
- #
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#257
- def digest_match?(data, digest); end
-
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#200
- def extract_session_id(request); end
-
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#194
- def find_session(req, _sid); end
-
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#263
- def generate_hmac(data); end
-
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#230
- def persistent_session_id!(data, sid = T.unsafe(nil)); end
-
- # @return [Boolean]
- #
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#267
- def secure?(options); end
-
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#204
- def unpacked_cookie_data(request); end
-
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#236
- def write_session(req, session_id, session, _options); end
-end
-
-# Encode session cookies as Base64
-#
-# source://rack-protection//lib/rack/protection/encrypted_cookie.rb#66
-class Rack::Protection::EncryptedCookie::Base64
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#71
- def decode(str); end
-
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#67
- def encode(str); end
-end
-
-# N.B. Unlike other encoding methods, the contained objects must be a
-# valid JSON composite type, either a Hash or an Array.
-#
-# source://rack-protection//lib/rack/protection/encrypted_cookie.rb#94
-class Rack::Protection::EncryptedCookie::Base64::JSON < ::Rack::Protection::EncryptedCookie::Base64
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#99
- def decode(str); end
-
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#95
- def encode(obj); end
-end
-
-# Encode session cookies as Marshaled Base64 data
-#
-# source://rack-protection//lib/rack/protection/encrypted_cookie.rb#76
-class Rack::Protection::EncryptedCookie::Base64::Marshal < ::Rack::Protection::EncryptedCookie::Base64
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#81
- def decode(str); end
-
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#77
- def encode(str); end
-end
-
-# source://rack-protection//lib/rack/protection/encrypted_cookie.rb#110
-class Rack::Protection::EncryptedCookie::Base64::ZipJSON < ::Rack::Protection::EncryptedCookie::Base64
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#115
- def decode(str); end
-
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#111
- def encode(obj); end
-end
-
-# Use no encoding for session cookies
-#
-# source://rack-protection//lib/rack/protection/encrypted_cookie.rb#126
-class Rack::Protection::EncryptedCookie::Identity
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#128
- def decode(str); end
-
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#127
- def encode(str); end
-end
-
-# source://rack-protection//lib/rack/protection/encrypted_cookie.rb#131
-class Rack::Protection::EncryptedCookie::Marshal
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#136
- def decode(str); end
-
- # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#132
- def encode(str); end
-end
-
-# source://rack-protection//lib/rack/protection/encryptor.rb#7
-module Rack::Protection::Encryptor
- class << self
- # source://rack-protection//lib/rack/protection/encryptor.rb#15
- def base64_decode(str); end
-
- # source://rack-protection//lib/rack/protection/encryptor.rb#11
- def base64_encode(str); end
-
- # source://rack-protection//lib/rack/protection/encryptor.rb#38
- def decrypt_message(data, secret); end
-
- # @raise [ArgumentError]
- #
- # source://rack-protection//lib/rack/protection/encryptor.rb#19
- def encrypt_message(data, secret, auth_data = T.unsafe(nil)); end
- end
-end
-
-# source://rack-protection//lib/rack/protection/encryptor.rb#8
-Rack::Protection::Encryptor::CIPHER = T.let(T.unsafe(nil), String)
-
-# source://rack-protection//lib/rack/protection/encryptor.rb#9
-Rack::Protection::Encryptor::DELIMITER = T.let(T.unsafe(nil), String)
-
# Prevented attack:: XSS
# Supported browsers:: all
# More infos:: http://en.wikipedia.org/wiki/Cross-site_scripting
@@ -614,12 +428,11 @@ class Rack::Protection::EscapedParams < ::Rack::Protection::Base
def handle(hash); end
class << self
- # source://rack/2.2.9/lib/rack/utils.rb#184
- def escape_html(string); end
+ def escape_html(_arg0); end
private
- # source://rack/2.2.9/lib/rack/utils.rb#38
+ # source://rack/3.1.7/lib/rack/utils.rb#39
def escape_url(s); end
end
end
diff --git a/sorbet/rbi/gems/rack-session@1.0.2.rbi b/sorbet/rbi/gems/rack-session@1.0.2.rbi
deleted file mode 100644
index 677dc7a64..000000000
--- a/sorbet/rbi/gems/rack-session@1.0.2.rbi
+++ /dev/null
@@ -1,9 +0,0 @@
-# typed: true
-
-# DO NOT EDIT MANUALLY
-# This is an autogenerated file for types exported from the `rack-session` gem.
-# Please instead update this file by running `bin/tapioca gem rack-session`.
-
-
-# THIS IS AN EMPTY RBI FILE.
-# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
diff --git a/sorbet/rbi/gems/rack-session@2.0.0.rbi b/sorbet/rbi/gems/rack-session@2.0.0.rbi
new file mode 100644
index 000000000..47eedb1d1
--- /dev/null
+++ b/sorbet/rbi/gems/rack-session@2.0.0.rbi
@@ -0,0 +1,727 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `rack-session` gem.
+# Please instead update this file by running `bin/tapioca gem rack-session`.
+
+
+# source://rack-session//lib/rack/session/constants.rb#7
+module Rack
+ class << self
+ # source://rack/3.1.7/lib/rack/version.rb#18
+ def release; end
+ end
+end
+
+# source://rack-session//lib/rack/session/constants.rb#8
+module Rack::Session; end
+
+# source://rack-session//lib/rack/session/abstract/id.rb#47
+module Rack::Session::Abstract; end
+
+# source://rack-session//lib/rack/session/abstract/id.rb#497
+class Rack::Session::Abstract::ID < ::Rack::Session::Abstract::Persisted
+ # All thread safety and session destroy procedures should occur here.
+ # Should return a new session id or nil if options[:drop]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#527
+ def delete_session(req, sid, options); end
+
+ # All thread safety and session retrieval procedures should occur here.
+ # Should return [session_id, session].
+ # If nil is provided as the session id, generation of a new valid id
+ # should occur within.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#512
+ def find_session(req, sid); end
+
+ # All thread safety and session storage procedures should occur here.
+ # Must return the session id if the session was saved successfully, or
+ # false if the session could not be saved.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#520
+ def write_session(req, sid, session, options); end
+
+ class << self
+ # @private
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#498
+ def inherited(klass); end
+ end
+end
+
+# ID sets up a basic framework for implementing an id based sessioning
+# service. Cookies sent to the client for maintaining sessions will only
+# contain an id reference. Only #find_session, #write_session and
+# #delete_session are required to be overwritten.
+#
+# All parameters are optional.
+# * :key determines the name of the cookie, by default it is
+# 'rack.session'
+# * :path, :domain, :expire_after, :secure, :httponly, and :same_site set
+# the related cookie options as by Rack::Response#set_cookie
+# * :skip will not a set a cookie in the response nor update the session state
+# * :defer will not set a cookie in the response but still update the session
+# state if it is used with a backend
+# * :renew (implementation dependent) will prompt the generation of a new
+# session id, and migration of data to be referenced at the new id. If
+# :defer is set, it will be overridden and the cookie will be set.
+# * :sidbits sets the number of bits in length that a generated session
+# id will be.
+#
+# These options can be set on a per request basis, at the location of
+# env['rack.session.options']. Additionally the id of the
+# session can be found within the options hash at the key :id. It is
+# highly not recommended to change its value.
+#
+# Is Rack::Utils::Context compatible.
+#
+# Not included by default; you must require 'rack/session/abstract/id'
+# to use.
+#
+# source://rack-session//lib/rack/session/abstract/id.rb#239
+class Rack::Session::Abstract::Persisted
+ # @return [Persisted] a new instance of Persisted
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#256
+ def initialize(app, options = T.unsafe(nil)); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#265
+ def call(env); end
+
+ # Acquires the session from the environment and the session id from
+ # the session options and passes them to #write_session. If successful
+ # and the :defer option is not true, a cookie will be added to the
+ # response with the session's id.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#379
+ def commit_session(req, res); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#269
+ def context(env, app = T.unsafe(nil)); end
+
+ # Returns the value of attribute default_options.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#254
+ def default_options; end
+
+ # Returns the value of attribute key.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#254
+ def key; end
+
+ # Returns the value of attribute same_site.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#254
+ def same_site; end
+
+ # Returns the value of attribute sid_secure.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#254
+ def sid_secure; end
+
+ private
+
+ # Session should be committed if it was loaded, any of specific options like :renew, :drop
+ # or :expire_after was given and the security permissions match. Skips if skip is given.
+ #
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#348
+ def commit_session?(req, session, options); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#414
+ def cookie_value(data); end
+
+ # Returns the current session id from the SessionHash.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#334
+ def current_session_id(req); end
+
+ # All thread safety and session destroy procedures should occur here.
+ # Should return a new session id or nil if options[:drop]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#453
+ def delete_session(req, sid, options); end
+
+ # Extract session id from request object.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#326
+ def extract_session_id(request); end
+
+ # All thread safety and session retrieval procedures should occur here.
+ # Should return [session_id, session].
+ # If nil is provided as the session id, generation of a new valid id
+ # should occur within.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#438
+ def find_session(env, sid); end
+
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#365
+ def force_options?(options); end
+
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#361
+ def forced_session_update?(session, options); end
+
+ # Generate a new session id using Ruby #rand. The size of the
+ # session id is controlled by the :sidbits option.
+ # Monkey patch this to use custom methods for session id generation.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#294
+ def generate_sid(secure = T.unsafe(nil)); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#284
+ def initialize_sid; end
+
+ # Extracts the session id from provided cookies and passes it and the
+ # environment to #find_session.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#318
+ def load_session(req); end
+
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#357
+ def loaded_session?(session); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#280
+ def make_request(env); end
+
+ # Sets the lazy session at 'rack.session' and places options and session
+ # metadata into 'rack.session.options'.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#307
+ def prepare_session(req); end
+
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#369
+ def security_matches?(request, options); end
+
+ # Allow subclasses to prepare_session for different Session classes
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#429
+ def session_class; end
+
+ # Check if the session exists or not.
+ #
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#340
+ def session_exists?(req); end
+
+ # Sets the cookie back to the client with session id. We skip the cookie
+ # setting if the value didn't change (sid is the same) or expires was given.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#421
+ def set_cookie(request, response, cookie); end
+
+ # All thread safety and session storage procedures should occur here.
+ # Must return the session id if the session was saved successfully, or
+ # false if the session could not be saved.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#446
+ def write_session(req, sid, session, options); end
+end
+
+# source://rack-session//lib/rack/session/abstract/id.rb#240
+Rack::Session::Abstract::Persisted::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
+
+# source://rack-session//lib/rack/session/abstract/id.rb#458
+class Rack::Session::Abstract::PersistedSecure < ::Rack::Session::Abstract::Persisted
+ # source://rack-session//lib/rack/session/abstract/id.rb#481
+ def extract_session_id(*_arg0); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#475
+ def generate_sid(*_arg0); end
+
+ private
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#492
+ def cookie_value(data); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#488
+ def session_class; end
+end
+
+# source://rack-session//lib/rack/session/abstract/id.rb#459
+class Rack::Session::Abstract::PersistedSecure::SecureSessionHash < ::Rack::Session::Abstract::SessionHash
+ # source://rack-session//lib/rack/session/abstract/id.rb#460
+ def [](key); end
+end
+
+# SessionHash is responsible to lazily load the session from store.
+#
+# source://rack-session//lib/rack/session/abstract/id.rb#50
+class Rack::Session::Abstract::SessionHash
+ include ::Enumerable
+
+ # @return [SessionHash] a new instance of SessionHash
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#68
+ def initialize(store, req); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#88
+ def [](key); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#114
+ def []=(key, value); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#120
+ def clear; end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#146
+ def delete(key); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#125
+ def destroy; end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#93
+ def dig(key, *keys); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#83
+ def each(&block); end
+
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#169
+ def empty?; end
+
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#159
+ def exists?; end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#98
+ def fetch(key, default = T.unsafe(nil), &block); end
+
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#107
+ def has_key?(key); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#74
+ def id; end
+
+ # Sets the attribute id
+ #
+ # @param value the value to set the attribute id to.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#52
+ def id=(_arg0); end
+
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#107
+ def include?(key); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#151
+ def inspect; end
+
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#107
+ def key?(key); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#174
+ def keys; end
+
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#165
+ def loaded?; end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#135
+ def merge!(hash); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#79
+ def options; end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#141
+ def replace(hash); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#114
+ def store(key, value); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#130
+ def to_hash; end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#135
+ def update(hash); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#179
+ def values; end
+
+ private
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#194
+ def load!; end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#186
+ def load_for_read!; end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#190
+ def load_for_write!; end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#200
+ def stringify_keys(other); end
+
+ class << self
+ # source://rack-session//lib/rack/session/abstract/id.rb#56
+ def find(req); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#60
+ def set(req, session); end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#64
+ def set_options(req, options); end
+ end
+end
+
+# source://rack-session//lib/rack/session/abstract/id.rb#54
+Rack::Session::Abstract::SessionHash::Unspecified = T.let(T.unsafe(nil), Object)
+
+# Rack::Session::Cookie provides simple cookie based session management.
+# By default, the session is a Ruby Hash that is serialized and encoded as
+# a cookie set to :key (default: rack.session).
+#
+# This middleware accepts a :secrets option which enables encryption of
+# session cookies. This option should be one or more random "secret keys"
+# that are each at least 64 bytes in length. Multiple secret keys can be
+# supplied in an Array, which is useful when rotating secrets.
+#
+# Several options are also accepted that are passed to Rack::Session::Encryptor.
+# These options include:
+# * :serialize_json
+# Use JSON for message serialization instead of Marshal. This can be
+# viewed as a security enhancement.
+# * :gzip_over
+# For message data over this many bytes, compress it with the deflate
+# algorithm.
+#
+# Refer to Rack::Session::Encryptor for more details on these options.
+#
+# Prior to version TODO, the session hash was stored as base64 encoded
+# marshalled data. When a :secret option was supplied, the integrity of the
+# encoded data was protected with HMAC-SHA1. This functionality is still
+# supported using a set of a legacy options.
+#
+# Lastly, a :coder option is also accepted. When used, both encryption and
+# the legacy HMAC will be skipped. This option could create security issues
+# in your application!
+#
+# Example:
+#
+# use Rack::Session::Cookie, {
+# key: 'rack.session',
+# domain: 'foo.com',
+# path: '/',
+# expire_after: 2592000,
+# secrets: 'a randomly generated, raw binary string 64 bytes in size',
+# }
+#
+# Example using legacy HMAC options:
+#
+# Rack::Session:Cookie.new(application, {
+# # The secret used for legacy HMAC cookies, this enables the functionality
+# legacy_hmac_secret: 'legacy secret',
+# # legacy_hmac_coder will default to Rack::Session::Cookie::Base64::Marshal
+# legacy_hmac_coder: Rack::Session::Cookie::Identity.new,
+# # legacy_hmac will default to OpenSSL::Digest::SHA1
+# legacy_hmac: OpenSSL::Digest::SHA256
+# })
+#
+#
+# Rack::Session::Cookie.new(application, {
+# :coder => Rack::Session::Cookie::Identity.new
+# })
+#
+#
+# Rack::Session::Cookie.new(application, {
+# :coder => Class.new {
+# def encode(str); str.reverse; end
+# def decode(str); str.reverse; end
+# }.new
+# })
+#
+# source://rack-session//lib/rack/session/cookie.rb#91
+class Rack::Session::Cookie < ::Rack::Session::Abstract::PersistedSecure
+ # @return [Cookie] a new instance of Cookie
+ #
+ # source://rack-session//lib/rack/session/cookie.rb#159
+ def initialize(app, options = T.unsafe(nil)); end
+
+ # Returns the value of attribute coder.
+ #
+ # source://rack-session//lib/rack/session/cookie.rb#157
+ def coder; end
+
+ # Returns the value of attribute encryptors.
+ #
+ # source://rack-session//lib/rack/session/cookie.rb#157
+ def encryptors; end
+
+ private
+
+ # source://rack-session//lib/rack/session/cookie.rb#277
+ def delete_session(req, session_id, options); end
+
+ # source://rack-session//lib/rack/session/cookie.rb#292
+ def encode_session_data(session); end
+
+ # source://rack-session//lib/rack/session/cookie.rb#209
+ def extract_session_id(request); end
+
+ # source://rack-session//lib/rack/session/cookie.rb#203
+ def find_session(req, sid); end
+
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/cookie.rb#282
+ def legacy_digest_match?(data, digest); end
+
+ # source://rack-session//lib/rack/session/cookie.rb#288
+ def legacy_generate_hmac(data); end
+
+ # source://rack-session//lib/rack/session/cookie.rb#250
+ def persistent_session_id!(data, sid = T.unsafe(nil)); end
+
+ # Were consider "secure" if:
+ # * Encrypted cookies are enabled and one or more encryptor is
+ # initialized
+ # * The legacy HMAC option is enabled
+ # * Customer :coder is used, with :let_coder_handle_secure_encoding
+ # set to true
+ #
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/cookie.rb#306
+ def secure?(options); end
+
+ # source://rack-session//lib/rack/session/cookie.rb#213
+ def unpacked_cookie_data(request); end
+
+ # source://rack-session//lib/rack/session/cookie.rb#265
+ def write_session(req, session_id, session, options); end
+end
+
+# Encode session cookies as Base64
+#
+# source://rack-session//lib/rack/session/cookie.rb#93
+class Rack::Session::Cookie::Base64
+ # source://rack-session//lib/rack/session/cookie.rb#98
+ def decode(str); end
+
+ # source://rack-session//lib/rack/session/cookie.rb#94
+ def encode(str); end
+end
+
+# N.B. Unlike other encoding methods, the contained objects must be a
+# valid JSON composite type, either a Hash or an Array.
+#
+# source://rack-session//lib/rack/session/cookie.rb#116
+class Rack::Session::Cookie::Base64::JSON < ::Rack::Session::Cookie::Base64
+ # source://rack-session//lib/rack/session/cookie.rb#121
+ def decode(str); end
+
+ # source://rack-session//lib/rack/session/cookie.rb#117
+ def encode(obj); end
+end
+
+# Encode session cookies as Marshaled Base64 data
+#
+# source://rack-session//lib/rack/session/cookie.rb#103
+class Rack::Session::Cookie::Base64::Marshal < ::Rack::Session::Cookie::Base64
+ # source://rack-session//lib/rack/session/cookie.rb#108
+ def decode(str); end
+
+ # source://rack-session//lib/rack/session/cookie.rb#104
+ def encode(str); end
+end
+
+# source://rack-session//lib/rack/session/cookie.rb#127
+class Rack::Session::Cookie::Base64::ZipJSON < ::Rack::Session::Cookie::Base64
+ # source://rack-session//lib/rack/session/cookie.rb#132
+ def decode(str); end
+
+ # source://rack-session//lib/rack/session/cookie.rb#128
+ def encode(obj); end
+end
+
+# Use no encoding for session cookies
+#
+# source://rack-session//lib/rack/session/cookie.rb#142
+class Rack::Session::Cookie::Identity
+ # source://rack-session//lib/rack/session/cookie.rb#144
+ def decode(str); end
+
+ # source://rack-session//lib/rack/session/cookie.rb#143
+ def encode(str); end
+end
+
+# source://rack-session//lib/rack/session/cookie.rb#147
+class Rack::Session::Cookie::Marshal
+ # source://rack-session//lib/rack/session/cookie.rb#152
+ def decode(str); end
+
+ # source://rack-session//lib/rack/session/cookie.rb#148
+ def encode(str); end
+end
+
+# source://rack-session//lib/rack/session/cookie.rb#256
+class Rack::Session::Cookie::SessionId
+ # @return [SessionId] a new instance of SessionId
+ #
+ # source://rack-session//lib/rack/session/cookie.rb#259
+ def initialize(session_id, cookie_value); end
+
+ # Returns the value of attribute cookie_value.
+ #
+ # source://rack-session//lib/rack/session/cookie.rb#257
+ def cookie_value; end
+end
+
+# source://rack-session//lib/rack/session/encryptor.rb#16
+class Rack::Session::Encryptor
+ # The secret String must be at least 64 bytes in size. The first 32 bytes
+ # will be used for the encryption cipher key. The remainder will be used
+ # for an HMAC key.
+ #
+ # Options may include:
+ # * :serialize_json
+ # Use JSON for message serialization instead of Marshal. This can be
+ # viewed as a security enhancement.
+ # * :pad_size
+ # Pad encrypted message data, to a multiple of this many bytes
+ # (default: 32). This can be between 2-4096 bytes, or +nil+ to disable
+ # padding.
+ # * :purpose
+ # Limit messages to a specific purpose. This can be viewed as a
+ # security enhancement to prevent message reuse from different contexts
+ # if keys are reused.
+ #
+ # Cryptography and Output Format:
+ #
+ # urlsafe_encode64(version + random_data + IV + encrypted data + HMAC)
+ #
+ # Where:
+ # * version - 1 byte and is currently always 0x01
+ # * random_data - 32 bytes used for generating the per-message secret
+ # * IV - 16 bytes random initialization vector
+ # * HMAC - 32 bytes HMAC-SHA-256 of all preceding data, plus the purpose
+ # value
+ #
+ # @raise [ArgumentError]
+ # @return [Encryptor] a new instance of Encryptor
+ #
+ # source://rack-session//lib/rack/session/encryptor.rb#53
+ def initialize(secret, opts = T.unsafe(nil)); end
+
+ # source://rack-session//lib/rack/session/encryptor.rb#77
+ def decrypt(base64_data); end
+
+ # source://rack-session//lib/rack/session/encryptor.rb#102
+ def encrypt(message); end
+
+ private
+
+ # source://rack-session//lib/rack/session/encryptor.rb#139
+ def cipher_secret_from_message_secret(message_secret); end
+
+ # source://rack-session//lib/rack/session/encryptor.rb#151
+ def compute_signature(data); end
+
+ # Return the deserialized message. The first 2 bytes will be read as the
+ # amount of padding.
+ #
+ # source://rack-session//lib/rack/session/encryptor.rb#182
+ def deserialized_message(data); end
+
+ # source://rack-session//lib/rack/session/encryptor.rb#129
+ def new_cipher; end
+
+ # source://rack-session//lib/rack/session/encryptor.rb#133
+ def new_message_and_cipher_secret; end
+
+ # Returns a serialized payload of the message. If a :pad_size is supplied,
+ # the message will be padded. The first 2 bytes of the returned string will
+ # indicating the amount of padding.
+ #
+ # source://rack-session//lib/rack/session/encryptor.rb#169
+ def serialize_payload(message); end
+
+ # source://rack-session//lib/rack/session/encryptor.rb#147
+ def serializer; end
+
+ # source://rack-session//lib/rack/session/encryptor.rb#143
+ def set_cipher_key(cipher, key); end
+
+ # @raise [InvalidMessage]
+ #
+ # source://rack-session//lib/rack/session/encryptor.rb#158
+ def verify_authenticity!(data, signature); end
+end
+
+# source://rack-session//lib/rack/session/encryptor.rb#17
+class Rack::Session::Encryptor::Error < ::StandardError; end
+
+# source://rack-session//lib/rack/session/encryptor.rb#23
+class Rack::Session::Encryptor::InvalidMessage < ::Rack::Session::Encryptor::Error; end
+
+# source://rack-session//lib/rack/session/encryptor.rb#20
+class Rack::Session::Encryptor::InvalidSignature < ::Rack::Session::Encryptor::Error; end
+
+# source://rack-session//lib/rack/session/constants.rb#9
+Rack::Session::RACK_SESSION = T.let(T.unsafe(nil), String)
+
+# source://rack-session//lib/rack/session/constants.rb#10
+Rack::Session::RACK_SESSION_OPTIONS = T.let(T.unsafe(nil), String)
+
+# source://rack-session//lib/rack/session/constants.rb#11
+Rack::Session::RACK_SESSION_UNPACKED_COOKIE_DATA = T.let(T.unsafe(nil), String)
+
+# source://rack-session//lib/rack/session/abstract/id.rb#21
+class Rack::Session::SessionId
+ # @return [SessionId] a new instance of SessionId
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#26
+ def initialize(public_id); end
+
+ # Returns the value of attribute public_id.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#24
+ def cookie_value; end
+
+ # @return [Boolean]
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#37
+ def empty?; end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#38
+ def inspect; end
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#30
+ def private_id; end
+
+ # Returns the value of attribute public_id.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#24
+ def public_id; end
+
+ # Returns the value of attribute public_id.
+ #
+ # source://rack-session//lib/rack/session/abstract/id.rb#24
+ def to_s; end
+
+ private
+
+ # source://rack-session//lib/rack/session/abstract/id.rb#42
+ def hash_sid(sid); end
+end
+
+# source://rack-session//lib/rack/session/abstract/id.rb#22
+Rack::Session::SessionId::ID_VERSION = T.let(T.unsafe(nil), Integer)
diff --git a/sorbet/rbi/gems/rack@2.2.9.rbi b/sorbet/rbi/gems/rack@3.1.7.rbi
similarity index 52%
rename from sorbet/rbi/gems/rack@2.2.9.rbi
rename to sorbet/rbi/gems/rack@3.1.7.rbi
index d879afad1..0c5d70914 100644
--- a/sorbet/rbi/gems/rack@2.2.9.rbi
+++ b/sorbet/rbi/gems/rack@3.1.7.rbi
@@ -16,87 +16,82 @@ module Rack
class << self
# Return the Rack release as a dotted string.
#
- # source://rack//lib/rack/version.rb#26
+ # source://rack//lib/rack/version.rb#18
def release; end
-
- # Return the Rack protocol version as a dotted string.
- #
- # source://rack//lib/rack/version.rb#19
- def version; end
end
end
-# source://rack//lib/rack.rb#124
+# source://rack//lib/rack.rb#60
module Rack::Auth; end
# Rack::Auth::AbstractHandler implements common authentication functionality.
#
# +realm+ should be set for all handlers.
#
-# source://rack//lib/rack/auth/abstract/handler.rb#9
+# source://rack//lib/rack/auth/abstract/handler.rb#11
class Rack::Auth::AbstractHandler
# @return [AbstractHandler] a new instance of AbstractHandler
#
- # source://rack//lib/rack/auth/abstract/handler.rb#13
+ # source://rack//lib/rack/auth/abstract/handler.rb#15
def initialize(app, realm = T.unsafe(nil), &authenticator); end
# Returns the value of attribute realm.
#
- # source://rack//lib/rack/auth/abstract/handler.rb#11
+ # source://rack//lib/rack/auth/abstract/handler.rb#13
def realm; end
# Sets the attribute realm
#
# @param value the value to set the attribute realm to.
#
- # source://rack//lib/rack/auth/abstract/handler.rb#11
+ # source://rack//lib/rack/auth/abstract/handler.rb#13
def realm=(_arg0); end
private
- # source://rack//lib/rack/auth/abstract/handler.rb#29
+ # source://rack//lib/rack/auth/abstract/handler.rb#31
def bad_request; end
- # source://rack//lib/rack/auth/abstract/handler.rb#20
+ # source://rack//lib/rack/auth/abstract/handler.rb#22
def unauthorized(www_authenticate = T.unsafe(nil)); end
end
-# source://rack//lib/rack/auth/abstract/request.rb#5
+# source://rack//lib/rack/auth/abstract/request.rb#7
class Rack::Auth::AbstractRequest
# @return [AbstractRequest] a new instance of AbstractRequest
#
- # source://rack//lib/rack/auth/abstract/request.rb#7
+ # source://rack//lib/rack/auth/abstract/request.rb#9
def initialize(env); end
- # source://rack//lib/rack/auth/abstract/request.rb#31
+ # source://rack//lib/rack/auth/abstract/request.rb#33
def params; end
- # source://rack//lib/rack/auth/abstract/request.rb#23
+ # source://rack//lib/rack/auth/abstract/request.rb#25
def parts; end
# @return [Boolean]
#
- # source://rack//lib/rack/auth/abstract/request.rb#15
+ # source://rack//lib/rack/auth/abstract/request.rb#17
def provided?; end
- # source://rack//lib/rack/auth/abstract/request.rb#11
+ # source://rack//lib/rack/auth/abstract/request.rb#13
def request; end
- # source://rack//lib/rack/auth/abstract/request.rb#27
+ # source://rack//lib/rack/auth/abstract/request.rb#29
def scheme; end
# @return [Boolean]
#
- # source://rack//lib/rack/auth/abstract/request.rb#19
+ # source://rack//lib/rack/auth/abstract/request.rb#21
def valid?; end
private
- # source://rack//lib/rack/auth/abstract/request.rb#40
+ # source://rack//lib/rack/auth/abstract/request.rb#42
def authorization_key; end
end
-# source://rack//lib/rack/auth/abstract/request.rb#38
+# source://rack//lib/rack/auth/abstract/request.rb#40
Rack::Auth::AbstractRequest::AUTHORIZATION_KEYS = T.let(T.unsafe(nil), Array)
# Rack::Auth::Basic implements HTTP Basic Authentication, as per RFC 2617.
@@ -104,275 +99,44 @@ Rack::Auth::AbstractRequest::AUTHORIZATION_KEYS = T.let(T.unsafe(nil), Array)
# Initialize with the Rack application that you want protecting,
# and a block that checks if a username and password pair are valid.
#
-# See also: example/protectedlobster.rb
-#
-# source://rack//lib/rack/auth/basic.rb#16
+# source://rack//lib/rack/auth/basic.rb#13
class Rack::Auth::Basic < ::Rack::Auth::AbstractHandler
- # source://rack//lib/rack/auth/basic.rb#18
+ # source://rack//lib/rack/auth/basic.rb#15
def call(env); end
private
- # source://rack//lib/rack/auth/basic.rb#37
+ # source://rack//lib/rack/auth/basic.rb#34
def challenge; end
# @return [Boolean]
#
- # source://rack//lib/rack/auth/basic.rb#41
+ # source://rack//lib/rack/auth/basic.rb#38
def valid?(auth); end
end
-# source://rack//lib/rack/auth/basic.rb#45
+# source://rack//lib/rack/auth/basic.rb#42
class Rack::Auth::Basic::Request < ::Rack::Auth::AbstractRequest
# @return [Boolean]
#
- # source://rack//lib/rack/auth/basic.rb#46
+ # source://rack//lib/rack/auth/basic.rb#43
def basic?; end
- # source://rack//lib/rack/auth/basic.rb#50
+ # source://rack//lib/rack/auth/basic.rb#47
def credentials; end
- # source://rack//lib/rack/auth/basic.rb#54
+ # source://rack//lib/rack/auth/basic.rb#51
def username; end
end
-# source://rack//lib/rack.rb#128
-module Rack::Auth::Digest; end
-
-# Rack::Auth::Digest::MD5 implements the MD5 algorithm version of
-# HTTP Digest Authentication, as per RFC 2617.
-#
-# Initialize with the [Rack] application that you want protecting,
-# and a block that looks up a plaintext password for a given username.
-#
-# +opaque+ needs to be set to a constant base64/hexadecimal string.
-#
-# source://rack//lib/rack/auth/digest/md5.rb#20
-class Rack::Auth::Digest::MD5 < ::Rack::Auth::AbstractHandler
- # @return [MD5] a new instance of MD5
- #
- # source://rack//lib/rack/auth/digest/md5.rb#26
- def initialize(app, realm = T.unsafe(nil), opaque = T.unsafe(nil), &authenticator); end
-
- # source://rack//lib/rack/auth/digest/md5.rb#39
- def call(env); end
-
- # Returns the value of attribute opaque.
- #
- # source://rack//lib/rack/auth/digest/md5.rb#22
- def opaque; end
-
- # Sets the attribute opaque
- #
- # @param value the value to set the attribute opaque to.
- #
- # source://rack//lib/rack/auth/digest/md5.rb#22
- def opaque=(_arg0); end
-
- # Sets the attribute passwords_hashed
- #
- # @param value the value to set the attribute passwords_hashed to.
- #
- # source://rack//lib/rack/auth/digest/md5.rb#24
- def passwords_hashed=(_arg0); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/auth/digest/md5.rb#35
- def passwords_hashed?; end
-
- private
-
- # source://rack//lib/rack/auth/digest/md5.rb#114
- def A1(auth, password); end
-
- # source://rack//lib/rack/auth/digest/md5.rb#118
- def A2(auth); end
-
- # source://rack//lib/rack/auth/digest/md5.rb#104
- def H(data); end
-
- # source://rack//lib/rack/auth/digest/md5.rb#110
- def KD(secret, data); end
-
- # source://rack//lib/rack/auth/digest/md5.rb#79
- def challenge(hash = T.unsafe(nil)); end
-
- # source://rack//lib/rack/auth/digest/md5.rb#122
- def digest(auth, password); end
-
- # source://rack//lib/rack/auth/digest/md5.rb#104
- def md5(data); end
-
- # source://rack//lib/rack/auth/digest/md5.rb#68
- def params(hash = T.unsafe(nil)); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/auth/digest/md5.rb#83
- def valid?(auth); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/auth/digest/md5.rb#99
- def valid_digest?(auth); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/auth/digest/md5.rb#95
- def valid_nonce?(auth); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/auth/digest/md5.rb#91
- def valid_opaque?(auth); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/auth/digest/md5.rb#87
- def valid_qop?(auth); end
-end
-
-# source://rack//lib/rack/auth/digest/md5.rb#66
-Rack::Auth::Digest::MD5::QOP = T.let(T.unsafe(nil), String)
+# source://rack//lib/rack/builder.rb#6
+Rack::BUILDER_TOPLEVEL_BINDING = T.let(T.unsafe(nil), Proc)
-# Rack::Auth::Digest::Nonce is the default nonce generator for the
-# Rack::Auth::Digest::MD5 authentication handler.
-#
-# +private_key+ needs to set to a constant string.
+# Represents a 400 Bad Request error when input data fails to meet the
+# requirements.
#
-# +time_limit+ can be optionally set to an integer (number of seconds),
-# to limit the validity of the generated nonces.
-#
-# source://rack//lib/rack/auth/digest/nonce.rb#17
-class Rack::Auth::Digest::Nonce
- # @return [Nonce] a new instance of Nonce
- #
- # source://rack//lib/rack/auth/digest/nonce.rb#27
- def initialize(timestamp = T.unsafe(nil), given_digest = T.unsafe(nil)); end
-
- # source://rack//lib/rack/auth/digest/nonce.rb#35
- def digest; end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/auth/digest/nonce.rb#47
- def fresh?; end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/auth/digest/nonce.rb#43
- def stale?; end
-
- # source://rack//lib/rack/auth/digest/nonce.rb#31
- def to_s; end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/auth/digest/nonce.rb#39
- def valid?; end
-
- class << self
- # source://rack//lib/rack/auth/digest/nonce.rb#23
- def parse(string); end
-
- # Returns the value of attribute private_key.
- #
- # source://rack//lib/rack/auth/digest/nonce.rb#20
- def private_key; end
-
- # Sets the attribute private_key
- #
- # @param value the value to set the attribute private_key to.
- #
- # source://rack//lib/rack/auth/digest/nonce.rb#20
- def private_key=(_arg0); end
-
- # Returns the value of attribute time_limit.
- #
- # source://rack//lib/rack/auth/digest/nonce.rb#20
- def time_limit; end
-
- # Sets the attribute time_limit
- #
- # @param value the value to set the attribute time_limit to.
- #
- # source://rack//lib/rack/auth/digest/nonce.rb#20
- def time_limit=(_arg0); end
- end
-end
-
-# source://rack//lib/rack/auth/digest/params.rb#6
-class Rack::Auth::Digest::Params < ::Hash
- # @return [Params] a new instance of Params
- # @yield [_self]
- # @yieldparam _self [Rack::Auth::Digest::Params] the object that the method was called on
- #
- # source://rack//lib/rack/auth/digest/params.rb#25
- def initialize; end
-
- # source://rack//lib/rack/auth/digest/params.rb#31
- def [](k); end
-
- # source://rack//lib/rack/auth/digest/params.rb#35
- def []=(k, v); end
-
- # From WEBrick::HTTPUtils
- #
- # source://rack//lib/rack/auth/digest/params.rb#47
- def quote(str); end
-
- # source://rack//lib/rack/auth/digest/params.rb#41
- def to_s; end
-
- class << self
- # From WEBrick::HTTPUtils
- #
- # source://rack//lib/rack/auth/digest/params.rb#15
- def dequote(str); end
-
- # source://rack//lib/rack/auth/digest/params.rb#8
- def parse(str); end
-
- # source://rack//lib/rack/auth/digest/params.rb#21
- def split_header_value(str); end
- end
-end
-
-# source://rack//lib/rack/auth/digest/params.rb#39
-Rack::Auth::Digest::Params::UNQUOTED = T.let(T.unsafe(nil), Array)
-
-# source://rack//lib/rack/auth/digest/request.rb#10
-class Rack::Auth::Digest::Request < ::Rack::Auth::AbstractRequest
- # @return [Boolean]
- #
- # source://rack//lib/rack/auth/digest/request.rb#19
- def correct_uri?; end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/auth/digest/request.rb#15
- def digest?; end
-
- # source://rack//lib/rack/auth/digest/request.rb#11
- def method; end
-
- # @raise [ArgumentError]
- #
- # source://rack//lib/rack/auth/digest/request.rb#35
- def method_missing(sym, *args); end
-
- # source://rack//lib/rack/auth/digest/request.rb#23
- def nonce; end
-
- # source://rack//lib/rack/auth/digest/request.rb#27
- def params; end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/auth/digest/request.rb#31
- def respond_to?(sym, *_arg1); end
-end
+# source://rack//lib/rack/bad_request.rb#6
+module Rack::BadRequest; end
# Proxy for response bodies allowing calling a block when
# the response body is closed (after the response has been fully
@@ -391,7 +155,7 @@ class Rack::BodyProxy
# If not already closed, close the wrapped body and
# then call the block the proxy was initialized with.
#
- # source://rack//lib/rack/body_proxy.rb#23
+ # source://rack//lib/rack/body_proxy.rb#28
def close; end
# Whether the proxy is closed. The proxy starts as not closed,
@@ -399,12 +163,12 @@ class Rack::BodyProxy
#
# @return [Boolean]
#
- # source://rack//lib/rack/body_proxy.rb#35
+ # source://rack//lib/rack/body_proxy.rb#40
def closed?; end
# Delegate missing methods to the wrapped body.
#
- # source://rack//lib/rack/body_proxy.rb#40
+ # source://rack//lib/rack/body_proxy.rb#45
def method_missing(method_name, *args, **_arg2, &block); end
private
@@ -417,78 +181,91 @@ class Rack::BodyProxy
def respond_to_missing?(method_name, include_all = T.unsafe(nil)); end
end
-# Rack::Builder implements a small DSL to iteratively construct Rack
-# applications.
+# Rack::Builder provides a domain-specific language (DSL) to construct Rack
+# applications. It is primarily used to parse +config.ru+ files which
+# instantiate several middleware and a final application which are hosted
+# by a Rack-compatible web server.
#
# Example:
#
-# require 'rack/lobster'
-# app = Rack::Builder.new do
-# use Rack::CommonLogger
-# use Rack::ShowExceptions
-# map "/lobster" do
-# use Rack::Lint
-# run Rack::Lobster.new
-# end
-# end
+# app = Rack::Builder.new do
+# use Rack::CommonLogger
+# map "/ok" do
+# run lambda { |env| [200, {'content-type' => 'text/plain'}, ['OK']] }
+# end
+# end
#
-# run app
+# run app
#
# Or
#
-# app = Rack::Builder.app do
-# use Rack::CommonLogger
-# run lambda { |env| [200, {'Content-Type' => 'text/plain'}, ['OK']] }
-# end
+# app = Rack::Builder.app do
+# use Rack::CommonLogger
+# run lambda { |env| [200, {'content-type' => 'text/plain'}, ['OK']] }
+# end
#
-# run app
+# run app
#
# +use+ adds middleware to the stack, +run+ dispatches to an application.
# You can use +map+ to construct a Rack::URLMap in a convenient way.
#
-# source://rack//lib/rack/builder.rb#33
+# source://rack//lib/rack/builder.rb#36
class Rack::Builder
# Initialize a new Rack::Builder instance. +default_app+ specifies the
# default application if +run+ is not called later. If a block
- # is given, it is evaluted in the context of the instance.
+ # is given, it is evaluated in the context of the instance.
#
# @return [Builder] a new instance of Builder
#
- # source://rack//lib/rack/builder.rb#123
- def initialize(default_app = T.unsafe(nil), &block); end
+ # source://rack//lib/rack/builder.rb#116
+ def initialize(default_app = T.unsafe(nil), **options, &block); end
# Call the Rack application generated by this builder instance. Note that
# this rebuilds the Rack application and runs the warmup code (if any)
# every time it is called, so it should not be used if performance is important.
#
- # source://rack//lib/rack/builder.rb#243
+ # source://rack//lib/rack/builder.rb#276
def call(env); end
# Freeze the app (set using run) and all middleware instances when building the application
# in to_app.
#
- # source://rack//lib/rack/builder.rb#226
+ # source://rack//lib/rack/builder.rb#259
def freeze_app; end
# Creates a route within the application. Routes under the mapped path will be sent to
# the Rack application specified by run inside the block. Other requests will be sent to the
# default application specified by run outside the block.
#
- # Rack::Builder.app do
+ # class App
+ # def call(env)
+ # [200, {'content-type' => 'text/plain'}, ["Hello World"]]
+ # end
+ # end
+ #
+ # class Heartbeat
+ # def call(env)
+ # [200, { "content-type" => "text/plain" }, ["OK"]]
+ # end
+ # end
+ #
+ # app = Rack::Builder.app do
# map '/heartbeat' do
- # run Heartbeat
+ # run Heartbeat.new
# end
- # run App
+ # run App.new
# end
#
+ # run app
+ #
# The +use+ method can also be used inside the block to specify middleware to run under a specific path:
#
- # Rack::Builder.app do
+ # app = Rack::Builder.app do
# map '/heartbeat' do
# use Middleware
- # run Heartbeat
+ # run Heartbeat.new
# end
- # run App
+ # run App.new
# end
#
# This example includes a piece of middleware which will run before +/heartbeat+ requests hit +Heartbeat+.
@@ -496,30 +273,49 @@ class Rack::Builder
# Note that providing a +path+ of +/+ will ignore any default application given in a +run+ statement
# outside the block.
#
- # source://rack//lib/rack/builder.rb#219
+ # source://rack//lib/rack/builder.rb#252
def map(path, &block); end
- # Takes an argument that is an object that responds to #call and returns a Rack response.
- # The simplest form of this is a lambda object:
+ # Any options provided to the Rack::Builder instance at initialization.
+ # These options can be server-specific. Some general options are:
+ #
+ # * +:isolation+: One of +process+, +thread+ or +fiber+. The execution
+ # isolation model to use.
+ #
+ # source://rack//lib/rack/builder.rb#132
+ def options; end
+
+ # Takes a block or argument that is an object that responds to #call and
+ # returns a Rack response.
+ #
+ # You can use a block:
+ #
+ # run do |env|
+ # [200, { "content-type" => "text/plain" }, ["Hello World!"]]
+ # end
#
- # run lambda { |env| [200, { "Content-Type" => "text/plain" }, ["OK"]] }
+ # You can also provide a lambda:
#
- # However this could also be a class:
+ # run lambda { |env| [200, { "content-type" => "text/plain" }, ["OK"]] }
+ #
+ # You can also provide a class instance:
#
# class Heartbeat
- # def self.call(env)
- # [200, { "Content-Type" => "text/plain" }, ["OK"]]
+ # def call(env)
+ # [200, { "content-type" => "text/plain" }, ["OK"]]
# end
# end
#
- # run Heartbeat
+ # run Heartbeat.new
+ #
+ # @raise [ArgumentError]
#
- # source://rack//lib/rack/builder.rb#176
- def run(app); end
+ # source://rack//lib/rack/builder.rb#193
+ def run(app = T.unsafe(nil), &block); end
# Return the Rack application generated by this instance.
#
- # source://rack//lib/rack/builder.rb#231
+ # source://rack//lib/rack/builder.rb#264
def to_app; end
# Specifies middleware to use in a stack.
@@ -536,13 +332,13 @@ class Rack::Builder
# end
#
# use Middleware
- # run lambda { |env| [200, { "Content-Type" => "text/plain" }, ["OK"]] }
+ # run lambda { |env| [200, { "content-type" => "text/plain" }, ["OK"]] }
#
# All requests through to this application will first be processed by the middleware class.
# The +call+ method in this example sets an additional environment key which then can be
# referenced in the application if required.
#
- # source://rack//lib/rack/builder.rb#153
+ # source://rack//lib/rack/builder.rb#159
def use(middleware, *args, **_arg2, &block); end
# Takes a lambda or block that is used to warm-up the application. This block is called
@@ -556,7 +352,7 @@ class Rack::Builder
# use SomeMiddleware
# run MyApp
#
- # source://rack//lib/rack/builder.rb#190
+ # source://rack//lib/rack/builder.rb#209
def warmup(prc = T.unsafe(nil), &block); end
private
@@ -564,23 +360,19 @@ class Rack::Builder
# Generate a URLMap instance by generating new Rack applications for each
# map block in this instance.
#
- # source://rack//lib/rack/builder.rb#251
+ # source://rack//lib/rack/builder.rb#284
def generate_map(default_app, mapping); end
class << self
# Create a new Rack::Builder instance and return the Rack application
# generated from it.
#
- # source://rack//lib/rack/builder.rb#130
+ # source://rack//lib/rack/builder.rb#136
def app(default_app = T.unsafe(nil), &block); end
# Load the given file as a rackup file, treating the
# contents as if specified inside a Rack::Builder block.
#
- # Treats the first comment at the beginning of a line
- # that starts with a backslash as options similar to
- # options passed on a rackup command line.
- #
# Ignores content in the file after +__END__+, so that
# use of +__END__+ will not result in a syntax error.
#
@@ -588,32 +380,28 @@ class Rack::Builder
#
# $ cat config.ru
#
- # #\ -p 9393
- #
# use Rack::ContentLength
# require './app.rb'
# run App
#
- # source://rack//lib/rack/builder.rb#93
- def load_file(path, opts = T.unsafe(nil)); end
+ # source://rack//lib/rack/builder.rb#87
+ def load_file(path, **options); end
# Evaluate the given +builder_script+ string in the context of
# a Rack::Builder block, returning a Rack application.
#
- # source://rack//lib/rack/builder.rb#112
- def new_from_string(builder_script, file = T.unsafe(nil)); end
+ # source://rack//lib/rack/builder.rb#102
+ def new_from_string(builder_script, path = T.unsafe(nil), **options); end
# Parse the given config file to get a Rack application.
#
# If the config file ends in +.ru+, it is treated as a
# rackup file and the contents will be treated as if
- # specified inside a Rack::Builder block, using the given
- # options.
+ # specified inside a Rack::Builder block.
#
# If the config file does not end in +.ru+, it is
# required and Rack will use the basename of the file
# to guess which constant will be the Rack application to run.
- # The options given will be ignored in this case.
#
# Examples:
#
@@ -623,30 +411,35 @@ class Rack::Builder
# Rack::Builder.parse_file('app.rb')
# # requires app.rb, which can be anywhere in Ruby's
# # load path. After requiring, assumes App constant
- # # contains Rack application
+ # # is a Rack application
#
# Rack::Builder.parse_file('./my_app.rb')
# # requires ./my_app.rb, which should be in the
# # process's current directory. After requiring,
- # # assumes MyApp constant contains Rack application
+ # # assumes MyApp constant is a Rack application
#
- # source://rack//lib/rack/builder.rb#64
- def parse_file(config, opts = T.unsafe(nil)); end
+ # source://rack//lib/rack/builder.rb#65
+ def parse_file(path, **options); end
end
end
# https://stackoverflow.com/questions/2223882/whats-the-difference-between-utf-8-and-utf-8-without-bom
#
-# source://rack//lib/rack/builder.rb#36
+# source://rack//lib/rack/builder.rb#39
Rack::Builder::UTF_8_BOM = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#29
+# Response Header Keys
+#
+# source://rack//lib/rack/constants.rb#19
Rack::CACHE_CONTROL = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#31
+# source://rack//lib/rack/constants.rb#35
+Rack::CONNECT = T.let(T.unsafe(nil), String)
+
+# source://rack//lib/rack/constants.rb#20
Rack::CONTENT_LENGTH = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#32
+# source://rack//lib/rack/constants.rb#21
Rack::CONTENT_TYPE = T.let(T.unsafe(nil), String)
# Rack::Cascade tries a request on several apps, and returns the
@@ -654,7 +447,7 @@ Rack::CONTENT_TYPE = T.let(T.unsafe(nil), String)
# status codes). If all applications tried return one of the configured
# status codes, return the last response.
#
-# source://rack//lib/rack/cascade.rb#9
+# source://rack//lib/rack/cascade.rb#11
class Rack::Cascade
# Set the apps to send requests to, and what statuses result in
# cascading. Arguments:
@@ -665,148 +458,47 @@ class Rack::Cascade
#
# @return [Cascade] a new instance of Cascade
#
- # source://rack//lib/rack/cascade.rb#22
+ # source://rack//lib/rack/cascade.rb#21
def initialize(apps, cascade_for = T.unsafe(nil)); end
# Append an app to the list of apps to cascade. This app will
# be tried last.
#
- # source://rack//lib/rack/cascade.rb#57
+ # source://rack//lib/rack/cascade.rb#56
def <<(app); end
# Append an app to the list of apps to cascade. This app will
# be tried last.
#
- # source://rack//lib/rack/cascade.rb#57
+ # source://rack//lib/rack/cascade.rb#56
def add(app); end
# An array of applications to try in order.
#
- # source://rack//lib/rack/cascade.rb#14
+ # source://rack//lib/rack/cascade.rb#13
def apps; end
# Call each app in order. If the responses uses a status that requires
# cascading, try the next app. If all responses require cascading,
# return the response from the last app.
#
- # source://rack//lib/rack/cascade.rb#33
+ # source://rack//lib/rack/cascade.rb#32
def call(env); end
# Whether the given app is one of the apps to cascade to.
#
# @return [Boolean]
#
- # source://rack//lib/rack/cascade.rb#62
+ # source://rack//lib/rack/cascade.rb#61
def include?(app); end
end
-# deprecated, no longer used
-#
-# source://rack//lib/rack/cascade.rb#11
-Rack::Cascade::NotFound = T.let(T.unsafe(nil), Array)
-
-# Middleware that applies chunked transfer encoding to response bodies
-# when the response does not include a Content-Length header.
-#
-# This supports the Trailer response header to allow the use of trailing
-# headers in the chunked encoding. However, using this requires you manually
-# specify a response body that supports a +trailers+ method. Example:
-#
-# [200, { 'Trailer' => 'Expires'}, ["Hello", "World"]]
-# # error raised
-#
-# body = ["Hello", "World"]
-# def body.trailers
-# { 'Expires' => Time.now.to_s }
-# end
-# [200, { 'Trailer' => 'Expires'}, body]
-# # No exception raised
-#
-# source://rack//lib/rack/chunked.rb#21
-class Rack::Chunked
- include ::Rack::Utils
-
- # @return [Chunked] a new instance of Chunked
- #
- # source://rack//lib/rack/chunked.rb#78
- def initialize(app); end
-
- # If the rack app returns a response that should have a body,
- # but does not have Content-Length or Transfer-Encoding headers,
- # modify the response to use chunked Transfer-Encoding.
- #
- # source://rack//lib/rack/chunked.rb#97
- def call(env); end
-
- # Whether the HTTP version supports chunked encoding (HTTP 1.1 does).
- #
- # @return [Boolean]
- #
- # source://rack//lib/rack/chunked.rb#83
- def chunkable_version?(ver); end
-end
-
-# A body wrapper that emits chunked responses.
-#
-# source://rack//lib/rack/chunked.rb#25
-class Rack::Chunked::Body
- # Store the response body to be chunked.
- #
- # @return [Body] a new instance of Body
- #
- # source://rack//lib/rack/chunked.rb#30
- def initialize(body); end
-
- # Close the response body if the response body supports it.
- #
- # source://rack//lib/rack/chunked.rb#50
- def close; end
-
- # For each element yielded by the response body, yield
- # the element in chunked encoding.
- #
- # @yield [TAIL]
- #
- # source://rack//lib/rack/chunked.rb#36
- def each(&block); end
-
- private
-
- # Do nothing as this class does not support trailer headers.
- #
- # source://rack//lib/rack/chunked.rb#57
- def yield_trailers; end
-end
-
-# source://rack//lib/rack/chunked.rb#27
-Rack::Chunked::Body::TAIL = T.let(T.unsafe(nil), String)
-
-# source://rack//lib/rack/chunked.rb#26
-Rack::Chunked::Body::TERM = T.let(T.unsafe(nil), String)
-
-# A body wrapper that emits chunked responses and also supports
-# sending Trailer headers. Note that the response body provided to
-# initialize must have a +trailers+ method that returns a hash
-# of trailer headers, and the rack response itself should have a
-# Trailer header listing the headers that the +trailers+ method
-# will return.
-#
-# source://rack//lib/rack/chunked.rb#67
-class Rack::Chunked::TrailerBody < ::Rack::Chunked::Body
- private
-
- # Yield strings for each trailer header.
- #
- # source://rack//lib/rack/chunked.rb#71
- def yield_trailers; end
-end
-
# Rack::CommonLogger forwards every request to the given +app+, and
# logs a line in the
# {Apache common log format}[http://httpd.apache.org/docs/1.3/logs.html#common]
# to the configured logger.
#
-# source://rack//lib/rack/common_logger.rb#8
+# source://rack//lib/rack/common_logger.rb#13
class Rack::CommonLogger
# +logger+ can be any object that supports the +write+ or +<<+ methods,
# which includes the standard library Logger. These methods are called
@@ -815,7 +507,7 @@ class Rack::CommonLogger
#
# @return [CommonLogger] a new instance of CommonLogger
#
- # source://rack//lib/rack/common_logger.rb#24
+ # source://rack//lib/rack/common_logger.rb#29
def initialize(app, logger = T.unsafe(nil)); end
# Log all requests in common_log format after a response has been
@@ -826,7 +518,7 @@ class Rack::CommonLogger
# exceptions raised during the sending of the response body will
# cause the request not to be logged.
#
- # source://rack//lib/rack/common_logger.rb#36
+ # source://rack//lib/rack/common_logger.rb#41
def call(env); end
private
@@ -834,13 +526,13 @@ class Rack::CommonLogger
# Attempt to determine the content length for the response to
# include it in the logged data.
#
- # source://rack//lib/rack/common_logger.rb#78
+ # source://rack//lib/rack/common_logger.rb#83
def extract_content_length(headers); end
# Log the request to the configured logger.
#
- # source://rack//lib/rack/common_logger.rb#47
- def log(env, status, header, began_at); end
+ # source://rack//lib/rack/common_logger.rb#52
+ def log(env, status, response_headers, began_at); end
end
# Common Log Format: http://httpd.apache.org/docs/1.3/logs.html#common
@@ -853,12 +545,12 @@ end
# separation of SCRIPT_NAME and PATH_INFO, and because the elapsed
# time in seconds is included at the end.
#
-# source://rack//lib/rack/common_logger.rb#18
+# source://rack//lib/rack/common_logger.rb#23
Rack::CommonLogger::FORMAT = T.let(T.unsafe(nil), String)
-# Middleware that enables conditional GET using If-None-Match and
-# If-Modified-Since. The application should set either or both of the
-# Last-Modified or Etag response headers according to RFC 2616. When
+# Middleware that enables conditional GET using if-none-match and
+# if-modified-since. The application should set either or both of the
+# last-modified or etag response headers according to RFC 2616. When
# either of the conditions is met, the response body is set to be zero
# length and the response status is set to 304 Not Modified.
#
@@ -869,27 +561,27 @@ Rack::CommonLogger::FORMAT = T.let(T.unsafe(nil), String)
# Adapted from Michael Klishin's Merb implementation:
# https://github.com/wycats/merb/blob/master/merb-core/lib/merb-core/rack/middleware/conditional_get.rb
#
-# source://rack//lib/rack/conditional_get.rb#17
+# source://rack//lib/rack/conditional_get.rb#21
class Rack::ConditionalGet
# @return [ConditionalGet] a new instance of ConditionalGet
#
- # source://rack//lib/rack/conditional_get.rb#18
+ # source://rack//lib/rack/conditional_get.rb#22
def initialize(app); end
# Return empty 304 response if the response has not been
# modified since the last request.
#
- # source://rack//lib/rack/conditional_get.rb#24
+ # source://rack//lib/rack/conditional_get.rb#28
def call(env); end
private
- # Whether the ETag response header matches the If-None-Match request header.
+ # Whether the etag response header matches the if-none-match request header.
# If so, the request has not been modified.
#
# @return [Boolean]
#
- # source://rack//lib/rack/conditional_get.rb#59
+ # source://rack//lib/rack/conditional_get.rb#62
def etag_matches?(none_match, headers); end
# Return whether the response has not been modified since the
@@ -897,21 +589,21 @@ class Rack::ConditionalGet
#
# @return [Boolean]
#
- # source://rack//lib/rack/conditional_get.rb#48
+ # source://rack//lib/rack/conditional_get.rb#51
def fresh?(env, headers); end
- # Whether the Last-Modified response header matches the If-Modified-Since
+ # Whether the last-modified response header matches the if-modified-since
# request header. If so, the request has not been modified.
#
# @return [Boolean]
#
- # source://rack//lib/rack/conditional_get.rb#65
+ # source://rack//lib/rack/conditional_get.rb#68
def modified_since?(modified_since, headers); end
# Return a Time object for the given string (which should be in RFC2822
# format), or nil if the string cannot be parsed.
#
- # source://rack//lib/rack/conditional_get.rb#72
+ # source://rack//lib/rack/conditional_get.rb#75
def to_rfc2822(since); end
end
@@ -934,25 +626,25 @@ class Rack::Config
def call(env); end
end
-# Sets the Content-Length header on responses that do not specify
-# a Content-Length or Transfer-Encoding header. Note that this
-# does not fix responses that have an invalid Content-Length
+# Sets the content-length header on responses that do not specify
+# a content-length or transfer-encoding header. Note that this
+# does not fix responses that have an invalid content-length
# header specified.
#
-# source://rack//lib/rack/content_length.rb#9
+# source://rack//lib/rack/content_length.rb#12
class Rack::ContentLength
include ::Rack::Utils
# @return [ContentLength] a new instance of ContentLength
#
- # source://rack//lib/rack/content_length.rb#12
+ # source://rack//lib/rack/content_length.rb#15
def initialize(app); end
- # source://rack//lib/rack/content_length.rb#16
+ # source://rack//lib/rack/content_length.rb#19
def call(env); end
end
-# Sets the Content-Type header on responses which don't have one.
+# Sets the content-type header on responses which don't have one.
#
# Builder Usage:
# use Rack::ContentType, "text/plain"
@@ -960,20 +652,20 @@ end
# When no content type argument is provided, "text/html" is the
# default.
#
-# source://rack//lib/rack/content_type.rb#12
+# source://rack//lib/rack/content_type.rb#15
class Rack::ContentType
include ::Rack::Utils
# @return [ContentType] a new instance of ContentType
#
- # source://rack//lib/rack/content_type.rb#15
+ # source://rack//lib/rack/content_type.rb#18
def initialize(app, content_type = T.unsafe(nil)); end
- # source://rack//lib/rack/content_type.rb#19
+ # source://rack//lib/rack/content_type.rb#23
def call(env); end
end
-# source://rack//lib/rack.rb#43
+# source://rack//lib/rack/constants.rb#32
Rack::DELETE = T.let(T.unsafe(nil), String)
# This middleware enables content encoding of http responses,
@@ -993,7 +685,7 @@ Rack::DELETE = T.let(T.unsafe(nil), String)
# Note that despite the name, Deflater does not support the +deflate+
# encoding.
#
-# source://rack//lib/rack/deflater.rb#23
+# source://rack//lib/rack/deflater.rb#28
class Rack::Deflater
# Creates Rack::Deflater middleware. Options:
#
@@ -1008,10 +700,10 @@ class Rack::Deflater
#
# @return [Deflater] a new instance of Deflater
#
- # source://rack//lib/rack/deflater.rb#36
+ # source://rack//lib/rack/deflater.rb#39
def initialize(app, options = T.unsafe(nil)); end
- # source://rack//lib/rack/deflater.rb#43
+ # source://rack//lib/rack/deflater.rb#46
def call(env); end
private
@@ -1020,13 +712,13 @@ class Rack::Deflater
#
# @return [Boolean]
#
- # source://rack//lib/rack/deflater.rb#122
+ # source://rack//lib/rack/deflater.rb#136
def should_deflate?(env, status, headers, body); end
end
# Body class used for gzip encoded responses.
#
-# source://rack//lib/rack/deflater.rb#79
+# source://rack//lib/rack/deflater.rb#83
class Rack::Deflater::GzipStream
# Initialize the gzip stream. Arguments:
# body :: Response body to compress with gzip
@@ -1036,25 +728,28 @@ class Rack::Deflater::GzipStream
#
# @return [GzipStream] a new instance of GzipStream
#
- # source://rack//lib/rack/deflater.rb#85
+ # source://rack//lib/rack/deflater.rb#92
def initialize(body, mtime, sync); end
# Close the original body if possible.
#
- # source://rack//lib/rack/deflater.rb#114
+ # source://rack//lib/rack/deflater.rb#128
def close; end
# Yield gzip compressed strings to the given block.
#
- # source://rack//lib/rack/deflater.rb#92
+ # source://rack//lib/rack/deflater.rb#99
def each(&block); end
- # Call the block passed to #each with the the gzipped data.
+ # Call the block passed to #each with the gzipped data.
#
- # source://rack//lib/rack/deflater.rb#109
+ # source://rack//lib/rack/deflater.rb#123
def write(data); end
end
+# source://rack//lib/rack/deflater.rb#85
+Rack::Deflater::GzipStream::BUFFER_LENGTH = T.let(T.unsafe(nil), Integer)
+
# Rack::Directory serves entries below the +root+ given, according to the
# path info of the Rack request. If a directory is found, the file's contents
# will be presented in an html based index. If a file is found, the env will
@@ -1062,152 +757,147 @@ end
#
# If +app+ is not specified, a Rack::Files of the same +root+ will be used.
#
-# source://rack//lib/rack/directory.rb#13
+# source://rack//lib/rack/directory.rb#19
class Rack::Directory
# Set the root directory and application for serving files.
#
# @return [Directory] a new instance of Directory
#
- # source://rack//lib/rack/directory.rb#77
+ # source://rack//lib/rack/directory.rb#83
def initialize(root, app = T.unsafe(nil)); end
- # source://rack//lib/rack/directory.rb#83
+ # source://rack//lib/rack/directory.rb#89
def call(env); end
# Rack response to use for requests with invalid paths, or nil if path is valid.
#
- # source://rack//lib/rack/directory.rb#103
+ # source://rack//lib/rack/directory.rb#109
def check_bad_request(path_info); end
# Rack response to use for requests with paths outside the root, or nil if path is inside the root.
#
- # source://rack//lib/rack/directory.rb#113
+ # source://rack//lib/rack/directory.rb#119
def check_forbidden(path_info); end
# Rack response to use for unreadable and non-file, non-directory entries.
#
- # source://rack//lib/rack/directory.rb#175
+ # source://rack//lib/rack/directory.rb#181
def entity_not_found(path_info); end
# Provide human readable file sizes
#
- # source://rack//lib/rack/directory.rb#191
+ # source://rack//lib/rack/directory.rb#197
def filesize_format(int); end
# Internals of request handling. Similar to call but does
# not remove body for HEAD requests.
#
- # source://rack//lib/rack/directory.rb#90
+ # source://rack//lib/rack/directory.rb#96
def get(env); end
# Rack response to use for directories under the root.
#
- # source://rack//lib/rack/directory.rb#124
+ # source://rack//lib/rack/directory.rb#130
def list_directory(path_info, path, script_name); end
# Rack response to use for files and directories under the root.
# Unreadable and non-file, non-directory entries will get a 404 response.
#
- # source://rack//lib/rack/directory.rb#165
+ # source://rack//lib/rack/directory.rb#171
def list_path(env, path, path_info, script_name); end
# The root of the directory hierarchy. Only requests for files and
# directories inside of the root directory are supported.
#
- # source://rack//lib/rack/directory.rb#74
+ # source://rack//lib/rack/directory.rb#80
def root; end
# File::Stat for the given path, but return nil for missing/bad entries.
#
- # source://rack//lib/rack/directory.rb#157
+ # source://rack//lib/rack/directory.rb#163
def stat(path); end
end
-# source://rack//lib/rack/directory.rb#14
+# source://rack//lib/rack/directory.rb#20
Rack::Directory::DIR_FILE = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack/directory.rb#37
+# source://rack//lib/rack/directory.rb#43
Rack::Directory::DIR_PAGE_FOOTER = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack/directory.rb#15
+# source://rack//lib/rack/directory.rb#21
Rack::Directory::DIR_PAGE_HEADER = T.let(T.unsafe(nil), String)
# Body class for directory entries, showing an index page with links
# to each file.
#
-# source://rack//lib/rack/directory.rb#45
+# source://rack//lib/rack/directory.rb#51
class Rack::Directory::DirectoryBody < ::Struct
# Yield strings for each part of the directory entry
#
# @yield [DIR_PAGE_HEADER % [ show_path, show_path ]]
#
- # source://rack//lib/rack/directory.rb#47
+ # source://rack//lib/rack/directory.rb#53
def each; end
private
# Escape each element in the array of html strings.
#
- # source://rack//lib/rack/directory.rb#67
+ # source://rack//lib/rack/directory.rb#73
def DIR_FILE_escape(htmls); end
end
# Stolen from Ramaze
#
-# source://rack//lib/rack/directory.rb#183
+# source://rack//lib/rack/directory.rb#189
Rack::Directory::FILESIZE_FORMAT = T.let(T.unsafe(nil), Array)
-# source://rack//lib/rack.rb#36
+# source://rack//lib/rack/constants.rb#22
Rack::ETAG = T.let(T.unsafe(nil), String)
-# Automatically sets the ETag header on all String bodies.
+# Automatically sets the etag header on all String bodies.
#
-# The ETag header is skipped if ETag or Last-Modified headers are sent or if
+# The etag header is skipped if etag or last-modified headers are sent or if
# a sendfile body (body.responds_to :to_path) is given (since such cases
# should be handled by apache/nginx).
#
-# On initialization, you can pass two parameters: a Cache-Control directive
-# used when Etag is absent and a directive when it is present. The first
+# On initialization, you can pass two parameters: a cache-control directive
+# used when etag is absent and a directive when it is present. The first
# defaults to nil, while the second defaults to "max-age=0, private, must-revalidate"
#
-# source://rack//lib/rack/etag.rb#16
+# source://rack//lib/rack/etag.rb#18
class Rack::ETag
# @return [ETag] a new instance of ETag
#
- # source://rack//lib/rack/etag.rb#20
+ # source://rack//lib/rack/etag.rb#22
def initialize(app, no_cache_control = T.unsafe(nil), cache_control = T.unsafe(nil)); end
- # source://rack//lib/rack/etag.rb#26
+ # source://rack//lib/rack/etag.rb#28
def call(env); end
private
- # source://rack//lib/rack/etag.rb#65
+ # source://rack//lib/rack/etag.rb#58
def digest_body(body); end
# @return [Boolean]
#
- # source://rack//lib/rack/etag.rb#57
- def etag_body?(body); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/etag.rb#53
+ # source://rack//lib/rack/etag.rb#50
def etag_status?(status); end
# @return [Boolean]
#
- # source://rack//lib/rack/etag.rb#61
+ # source://rack//lib/rack/etag.rb#54
def skip_caching?(headers); end
end
-# source://rack//lib/rack/etag.rb#18
+# source://rack//lib/rack/etag.rb#20
Rack::ETag::DEFAULT_CACHE_CONTROL = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack/etag.rb#17
+# source://rack//lib/rack/etag.rb#19
Rack::ETag::ETAG_STRING = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#30
+# source://rack//lib/rack/constants.rb#23
Rack::EXPIRES = T.let(T.unsafe(nil), String)
# This middleware provides hooks to certain places in the request /
@@ -1263,95 +953,92 @@ Rack::EXPIRES = T.let(T.unsafe(nil), String)
# raises an exception. If something raises an exception in a `on_finish`
# method, then nothing is guaranteed.
#
-# source://rack//lib/rack/events.rb#57
+# source://rack//lib/rack/events.rb#61
class Rack::Events
# @return [Events] a new instance of Events
#
- # source://rack//lib/rack/events.rb#102
+ # source://rack//lib/rack/events.rb#106
def initialize(app, handlers); end
- # source://rack//lib/rack/events.rb#107
+ # source://rack//lib/rack/events.rb#111
def call(env); end
private
- # source://rack//lib/rack/events.rb#145
+ # source://rack//lib/rack/events.rb#149
def make_request(env); end
- # source://rack//lib/rack/events.rb#149
+ # source://rack//lib/rack/events.rb#153
def make_response(status, headers, body); end
- # source://rack//lib/rack/events.rb#133
+ # source://rack//lib/rack/events.rb#137
def on_commit(request, response); end
- # source://rack//lib/rack/events.rb#129
+ # source://rack//lib/rack/events.rb#133
def on_error(request, response, e); end
- # source://rack//lib/rack/events.rb#141
+ # source://rack//lib/rack/events.rb#145
def on_finish(request, response); end
- # source://rack//lib/rack/events.rb#137
+ # source://rack//lib/rack/events.rb#141
def on_start(request, response); end
end
-# source://rack//lib/rack/events.rb#58
+# source://rack//lib/rack/events.rb#62
module Rack::Events::Abstract
- # source://rack//lib/rack/events.rb#62
+ # source://rack//lib/rack/events.rb#66
def on_commit(req, res); end
- # source://rack//lib/rack/events.rb#71
+ # source://rack//lib/rack/events.rb#75
def on_error(req, res, e); end
- # source://rack//lib/rack/events.rb#68
+ # source://rack//lib/rack/events.rb#72
def on_finish(req, res); end
- # source://rack//lib/rack/events.rb#65
+ # source://rack//lib/rack/events.rb#69
def on_send(req, res); end
- # source://rack//lib/rack/events.rb#59
+ # source://rack//lib/rack/events.rb#63
def on_start(req, res); end
end
-# source://rack//lib/rack/events.rb#91
+# source://rack//lib/rack/events.rb#95
class Rack::Events::BufferedResponse < ::Rack::Response::Raw
# @return [BufferedResponse] a new instance of BufferedResponse
#
- # source://rack//lib/rack/events.rb#94
+ # source://rack//lib/rack/events.rb#98
def initialize(status, headers, body); end
# Returns the value of attribute body.
#
- # source://rack//lib/rack/events.rb#92
+ # source://rack//lib/rack/events.rb#96
def body; end
- # source://rack//lib/rack/events.rb#99
+ # source://rack//lib/rack/events.rb#103
def to_a; end
end
-# source://rack//lib/rack/events.rb#75
+# source://rack//lib/rack/events.rb#79
class Rack::Events::EventedBodyProxy < ::Rack::BodyProxy
# @return [EventedBodyProxy] a new instance of EventedBodyProxy
#
- # source://rack//lib/rack/events.rb#78
+ # source://rack//lib/rack/events.rb#82
def initialize(body, request, response, handlers, &block); end
- # source://rack//lib/rack/events.rb#85
+ # source://rack//lib/rack/events.rb#89
def each; end
# Returns the value of attribute request.
#
- # source://rack//lib/rack/events.rb#76
+ # source://rack//lib/rack/events.rb#80
def request; end
# Returns the value of attribute response.
#
- # source://rack//lib/rack/events.rb#76
+ # source://rack//lib/rack/events.rb#80
def response; end
end
-# source://rack//lib/rack/file.rb#6
-Rack::File = Rack::Files
-
# Rack::Files serves files below the +root+ directory given, according to the
# path info of the Rack request.
# e.g. when Rack::Files.new("/etc") is used, you can access 'passwd' file
@@ -1360,106 +1047,99 @@ Rack::File = Rack::Files
# Handlers can detect if bodies are a Rack::Files, and use mechanisms
# like sendfile on the +path+.
#
-# source://rack//lib/rack/files.rb#14
+# source://rack//lib/rack/files.rb#20
class Rack::Files
# @return [Files] a new instance of Files
#
- # source://rack//lib/rack/files.rb#29
+ # source://rack//lib/rack/files.rb#27
def initialize(root, headers = T.unsafe(nil), default_mime = T.unsafe(nil)); end
- # source://rack//lib/rack/files.rb#36
+ # source://rack//lib/rack/files.rb#34
def call(env); end
- # source://rack//lib/rack/files.rb#41
+ # source://rack//lib/rack/files.rb#39
def get(env); end
# Returns the value of attribute root.
#
- # source://rack//lib/rack/files.rb#27
+ # source://rack//lib/rack/files.rb#25
def root; end
- # source://rack//lib/rack/files.rb#70
+ # source://rack//lib/rack/files.rb#68
def serving(request, path); end
private
- # source://rack//lib/rack/files.rb#192
+ # source://rack//lib/rack/files.rb#190
def fail(status, body, headers = T.unsafe(nil)); end
- # source://rack//lib/rack/files.rb#211
+ # source://rack//lib/rack/files.rb#209
def filesize(path); end
# The MIME type for the contents of the file located at @path
#
- # source://rack//lib/rack/files.rb#207
+ # source://rack//lib/rack/files.rb#205
def mime_type(path, default_mime); end
-
- class << self
- # @todo remove in 3.0
- #
- # source://rack//lib/rack/files.rb#20
- def method_added(name); end
- end
end
-# source://rack//lib/rack/files.rb#15
+# source://rack//lib/rack/files.rb#21
Rack::Files::ALLOWED_VERBS = T.let(T.unsafe(nil), Array)
-# source://rack//lib/rack/files.rb#16
+# source://rack//lib/rack/files.rb#22
Rack::Files::ALLOW_HEADER = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack/files.rb#123
+# source://rack//lib/rack/files.rb#121
class Rack::Files::BaseIterator
# @return [BaseIterator] a new instance of BaseIterator
#
- # source://rack//lib/rack/files.rb#126
+ # source://rack//lib/rack/files.rb#124
def initialize(path, ranges, options); end
- # source://rack//lib/rack/files.rb#146
+ # source://rack//lib/rack/files.rb#144
def bytesize; end
- # source://rack//lib/rack/files.rb#155
+ # source://rack//lib/rack/files.rb#153
def close; end
- # source://rack//lib/rack/files.rb#132
+ # source://rack//lib/rack/files.rb#130
def each; end
# Returns the value of attribute options.
#
- # source://rack//lib/rack/files.rb#124
+ # source://rack//lib/rack/files.rb#122
def options; end
# Returns the value of attribute path.
#
- # source://rack//lib/rack/files.rb#124
+ # source://rack//lib/rack/files.rb#122
def path; end
# Returns the value of attribute ranges.
#
- # source://rack//lib/rack/files.rb#124
+ # source://rack//lib/rack/files.rb#122
def ranges; end
private
- # source://rack//lib/rack/files.rb#173
+ # source://rack//lib/rack/files.rb#171
def each_range_part(file, range); end
# @return [Boolean]
#
- # source://rack//lib/rack/files.rb#159
+ # source://rack//lib/rack/files.rb#157
def multipart?; end
- # source://rack//lib/rack/files.rb#163
+ # source://rack//lib/rack/files.rb#161
def multipart_heading(range); end
end
-# source://rack//lib/rack/files.rb#186
+# source://rack//lib/rack/files.rb#184
class Rack::Files::Iterator < ::Rack::Files::BaseIterator
- # source://rack//lib/rack/files.rb#124
+ # source://rack//lib/rack/files.rb#122
def to_path; end
end
-# source://rack//lib/rack/files.rb#17
+# source://rack//lib/rack/files.rb#23
Rack::Files::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String)
# Rack::ForwardRequest gets caught by Rack::Recursive and redirects
@@ -1467,199 +1147,312 @@ Rack::Files::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String)
#
# raise ForwardRequest.new("/not-found")
#
-# source://rack//lib/rack/recursive.rb#12
+# source://rack//lib/rack/recursive.rb#14
class Rack::ForwardRequest < ::Exception
# @return [ForwardRequest] a new instance of ForwardRequest
#
- # source://rack//lib/rack/recursive.rb#15
+ # source://rack//lib/rack/recursive.rb#17
def initialize(url, env = T.unsafe(nil)); end
# Returns the value of attribute env.
#
- # source://rack//lib/rack/recursive.rb#13
+ # source://rack//lib/rack/recursive.rb#15
def env; end
# Returns the value of attribute url.
#
- # source://rack//lib/rack/recursive.rb#13
+ # source://rack//lib/rack/recursive.rb#15
def url; end
end
# HTTP method verbs
#
-# source://rack//lib/rack.rb#39
+# source://rack//lib/rack/constants.rb#28
Rack::GET = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#44
+# source://rack//lib/rack/constants.rb#33
Rack::HEAD = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#20
+# source://rack//lib/rack/constants.rb#7
Rack::HTTPS = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#35
+# source://rack//lib/rack/constants.rb#16
Rack::HTTP_COOKIE = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#17
+# Request env keys
+#
+# source://rack//lib/rack/constants.rb#5
Rack::HTTP_HOST = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#18
+# source://rack//lib/rack/constants.rb#6
Rack::HTTP_PORT = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#19
-Rack::HTTP_VERSION = T.let(T.unsafe(nil), String)
-
-# *Handlers* connect web servers with Rack.
-#
-# Rack includes Handlers for Thin, WEBrick, FastCGI, CGI, SCGI
-# and LiteSpeed.
-#
-# Handlers usually are activated by calling MyHandler.run(myapp).
-# A second optional hash can be passed to include server-specific
-# configuration.
+# Rack::Head returns an empty body for all HEAD requests. It leaves
+# all other requests unchanged.
#
-# source://rack//lib/rack/handler.rb#12
-module Rack::Handler
- class << self
- # source://rack//lib/rack/handler.rb#51
- def default; end
+# source://rack//lib/rack/head.rb#9
+class Rack::Head
+ # @return [Head] a new instance of Head
+ #
+ # source://rack//lib/rack/head.rb#10
+ def initialize(app); end
- # source://rack//lib/rack/handler.rb#13
- def get(server); end
+ # source://rack//lib/rack/head.rb#14
+ def call(env); end
+end
- # Select first available Rack handler given an `Array` of server names.
- # Raises `LoadError` if no handler was found.
- #
- # > pick ['thin', 'webrick']
- # => Rack::Handler::WEBrick
- #
- # @raise [LoadError]
- #
- # source://rack//lib/rack/handler.rb#36
- def pick(server_names); end
+# Rack::Headers is a Hash subclass that downcases all keys. It's designed
+# to be used by rack applications that don't implement the Rack 3 SPEC
+# (by using non-lowercase response header keys), automatically handling
+# the downcasing of keys.
+#
+# source://rack//lib/rack/headers.rb#8
+class Rack::Headers < ::Hash
+ # source://rack//lib/rack/headers.rb#110
+ def [](key); end
- # source://rack//lib/rack/handler.rb#85
- def register(server, klass); end
+ # source://rack//lib/rack/headers.rb#114
+ def []=(key, value); end
- # Transforms server-name constants to their canonical form as filenames,
- # then tries to require them but silences the LoadError if not found
- #
- # Naming convention:
- #
- # Foo # => 'foo'
- # FooBar # => 'foo_bar.rb'
- # FooBAR # => 'foobar.rb'
- # FOObar # => 'foobar.rb'
- # FOOBAR # => 'foobar.rb'
- # FooBarBaz # => 'foo_bar_baz.rb'
- #
- # source://rack//lib/rack/handler.rb#75
- def try_require(prefix, const_name); end
- end
-end
+ # source://rack//lib/rack/headers.rb#119
+ def assoc(key); end
-# source://rack//lib/rack/handler/cgi.rb#5
-class Rack::Handler::CGI
- class << self
- # source://rack//lib/rack/handler/cgi.rb#6
- def run(app, **options); end
+ # @raise [TypeError]
+ #
+ # source://rack//lib/rack/headers.rb#123
+ def compare_by_identity; end
- # source://rack//lib/rack/handler/cgi.rb#51
- def send_body(body); end
+ # source://rack//lib/rack/headers.rb#127
+ def delete(key); end
- # source://rack//lib/rack/handler/cgi.rb#40
- def send_headers(status, headers); end
+ # source://rack//lib/rack/headers.rb#131
+ def dig(key, *a); end
- # source://rack//lib/rack/handler/cgi.rb#11
- def serve(app); end
- end
-end
+ # :nocov:
+ #
+ # source://rack//lib/rack/headers.rb#227
+ def except(*a); end
-# source://rack//lib/rack/handler.rb#48
-Rack::Handler::SERVER_NAMES = T.let(T.unsafe(nil), Array)
+ # source://rack//lib/rack/headers.rb#135
+ def fetch(key, *default, &block); end
-# Rack::Head returns an empty body for all HEAD requests. It leaves
-# all other requests unchanged.
-#
-# source://rack//lib/rack/head.rb#6
-class Rack::Head
- # @return [Head] a new instance of Head
+ # source://rack//lib/rack/headers.rb#140
+ def fetch_values(*a); end
+
+ # @return [Boolean]
#
- # source://rack//lib/rack/head.rb#7
- def initialize(app); end
+ # source://rack//lib/rack/headers.rb#144
+ def has_key?(key); end
- # source://rack//lib/rack/head.rb#11
- def call(env); end
+ # @return [Boolean]
+ #
+ # source://rack//lib/rack/headers.rb#144
+ def include?(key); end
+
+ # source://rack//lib/rack/headers.rb#151
+ def invert; end
+
+ # @return [Boolean]
+ #
+ # source://rack//lib/rack/headers.rb#144
+ def key?(key); end
+
+ # @return [Boolean]
+ #
+ # source://rack//lib/rack/headers.rb#144
+ def member?(key); end
+
+ # source://rack//lib/rack/headers.rb#157
+ def merge(hash, &block); end
+
+ # source://rack//lib/rack/headers.rb#186
+ def merge!(hash, &block); end
+
+ # source://rack//lib/rack/headers.rb#161
+ def reject(&block); end
+
+ # source://rack//lib/rack/headers.rb#167
+ def replace(hash); end
+
+ # source://rack//lib/rack/headers.rb#172
+ def select(&block); end
+
+ # :nocov:
+ #
+ # source://rack//lib/rack/headers.rb#205
+ def slice(*a); end
+
+ # source://rack//lib/rack/headers.rb#114
+ def store(key, value); end
+
+ # source://rack//lib/rack/headers.rb#178
+ def to_proc; end
+
+ # source://rack//lib/rack/headers.rb#211
+ def transform_keys(&block); end
+
+ # source://rack//lib/rack/headers.rb#215
+ def transform_keys!; end
+
+ # source://rack//lib/rack/headers.rb#182
+ def transform_values(&block); end
+
+ # source://rack//lib/rack/headers.rb#186
+ def update(hash, &block); end
+
+ # source://rack//lib/rack/headers.rb#198
+ def values_at(*keys); end
+
+ private
+
+ # source://rack//lib/rack/headers.rb#234
+ def downcase_key(key); end
+
+ class << self
+ # source://rack//lib/rack/headers.rb#91
+ def [](*items); end
+ end
end
-# source://rack//lib/rack.rb#46
+# source://rack//lib/rack/headers.rb#9
+Rack::Headers::KNOWN_HEADERS = T.let(T.unsafe(nil), Hash)
+
+# source://rack//lib/rack/constants.rb#36
Rack::LINK = T.let(T.unsafe(nil), String)
# Rack::Lint validates your application and the requests and
# responses according to the Rack spec.
#
-# source://rack//lib/rack/lint.rb#9
+# source://rack//lib/rack/lint.rb#13
class Rack::Lint
- include ::Rack::Lint::Assertion
-
# @return [Lint] a new instance of Lint
#
- # source://rack//lib/rack/lint.rb#10
+ # source://rack//lib/rack/lint.rb#19
def initialize(app); end
- # @raise [LintError]
+ # AUTHORS: n.b. The trailing whitespace between paragraphs is important and
+ # should not be removed. The whitespace creates paragraphs in the RDoc
+ # output.
+ #
+ # This specification aims to formalize the Rack protocol. You
+ # can (and should) use Rack::Lint to enforce it.
+ #
+ # When you develop middleware, be sure to add a Lint before and
+ # after to catch all mistakes.
+ #
+ # = Rack applications
#
- # source://rack//lib/rack/lint.rb#41
- def _call(env); end
-
# A Rack application is a Ruby object (not a class) that
# responds to +call+.
#
- # source://rack//lib/rack/lint.rb#37
+ # source://rack//lib/rack/lint.rb#40
def call(env = T.unsafe(nil)); end
+end
- # === The Content-Length
+# :stopdoc:
+#
+# source://rack//lib/rack/lint.rb#25
+class Rack::Lint::LintError < ::RuntimeError; end
+
+# source://rack//lib/rack/lint.rb#15
+Rack::Lint::REQUEST_PATH_ABSOLUTE_FORM = T.let(T.unsafe(nil), Regexp)
+
+# source://rack//lib/rack/lint.rb#17
+Rack::Lint::REQUEST_PATH_ASTERISK_FORM = T.let(T.unsafe(nil), String)
+
+# source://rack//lib/rack/lint.rb#16
+Rack::Lint::REQUEST_PATH_AUTHORITY_FORM = T.let(T.unsafe(nil), Regexp)
+
+# source://rack//lib/rack/lint.rb#14
+Rack::Lint::REQUEST_PATH_ORIGIN_FORM = T.let(T.unsafe(nil), Regexp)
+
+# source://rack//lib/rack/lint.rb#44
+class Rack::Lint::Wrapper
+ # @return [Wrapper] a new instance of Wrapper
+ #
+ # source://rack//lib/rack/lint.rb#45
+ def initialize(app, env); end
+
+ # ==== Streaming Body
+ #
+ # @raise [LintError]
+ #
+ # source://rack//lib/rack/lint.rb#939
+ def call(stream); end
+
+ # ==== The +content-length+ Header
+ #
+ # source://rack//lib/rack/lint.rb#757
+ def check_content_length_header(status, headers); end
+
+ # ==== The +content-type+ Header
#
- # source://rack//lib/rack/lint.rb#708
- def check_content_length(status, headers); end
+ # source://rack//lib/rack/lint.rb#741
+ def check_content_type_header(status, headers); end
- # === The Content-Type
+ # === Early Hints
+ #
+ # The application or any middleware may call the rack.early_hints
+ # with an object which would be valid as the headers of a Rack response.
#
- # source://rack//lib/rack/lint.rb#694
- def check_content_type(status, headers); end
+ # source://rack//lib/rack/lint.rb#657
+ def check_early_hints(env); end
# == The Environment
#
# @raise [LintError]
#
- # source://rack//lib/rack/lint.rb#73
- def check_env(env); end
+ # source://rack//lib/rack/lint.rb#101
+ def check_environment(env); end
# === The Error Stream
#
- # source://rack//lib/rack/lint.rb#483
- def check_error(error); end
+ # source://rack//lib/rack/lint.rb#531
+ def check_error_stream(error); end
+
+ # source://rack//lib/rack/lint.rb#731
+ def check_header_value(key, value); end
# === The Headers
#
- # source://rack//lib/rack/lint.rb#656
- def check_headers(header); end
+ # source://rack//lib/rack/lint.rb#691
+ def check_headers(headers); end
# === Hijacking
#
- # AUTHORS: n.b. The trailing whitespace between paragraphs is important and
- # should not be removed. The whitespace creates paragraphs in the RDoc
- # output.
+ # The hijacking interfaces provides a means for an application to take
+ # control of the HTTP connection. There are two distinct hijack
+ # interfaces: full hijacking where the application takes over the raw
+ # connection, and partial hijacking where the application takes over
+ # just the response body stream. In both cases, the application is
+ # responsible for closing the hijacked stream.
+ #
+ # Full hijacking only works with HTTP/1. Partial hijacking is functionally
+ # equivalent to streaming bodies, and is still optionally supported for
+ # backwards compatibility with older Rack versions.
+ #
+ # ==== Full Hijack
#
- # ==== Request (before status)
+ # Full hijack is used to completely take over an HTTP/1 connection. It
+ # occurs before any headers are written and causes the request to
+ # ignores any response generated by the application.
#
- # source://rack//lib/rack/lint.rb#548
+ # It is intended to be used when applications need access to raw HTTP/1
+ # connection.
+ #
+ # source://rack//lib/rack/lint.rb#591
def check_hijack(env); end
- # ==== Response (after headers)
- # It is also possible to hijack a response after the status and headers
- # have been sent.
+ # ==== Partial Hijack
+ #
+ # Partial hijack is used for bi-directional streaming of the request and
+ # response body. It occurs after the status and headers are written by
+ # the server and causes the server to ignore the Body of the response.
#
- # source://rack//lib/rack/lint.rb#595
+ # It is intended to be used when applications need bi-directional
+ # streaming.
+ #
+ # source://rack//lib/rack/lint.rb#619
def check_hijack_response(headers, env); end
# === The Input Stream
@@ -1667,129 +1460,145 @@ class Rack::Lint
# The input stream is an IO-like object which contains the raw HTTP
# POST data.
#
- # source://rack//lib/rack/lint.rb#365
- def check_input(input); end
+ # source://rack//lib/rack/lint.rb#427
+ def check_input_stream(input); end
+
+ # ==== The +rack.protocol+ Header
+ #
+ # source://rack//lib/rack/lint.rb#785
+ def check_rack_protocol_header(status, headers); end
+ # == The Response
+ #
# === The Status
#
- # source://rack//lib/rack/lint.rb#647
+ # source://rack//lib/rack/lint.rb#680
def check_status(status); end
- # source://rack//lib/rack/lint.rb#781
+ # Setting this value informs the server that it should perform a
+ # connection upgrade. In HTTP/1, this is done using the +upgrade+
+ # header. In HTTP/2, this is done by accepting the request.
+ #
+ # === The Body
+ #
+ # The Body is typically an +Array+ of +String+ instances, an enumerable
+ # that yields +String+ instances, a +Proc+ instance, or a File-like
+ # object.
+ #
+ # The Body must respond to +each+ or +call+. It may optionally respond
+ # to +to_path+ or +to_ary+. A Body that responds to +each+ is considered
+ # to be an Enumerable Body. A Body that responds to +call+ is considered
+ # to be a Streaming Body.
+ #
+ # A Body that responds to both +each+ and +call+ must be treated as an
+ # Enumerable Body, not a Streaming Body. If it responds to +each+, you
+ # must call +each+ and not +call+. If the Body doesn't respond to
+ # +each+, then you can assume it responds to +call+.
+ #
+ # The Body must either be consumed or returned. The Body is consumed by
+ # optionally calling either +each+ or +call+.
+ # Then, if the Body responds to +close+, it must be called to release
+ # any resources associated with the generation of the body.
+ # In other words, +close+ must always be called at least once; typically
+ # after the web server has sent the response to the client, but also in
+ # cases where the Rack application makes internal/virtual requests and
+ # discards the response.
+ #
+ # source://rack//lib/rack/lint.rb#831
def close; end
- # === The Body
+ # ==== Enumerable Body
+ #
+ # @raise [LintError]
#
- # source://rack//lib/rack/lint.rb#734
+ # source://rack//lib/rack/lint.rb#865
def each; end
- # source://rack//lib/rack/lint.rb#721
- def verify_content_length(bytes); end
-end
+ # @return [Boolean]
+ #
+ # source://rack//lib/rack/lint.rb#910
+ def respond_to?(name, *_arg1); end
-# source://rack//lib/rack/lint.rb#18
-module Rack::Lint::Assertion
- # source://rack//lib/rack/lint.rb#19
- def assert(message); end
+ # @raise [LintError]
+ #
+ # source://rack//lib/rack/lint.rb#60
+ def response; end
+
+ # If the Body responds to +to_ary+, it must return an +Array+ whose
+ # contents are identical to that produced by calling +each+.
+ # Middleware may call +to_ary+ directly on the Body and return a new
+ # Body in its place. In other words, middleware can only process the
+ # Body directly if it responds to +to_ary+. If the Body responds to both
+ # +to_ary+ and +close+, its implementation of +to_ary+ must call
+ # +close+.
+ #
+ # source://rack//lib/rack/lint.rb#926
+ def to_ary; end
+
+ # source://rack//lib/rack/lint.rb#906
+ def to_path; end
+
+ # source://rack//lib/rack/lint.rb#770
+ def verify_content_length(size); end
+
+ # source://rack//lib/rack/lint.rb#847
+ def verify_to_path; end
end
-# source://rack//lib/rack/lint.rb#492
-class Rack::Lint::ErrorWrapper
- include ::Rack::Lint::Assertion
+# source://rack//lib/rack/lint.rb#904
+Rack::Lint::Wrapper::BODY_METHODS = T.let(T.unsafe(nil), Hash)
+# source://rack//lib/rack/lint.rb#540
+class Rack::Lint::Wrapper::ErrorWrapper
# @return [ErrorWrapper] a new instance of ErrorWrapper
#
- # source://rack//lib/rack/lint.rb#495
+ # source://rack//lib/rack/lint.rb#541
def initialize(error); end
# * +close+ must never be called on the error stream.
#
# @raise [LintError]
#
- # source://rack//lib/rack/lint.rb#517
+ # source://rack//lib/rack/lint.rb#563
def close(*args); end
# * +flush+ must be called without arguments and must be called
# in order to make the error appear for sure.
#
- # source://rack//lib/rack/lint.rb#512
+ # source://rack//lib/rack/lint.rb#558
def flush; end
# * +puts+ must be called with a single argument that responds to +to_s+.
#
- # source://rack//lib/rack/lint.rb#500
+ # source://rack//lib/rack/lint.rb#546
def puts(str); end
# * +write+ must be called with a single argument that is a String.
#
# @raise [LintError]
#
- # source://rack//lib/rack/lint.rb#505
+ # source://rack//lib/rack/lint.rb#551
def write(str); end
end
-# source://rack//lib/rack/lint.rb#522
-class Rack::Lint::HijackWrapper
- include ::Rack::Lint::Assertion
- extend ::Forwardable
-
- # @return [HijackWrapper] a new instance of HijackWrapper
- #
- # source://rack//lib/rack/lint.rb#533
- def initialize(io); end
-
- # source://forwardable/1.3.3/forwardable.rb#231
- def close(*args, **_arg1, &block); end
-
- # source://forwardable/1.3.3/forwardable.rb#231
- def close_read(*args, **_arg1, &block); end
-
- # source://forwardable/1.3.3/forwardable.rb#231
- def close_write(*args, **_arg1, &block); end
-
- # source://forwardable/1.3.3/forwardable.rb#231
- def closed?(*args, **_arg1, &block); end
-
- # source://forwardable/1.3.3/forwardable.rb#231
- def flush(*args, **_arg1, &block); end
-
- # source://forwardable/1.3.3/forwardable.rb#231
- def read(*args, **_arg1, &block); end
-
- # source://forwardable/1.3.3/forwardable.rb#231
- def read_nonblock(*args, **_arg1, &block); end
-
- # source://forwardable/1.3.3/forwardable.rb#231
- def write(*args, **_arg1, &block); end
-
- # source://forwardable/1.3.3/forwardable.rb#231
- def write_nonblock(*args, **_arg1, &block); end
-end
-
-# source://rack//lib/rack/lint.rb#526
-Rack::Lint::HijackWrapper::REQUIRED_METHODS = T.let(T.unsafe(nil), Array)
-
-# source://rack//lib/rack/lint.rb#383
-class Rack::Lint::InputWrapper
- include ::Rack::Lint::Assertion
-
+# source://rack//lib/rack/lint.rb#445
+class Rack::Lint::Wrapper::InputWrapper
# @return [InputWrapper] a new instance of InputWrapper
#
- # source://rack//lib/rack/lint.rb#386
+ # source://rack//lib/rack/lint.rb#446
def initialize(input); end
- # * +close+ must never be called on the input stream.
- #
- # @raise [LintError]
+ # * +close+ can be called on the input stream to indicate that
+ # any remaining input is not needed.
#
- # source://rack//lib/rack/lint.rb#477
+ # source://rack//lib/rack/lint.rb#523
def close(*args); end
# * +each+ must be called without arguments and only yield Strings.
#
# @raise [LintError]
#
- # source://rack//lib/rack/lint.rb#451
+ # source://rack//lib/rack/lint.rb#511
def each(*args); end
# * +gets+ must be called without arguments and return a string,
@@ -1797,10 +1606,10 @@ class Rack::Lint::InputWrapper
#
# @raise [LintError]
#
- # source://rack//lib/rack/lint.rb#392
+ # source://rack//lib/rack/lint.rb#452
def gets(*args); end
- # * +read+ behaves like IO#read.
+ # * +read+ behaves like IO#read.
# Its signature is read([length, [buffer]]).
#
# If given, +length+ must be a non-negative Integer (>= 0) or +nil+,
@@ -1818,25 +1627,52 @@ class Rack::Lint::InputWrapper
# If +buffer+ is given, then the read data will be placed
# into +buffer+ instead of a newly created String object.
#
- # source://rack//lib/rack/lint.rb#418
+ # source://rack//lib/rack/lint.rb#478
def read(*args); end
+end
- # * +rewind+ must be called without arguments. It rewinds the input
- # stream back to the beginning. It must not raise Errno::ESPIPE:
- # that is, it may not be a pipe or a socket. Therefore, handler
- # developers must buffer the input data into some rewindable object
- # if the underlying input stream is not rewindable.
- #
- # @raise [LintError]
+# source://rack//lib/rack/lint.rb#959
+class Rack::Lint::Wrapper::StreamWrapper
+ extend ::Forwardable
+
+ # @return [StreamWrapper] a new instance of StreamWrapper
#
- # source://rack//lib/rack/lint.rb#466
- def rewind(*args); end
+ # source://rack//lib/rack/lint.rb#974
+ def initialize(stream); end
+
+ # source://forwardable/1.3.3/forwardable.rb#231
+ def <<(*args, **_arg1, &block); end
+
+ # source://forwardable/1.3.3/forwardable.rb#231
+ def close(*args, **_arg1, &block); end
+
+ # source://forwardable/1.3.3/forwardable.rb#231
+ def close_read(*args, **_arg1, &block); end
+
+ # source://forwardable/1.3.3/forwardable.rb#231
+ def close_write(*args, **_arg1, &block); end
+
+ # source://forwardable/1.3.3/forwardable.rb#231
+ def closed?(*args, **_arg1, &block); end
+
+ # source://forwardable/1.3.3/forwardable.rb#231
+ def flush(*args, **_arg1, &block); end
+
+ # source://forwardable/1.3.3/forwardable.rb#231
+ def read(*args, **_arg1, &block); end
+
+ # source://forwardable/1.3.3/forwardable.rb#231
+ def write(*args, **_arg1, &block); end
end
-# :stopdoc:
+# The semantics of these IO methods must be a best effort match to
+# those of a normal Ruby IO or Socket object, using standard arguments
+# and raising standard exceptions. Servers are encouraged to simply
+# pass on real IO objects, although it is recognized that this approach
+# is not directly compatible with HTTP/2.
#
-# source://rack//lib/rack/lint.rb#17
-class Rack::Lint::LintError < ::RuntimeError; end
+# source://rack//lib/rack/lint.rb#967
+Rack::Lint::Wrapper::StreamWrapper::REQUIRED_METHODS = T.let(T.unsafe(nil), Array)
# Rack::Lock locks every request inside a mutex, so that every request
# will effectively be executed synchronously.
@@ -1853,20 +1689,20 @@ class Rack::Lock
private
- # source://rack//lib/rack/lock.rb#27
+ # source://rack//lib/rack/lock.rb#25
def unlock; end
end
# Sets up rack.logger to write to rack.errors stream
#
-# source://rack//lib/rack/logger.rb#7
+# source://rack//lib/rack/logger.rb#10
class Rack::Logger
# @return [Logger] a new instance of Logger
#
- # source://rack//lib/rack/logger.rb#8
+ # source://rack//lib/rack/logger.rb#11
def initialize(app, level = T.unsafe(nil)); end
- # source://rack//lib/rack/logger.rb#12
+ # source://rack//lib/rack/logger.rb#15
def call(env); end
end
@@ -1904,38 +1740,38 @@ end
# source://rack//lib/rack/media_type.rb#7
Rack::MediaType::SPLIT_PATTERN = T.let(T.unsafe(nil), Regexp)
-# source://rack//lib/rack/method_override.rb#4
+# source://rack//lib/rack/method_override.rb#8
class Rack::MethodOverride
# @return [MethodOverride] a new instance of MethodOverride
#
- # source://rack//lib/rack/method_override.rb#11
+ # source://rack//lib/rack/method_override.rb#15
def initialize(app); end
- # source://rack//lib/rack/method_override.rb#15
+ # source://rack//lib/rack/method_override.rb#19
def call(env); end
- # source://rack//lib/rack/method_override.rb#27
+ # source://rack//lib/rack/method_override.rb#31
def method_override(env); end
private
- # source://rack//lib/rack/method_override.rb#40
+ # source://rack//lib/rack/method_override.rb#44
def allowed_methods; end
- # source://rack//lib/rack/method_override.rb#44
+ # source://rack//lib/rack/method_override.rb#48
def method_override_param(req); end
end
-# source://rack//lib/rack/method_override.rb#9
+# source://rack//lib/rack/method_override.rb#13
Rack::MethodOverride::ALLOWED_METHODS = T.let(T.unsafe(nil), Array)
-# source://rack//lib/rack/method_override.rb#5
+# source://rack//lib/rack/method_override.rb#9
Rack::MethodOverride::HTTP_METHODS = T.let(T.unsafe(nil), Array)
-# source://rack//lib/rack/method_override.rb#8
+# source://rack//lib/rack/method_override.rb#12
Rack::MethodOverride::HTTP_METHOD_OVERRIDE_HEADER = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack/method_override.rb#7
+# source://rack//lib/rack/method_override.rb#11
Rack::MethodOverride::METHOD_OVERRIDE_PARAM_KEY = T.let(T.unsafe(nil), String)
# source://rack//lib/rack/mime.rb#4
@@ -2030,53 +1866,53 @@ Rack::Mime::MIME_TYPES = T.let(T.unsafe(nil), Hash)
# :fatal:: Raise a FatalWarning if the app writes to rack.errors.
# :lint:: If true, wrap the application in a Rack::Lint.
#
-# source://rack//lib/rack/mock.rb#22
+# source://rack//lib/rack/mock_request.rb#23
class Rack::MockRequest
# @return [MockRequest] a new instance of MockRequest
#
- # source://rack//lib/rack/mock.rb#52
+ # source://rack//lib/rack/mock_request.rb#44
def initialize(app); end
# Make a DELETE request and return a MockResponse. See #request.
#
- # source://rack//lib/rack/mock.rb#65
+ # source://rack//lib/rack/mock_request.rb#57
def delete(uri, opts = T.unsafe(nil)); end
# Make a GET request and return a MockResponse. See #request.
#
- # source://rack//lib/rack/mock.rb#57
+ # source://rack//lib/rack/mock_request.rb#49
def get(uri, opts = T.unsafe(nil)); end
# Make a HEAD request and return a MockResponse. See #request.
#
- # source://rack//lib/rack/mock.rb#67
+ # source://rack//lib/rack/mock_request.rb#59
def head(uri, opts = T.unsafe(nil)); end
# Make an OPTIONS request and return a MockResponse. See #request.
#
- # source://rack//lib/rack/mock.rb#69
+ # source://rack//lib/rack/mock_request.rb#61
def options(uri, opts = T.unsafe(nil)); end
# Make a PATCH request and return a MockResponse. See #request.
#
- # source://rack//lib/rack/mock.rb#63
+ # source://rack//lib/rack/mock_request.rb#55
def patch(uri, opts = T.unsafe(nil)); end
# Make a POST request and return a MockResponse. See #request.
#
- # source://rack//lib/rack/mock.rb#59
+ # source://rack//lib/rack/mock_request.rb#51
def post(uri, opts = T.unsafe(nil)); end
# Make a PUT request and return a MockResponse. See #request.
#
- # source://rack//lib/rack/mock.rb#61
+ # source://rack//lib/rack/mock_request.rb#53
def put(uri, opts = T.unsafe(nil)); end
# Make a request using the given request method for the given
# uri to the rack application and return a MockResponse.
# Options given are passed to MockRequest.env_for.
#
- # source://rack//lib/rack/mock.rb#74
+ # source://rack//lib/rack/mock_request.rb#66
def request(method = T.unsafe(nil), uri = T.unsafe(nil), opts = T.unsafe(nil)); end
class << self
@@ -2085,100 +1921,98 @@ class Rack::MockRequest
# Options:
# :fatal :: Whether to raise an exception if request outputs to rack.errors
# :input :: The rack.input to set
+ # :http_version :: The SERVER_PROTOCOL to set
# :method :: The HTTP request method to use
# :params :: The params to use
# :script_name :: The SCRIPT_NAME to set
#
- # source://rack//lib/rack/mock.rb#105
+ # source://rack//lib/rack/mock_request.rb#98
def env_for(uri = T.unsafe(nil), opts = T.unsafe(nil)); end
# For historical reasons, we're pinning to RFC 2396.
# URI::Parser = URI::RFC2396_Parser
#
- # source://rack//lib/rack/mock.rb#92
+ # source://rack//lib/rack/mock_request.rb#84
def parse_uri_rfc2396(uri); end
end
end
-# source://rack//lib/rack/mock.rb#43
-Rack::MockRequest::DEFAULT_ENV = T.let(T.unsafe(nil), Hash)
-
-# source://rack//lib/rack/mock.rb#26
+# source://rack//lib/rack/mock_request.rb#27
class Rack::MockRequest::FatalWarner
- # source://rack//lib/rack/mock.rb#35
+ # source://rack//lib/rack/mock_request.rb#36
def flush; end
# @raise [FatalWarning]
#
- # source://rack//lib/rack/mock.rb#27
+ # source://rack//lib/rack/mock_request.rb#28
def puts(warning); end
- # source://rack//lib/rack/mock.rb#38
+ # source://rack//lib/rack/mock_request.rb#39
def string; end
# @raise [FatalWarning]
#
- # source://rack//lib/rack/mock.rb#31
+ # source://rack//lib/rack/mock_request.rb#32
def write(warning); end
end
-# source://rack//lib/rack/mock.rb#23
+# source://rack//lib/rack/mock_request.rb#24
class Rack::MockRequest::FatalWarning < ::RuntimeError; end
# Rack::MockResponse provides useful helpers for testing your apps.
# Usually, you don't create the MockResponse on your own, but use
# MockRequest.
#
-# source://rack//lib/rack/mock.rb#173
+# source://rack//lib/rack/mock_response.rb#13
class Rack::MockResponse < ::Rack::Response
# @return [MockResponse] a new instance of MockResponse
#
- # source://rack//lib/rack/mock.rb#184
+ # source://rack//lib/rack/mock_response.rb#24
def initialize(status, headers, body, errors = T.unsafe(nil)); end
- # source://rack//lib/rack/mock.rb#194
+ # source://rack//lib/rack/mock_response.rb#39
def =~(other); end
- # source://rack//lib/rack/mock.rb#202
+ # source://rack//lib/rack/mock_response.rb#47
def body; end
- # source://rack//lib/rack/mock.rb#226
+ # source://rack//lib/rack/mock_response.rb#73
def cookie(name); end
# Headers
#
- # source://rack//lib/rack/mock.rb#179
+ # source://rack//lib/rack/mock_response.rb#19
def cookies; end
# @return [Boolean]
#
- # source://rack//lib/rack/mock.rb#222
+ # source://rack//lib/rack/mock_response.rb#69
def empty?; end
# Errors
#
- # source://rack//lib/rack/mock.rb#182
+ # source://rack//lib/rack/mock_response.rb#22
def errors; end
# Errors
#
- # source://rack//lib/rack/mock.rb#182
+ # source://rack//lib/rack/mock_response.rb#22
def errors=(_arg0); end
- # source://rack//lib/rack/mock.rb#198
+ # source://rack//lib/rack/mock_response.rb#43
def match(other); end
# Headers
#
- # source://rack//lib/rack/mock.rb#179
+ # source://rack//lib/rack/mock_response.rb#19
def original_headers; end
private
- # source://rack//lib/rack/mock.rb#253
+ # source://rack//lib/rack/mock_response.rb#100
def identify_cookie_attributes(cookie_filling); end
- # source://rack//lib/rack/mock.rb#232
+ # source://rack//lib/rack/mock_response.rb#79
def parse_cookies_from_header; end
class << self
@@ -2190,252 +2024,292 @@ end
#
# Usually, Rack::Request#POST takes care of calling this.
#
-# source://rack//lib/rack/multipart/parser.rb#6
+# source://rack//lib/rack/multipart/parser.rb#9
module Rack::Multipart
class << self
- # source://rack//lib/rack/multipart.rb#58
+ # source://rack//lib/rack/multipart.rb#72
def build_multipart(params, first = T.unsafe(nil)); end
- # source://rack//lib/rack/multipart.rb#44
- def extract_multipart(req, params = T.unsafe(nil)); end
+ # source://rack//lib/rack/multipart.rb#68
+ def extract_multipart(request, params = T.unsafe(nil)); end
- # source://rack//lib/rack/multipart.rb#40
+ # source://rack//lib/rack/multipart.rb#48
def parse_multipart(env, params = T.unsafe(nil)); end
end
end
-# source://rack//lib/rack/multipart.rb#25
-Rack::Multipart::ATTRIBUTE = T.let(T.unsafe(nil), Regexp)
-
-# Updated definitions from RFC 2231
+# Base class for multipart exceptions that do not subclass from
+# other exception classes for backwards compatibility.
#
-# source://rack//lib/rack/multipart.rb#24
-Rack::Multipart::ATTRIBUTE_CHAR = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/multipart.rb#19
-Rack::Multipart::BROKEN = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/multipart.rb#17
-Rack::Multipart::CONDISP = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/multipart.rb#36
-Rack::Multipart::DISPPARM = T.let(T.unsafe(nil), Regexp)
+# source://rack//lib/rack/multipart/parser.rb#26
+class Rack::Multipart::BoundaryTooLongError < ::StandardError
+ include ::Rack::BadRequest
+end
-# source://rack//lib/rack/multipart.rb#13
+# source://rack//lib/rack/multipart/parser.rb#33
Rack::Multipart::EOL = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack/multipart.rb#32
-Rack::Multipart::EXTENDED_INITIAL_NAME = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/multipart.rb#34
-Rack::Multipart::EXTENDED_INITIAL_PARAMETER = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/multipart.rb#33
-Rack::Multipart::EXTENDED_INITIAL_VALUE = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/multipart.rb#29
-Rack::Multipart::EXTENDED_OTHER_NAME = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/multipart.rb#31
-Rack::Multipart::EXTENDED_OTHER_PARAMETER = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/multipart.rb#30
-Rack::Multipart::EXTENDED_OTHER_VALUE = T.let(T.unsafe(nil), Regexp)
+# Use specific error class when parsing multipart request
+# that ends early.
+#
+# source://rack//lib/rack/multipart/parser.rb#20
+class Rack::Multipart::EmptyContentError < ::EOFError
+ include ::Rack::BadRequest
+end
-# source://rack//lib/rack/multipart.rb#35
-Rack::Multipart::EXTENDED_PARAMETER = T.let(T.unsafe(nil), Regexp)
+# Prefer to use the BoundaryTooLongError class or Rack::BadRequest.
+#
+# source://rack//lib/rack/multipart/parser.rb#31
+Rack::Multipart::Error = Rack::Multipart::BoundaryTooLongError
-# source://rack//lib/rack/multipart/generator.rb#5
+# source://rack//lib/rack/multipart/generator.rb#7
class Rack::Multipart::Generator
# @return [Generator] a new instance of Generator
#
- # source://rack//lib/rack/multipart/generator.rb#6
+ # source://rack//lib/rack/multipart/generator.rb#8
def initialize(params, first = T.unsafe(nil)); end
- # source://rack//lib/rack/multipart/generator.rb#14
+ # source://rack//lib/rack/multipart/generator.rb#16
def dump; end
private
- # source://rack//lib/rack/multipart/generator.rb#87
+ # source://rack//lib/rack/multipart/generator.rb#89
def content_for_other(file, name); end
- # source://rack//lib/rack/multipart/generator.rb#75
+ # source://rack//lib/rack/multipart/generator.rb#77
def content_for_tempfile(io, file, name); end
- # source://rack//lib/rack/multipart/generator.rb#50
+ # source://rack//lib/rack/multipart/generator.rb#52
def flattened_params; end
# @return [Boolean]
#
- # source://rack//lib/rack/multipart/generator.rb#35
+ # source://rack//lib/rack/multipart/generator.rb#37
def multipart?; end
end
-# source://rack//lib/rack/multipart.rb#15
+# source://rack//lib/rack/multipart/parser.rb#34
Rack::Multipart::MULTIPART = T.let(T.unsafe(nil), Regexp)
-# source://rack//lib/rack/multipart.rb#14
+# source://rack//lib/rack/multipart.rb#16
Rack::Multipart::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack/multipart.rb#21
+# source://rack//lib/rack/multipart/parser.rb#36
Rack::Multipart::MULTIPART_CONTENT_DISPOSITION = T.let(T.unsafe(nil), Regexp)
-# source://rack//lib/rack/multipart.rb#22
+# source://rack//lib/rack/multipart/parser.rb#37
Rack::Multipart::MULTIPART_CONTENT_ID = T.let(T.unsafe(nil), Regexp)
-# source://rack//lib/rack/multipart.rb#20
+# source://rack//lib/rack/multipart/parser.rb#35
Rack::Multipart::MULTIPART_CONTENT_TYPE = T.let(T.unsafe(nil), Regexp)
-# source://rack//lib/rack/multipart/parser.rb#7
-class Rack::Multipart::MultipartPartLimitError < ::Errno::EMFILE; end
-
-# source://rack//lib/rack/multipart/parser.rb#8
-class Rack::Multipart::MultipartTotalPartLimitError < ::StandardError; end
+# source://rack//lib/rack/multipart.rb#18
+class Rack::Multipart::MissingInputError < ::StandardError
+ include ::Rack::BadRequest
+end
# source://rack//lib/rack/multipart/parser.rb#10
+class Rack::Multipart::MultipartPartLimitError < ::Errno::EMFILE
+ include ::Rack::BadRequest
+end
+
+# source://rack//lib/rack/multipart/parser.rb#14
+class Rack::Multipart::MultipartTotalPartLimitError < ::StandardError
+ include ::Rack::BadRequest
+end
+
+# Accumulator for multipart form data, conforming to the QueryParser API.
+# In future, the Parser could return the pair list directly, but that would
+# change its API.
+#
+# source://rack//lib/rack/multipart.rb#25
+class Rack::Multipart::ParamList
+ # @return [ParamList] a new instance of ParamList
+ #
+ # source://rack//lib/rack/multipart.rb#34
+ def initialize; end
+
+ # source://rack//lib/rack/multipart.rb#38
+ def <<(pair); end
+
+ # source://rack//lib/rack/multipart.rb#42
+ def to_params_hash; end
+
+ class << self
+ # source://rack//lib/rack/multipart.rb#26
+ def make_params; end
+
+ # source://rack//lib/rack/multipart.rb#30
+ def normalize_params(params, key, value); end
+ end
+end
+
+# source://rack//lib/rack/multipart/parser.rb#39
class Rack::Multipart::Parser
# @return [Parser] a new instance of Parser
#
- # source://rack//lib/rack/multipart/parser.rb#180
+ # source://rack//lib/rack/multipart/parser.rb#200
def initialize(boundary, tempfile, bufsize, query_parser); end
- # source://rack//lib/rack/multipart/parser.rb#199
- def on_read(content); end
+ # source://rack//lib/rack/multipart/parser.rb#217
+ def parse(io); end
- # source://rack//lib/rack/multipart/parser.rb#205
+ # source://rack//lib/rack/multipart/parser.rb#240
def result; end
# Returns the value of attribute state.
#
- # source://rack//lib/rack/multipart/parser.rb#178
+ # source://rack//lib/rack/multipart/parser.rb#198
def state; end
private
- # source://rack//lib/rack/multipart/parser.rb#302
+ # Scan until the we find the start or end of the boundary.
+ # If we find it, return the appropriate symbol for the start or
+ # end of the boundary. If we don't find the start or end of the
+ # boundary, clear the buffer and return nil.
+ #
+ # source://rack//lib/rack/multipart/parser.rb#434
def consume_boundary; end
- # source://rack//lib/rack/multipart/parser.rb#300
- def full_boundary; end
+ # From WEBrick::HTTPUtils
+ #
+ # source://rack//lib/rack/multipart/parser.rb#252
+ def dequote(str); end
- # source://rack//lib/rack/multipart/parser.rb#312
- def get_filename(head); end
+ # Return the related Encoding object. However, because
+ # enc is submitted by the user, it may be invalid, so
+ # use a binary encoding in that case.
+ #
+ # source://rack//lib/rack/multipart/parser.rb#489
+ def find_encoding(enc); end
- # source://rack//lib/rack/multipart/parser.rb#248
+ # source://rack//lib/rack/multipart/parser.rb#294
def handle_consume_token; end
- # source://rack//lib/rack/multipart/parser.rb#377
+ # source://rack//lib/rack/multipart/parser.rb#495
def handle_empty_content!(content); end
- # source://rack//lib/rack/multipart/parser.rb#234
+ # This handles the initial parser state. We read until we find the starting
+ # boundary, then we can transition to the next state. If we find the ending
+ # boundary, this is an invalid multipart upload, but keep scanning for opening
+ # boundary in that case. If no boundary found, we need to keep reading data
+ # and retry. It's highly unlikely the initial read will not consume the
+ # boundary. The client would have to deliberately craft a response
+ # with the opening boundary beyond the buffer size for that to happen.
+ #
+ # source://rack//lib/rack/multipart/parser.rb#271
def handle_fast_forward; end
- # source://rack//lib/rack/multipart/parser.rb#281
+ # source://rack//lib/rack/multipart/parser.rb#411
def handle_mime_body; end
- # source://rack//lib/rack/multipart/parser.rb#258
+ # source://rack//lib/rack/multipart/parser.rb#306
def handle_mime_head; end
- # source://rack//lib/rack/multipart/parser.rb#217
- def run_parser; end
+ # source://rack//lib/rack/multipart/parser.rb#443
+ def normalize_filename(filename); end
+
+ # source://rack//lib/rack/multipart/parser.rb#258
+ def read_data(io, outbuf); end
- # source://rack//lib/rack/multipart/parser.rb#349
+ # source://rack//lib/rack/multipart/parser.rb#456
def tag_multipart_encoding(filename, content_type, name, body); end
class << self
- # source://rack//lib/rack/multipart/parser.rb#66
+ # source://rack//lib/rack/multipart/parser.rb#87
def parse(io, content_length, content_type, tmpfile, bufsize, qp); end
- # source://rack//lib/rack/multipart/parser.rb#59
+ # source://rack//lib/rack/multipart/parser.rb#80
def parse_boundary(content_type); end
end
end
-# source://rack//lib/rack/multipart/parser.rb#21
-Rack::Multipart::Parser::BOUNDARY_REGEX = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/multipart/parser.rb#13
+# source://rack//lib/rack/multipart/parser.rb#40
Rack::Multipart::Parser::BUFSIZE = T.let(T.unsafe(nil), Integer)
-# source://rack//lib/rack/multipart/parser.rb#23
+# source://rack//lib/rack/multipart/parser.rb#48
class Rack::Multipart::Parser::BoundedIO
# @return [BoundedIO] a new instance of BoundedIO
#
- # source://rack//lib/rack/multipart/parser.rb#24
+ # source://rack//lib/rack/multipart/parser.rb#49
def initialize(io, content_length); end
- # source://rack//lib/rack/multipart/parser.rb#30
+ # source://rack//lib/rack/multipart/parser.rb#55
def read(size, outbuf = T.unsafe(nil)); end
-
- # source://rack//lib/rack/multipart/parser.rb#51
- def rewind; end
end
-# source://rack//lib/rack/multipart/parser.rb#347
+# source://rack//lib/rack/multipart/parser.rb#453
Rack::Multipart::Parser::CHARSET = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack/multipart/parser.rb#87
+# source://rack//lib/rack/multipart/parser.rb#305
+Rack::Multipart::Parser::CONTENT_DISPOSITION_MAX_BYTES = T.let(T.unsafe(nil), Integer)
+
+# source://rack//lib/rack/multipart/parser.rb#304
+Rack::Multipart::Parser::CONTENT_DISPOSITION_MAX_PARAMS = T.let(T.unsafe(nil), Integer)
+
+# source://rack//lib/rack/multipart/parser.rb#107
class Rack::Multipart::Parser::Collector
include ::Enumerable
# @return [Collector] a new instance of Collector
#
- # source://rack//lib/rack/multipart/parser.rb#123
+ # source://rack//lib/rack/multipart/parser.rb#143
def initialize(tempfile); end
- # source://rack//lib/rack/multipart/parser.rb#129
+ # source://rack//lib/rack/multipart/parser.rb#149
def each; end
- # source://rack//lib/rack/multipart/parser.rb#149
+ # source://rack//lib/rack/multipart/parser.rb#169
def on_mime_body(mime_index, content); end
- # source://rack//lib/rack/multipart/parser.rb#153
+ # source://rack//lib/rack/multipart/parser.rb#173
def on_mime_finish(mime_index); end
- # source://rack//lib/rack/multipart/parser.rb#133
+ # source://rack//lib/rack/multipart/parser.rb#153
def on_mime_head(mime_index, head, filename, content_type, name); end
private
- # source://rack//lib/rack/multipart/parser.rb#158
+ # source://rack//lib/rack/multipart/parser.rb#178
def check_part_limits; end
end
-# source://rack//lib/rack/multipart/parser.rb#111
+# source://rack//lib/rack/multipart/parser.rb#131
class Rack::Multipart::Parser::Collector::BufferPart < ::Rack::Multipart::Parser::Collector::MimePart
- # source://rack//lib/rack/multipart/parser.rb#113
+ # source://rack//lib/rack/multipart/parser.rb#133
def close; end
# @return [Boolean]
#
- # source://rack//lib/rack/multipart/parser.rb#112
+ # source://rack//lib/rack/multipart/parser.rb#132
def file?; end
end
-# source://rack//lib/rack/multipart/parser.rb#88
+# source://rack//lib/rack/multipart/parser.rb#108
class Rack::Multipart::Parser::Collector::MimePart < ::Struct
# @yield [data]
#
- # source://rack//lib/rack/multipart/parser.rb#89
+ # source://rack//lib/rack/multipart/parser.rb#109
def get_data; end
end
-# source://rack//lib/rack/multipart/parser.rb#116
+# source://rack//lib/rack/multipart/parser.rb#136
class Rack::Multipart::Parser::Collector::TempfilePart < ::Rack::Multipart::Parser::Collector::MimePart
- # source://rack//lib/rack/multipart/parser.rb#118
+ # source://rack//lib/rack/multipart/parser.rb#138
def close; end
# @return [Boolean]
#
- # source://rack//lib/rack/multipart/parser.rb#117
+ # source://rack//lib/rack/multipart/parser.rb#137
def file?; end
end
-# source://rack//lib/rack/multipart/parser.rb#57
+# source://rack//lib/rack/multipart/parser.rb#78
Rack::Multipart::Parser::EMPTY = T.let(T.unsafe(nil), Rack::Multipart::Parser::MultipartInfo)
-# source://rack//lib/rack/multipart/parser.rb#56
+# source://rack//lib/rack/multipart/parser.rb#77
class Rack::Multipart::Parser::MultipartInfo < ::Struct
# Returns the value of attribute params
#
@@ -2468,211 +2342,206 @@ class Rack::Multipart::Parser::MultipartInfo < ::Struct
end
end
-# source://rack//lib/rack/multipart/parser.rb#15
+# source://rack//lib/rack/multipart/parser.rb#42
Rack::Multipart::Parser::TEMPFILE_FACTORY = T.let(T.unsafe(nil), Proc)
-# source://rack//lib/rack/multipart/parser.rb#14
+# source://rack//lib/rack/multipart/parser.rb#41
Rack::Multipart::Parser::TEXT_PLAIN = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack/multipart.rb#28
-Rack::Multipart::REGULAR_PARAMETER = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/multipart.rb#27
-Rack::Multipart::REGULAR_PARAMETER_NAME = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/multipart.rb#37
-Rack::Multipart::RFC2183 = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/multipart.rb#26
-Rack::Multipart::SECTION = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/multipart.rb#16
-Rack::Multipart::TOKEN = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/multipart/uploaded_file.rb#5
+# source://rack//lib/rack/multipart/uploaded_file.rb#8
class Rack::Multipart::UploadedFile
# @return [UploadedFile] a new instance of UploadedFile
#
- # source://rack//lib/rack/multipart/uploaded_file.rb#12
+ # source://rack//lib/rack/multipart/uploaded_file.rb#16
def initialize(filepath = T.unsafe(nil), ct = T.unsafe(nil), bin = T.unsafe(nil), path: T.unsafe(nil), content_type: T.unsafe(nil), binary: T.unsafe(nil), filename: T.unsafe(nil), io: T.unsafe(nil)); end
# The content type of the "uploaded" file
#
- # source://rack//lib/rack/multipart/uploaded_file.rb#10
+ # source://rack//lib/rack/multipart/uploaded_file.rb#14
def content_type; end
# The content type of the "uploaded" file
#
- # source://rack//lib/rack/multipart/uploaded_file.rb#10
+ # source://rack//lib/rack/multipart/uploaded_file.rb#14
def content_type=(_arg0); end
- # source://rack//lib/rack/multipart/uploaded_file.rb#27
+ # source://rack//lib/rack/multipart/uploaded_file.rb#31
def local_path; end
- # source://rack//lib/rack/multipart/uploaded_file.rb#36
+ # source://rack//lib/rack/multipart/uploaded_file.rb#40
def method_missing(method_name, *args, &block); end
# The filename, *not* including the path, of the "uploaded" file
#
- # source://rack//lib/rack/multipart/uploaded_file.rb#7
+ # source://rack//lib/rack/multipart/uploaded_file.rb#11
def original_filename; end
- # source://rack//lib/rack/multipart/uploaded_file.rb#27
+ # source://rack//lib/rack/multipart/uploaded_file.rb#31
def path; end
# @return [Boolean]
#
- # source://rack//lib/rack/multipart/uploaded_file.rb#32
+ # source://rack//lib/rack/multipart/uploaded_file.rb#36
def respond_to?(*args); end
end
-# source://rack//lib/rack/multipart.rb#18
-Rack::Multipart::VALUE = T.let(T.unsafe(nil), Regexp)
-
-# source://rack//lib/rack/null_logger.rb#4
+# source://rack//lib/rack/null_logger.rb#6
class Rack::NullLogger
# @return [NullLogger] a new instance of NullLogger
#
- # source://rack//lib/rack/null_logger.rb#5
+ # source://rack//lib/rack/null_logger.rb#7
def initialize(app); end
- # source://rack//lib/rack/null_logger.rb#37
+ # source://rack//lib/rack/null_logger.rb#45
def <<(msg); end
- # source://rack//lib/rack/null_logger.rb#36
+ # source://rack//lib/rack/null_logger.rb#43
def add(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end
- # source://rack//lib/rack/null_logger.rb#9
+ # source://rack//lib/rack/null_logger.rb#11
def call(env); end
- # source://rack//lib/rack/null_logger.rb#35
+ # source://rack//lib/rack/null_logger.rb#42
def close; end
- # source://rack//lib/rack/null_logger.rb#27
+ # source://rack//lib/rack/null_logger.rb#34
def datetime_format; end
- # source://rack//lib/rack/null_logger.rb#32
+ # source://rack//lib/rack/null_logger.rb#39
def datetime_format=(datetime_format); end
- # source://rack//lib/rack/null_logger.rb#15
+ # source://rack//lib/rack/null_logger.rb#17
def debug(progname = T.unsafe(nil), &block); end
+ # source://rack//lib/rack/null_logger.rb#27
+ def debug!; end
+
# @return [Boolean]
#
- # source://rack//lib/rack/null_logger.rb#21
+ # source://rack//lib/rack/null_logger.rb#23
def debug?; end
- # source://rack//lib/rack/null_logger.rb#17
+ # source://rack//lib/rack/null_logger.rb#19
def error(progname = T.unsafe(nil), &block); end
+ # source://rack//lib/rack/null_logger.rb#28
+ def error!; end
+
# @return [Boolean]
#
- # source://rack//lib/rack/null_logger.rb#23
+ # source://rack//lib/rack/null_logger.rb#25
def error?; end
- # source://rack//lib/rack/null_logger.rb#18
+ # source://rack//lib/rack/null_logger.rb#20
def fatal(progname = T.unsafe(nil), &block); end
+ # source://rack//lib/rack/null_logger.rb#29
+ def fatal!; end
+
# @return [Boolean]
#
- # source://rack//lib/rack/null_logger.rb#24
+ # source://rack//lib/rack/null_logger.rb#26
def fatal?; end
- # source://rack//lib/rack/null_logger.rb#28
+ # source://rack//lib/rack/null_logger.rb#35
def formatter; end
- # source://rack//lib/rack/null_logger.rb#33
+ # source://rack//lib/rack/null_logger.rb#40
def formatter=(formatter); end
- # source://rack//lib/rack/null_logger.rb#14
+ # source://rack//lib/rack/null_logger.rb#16
def info(progname = T.unsafe(nil), &block); end
+ # source://rack//lib/rack/null_logger.rb#30
+ def info!; end
+
# @return [Boolean]
#
- # source://rack//lib/rack/null_logger.rb#20
+ # source://rack//lib/rack/null_logger.rb#22
def info?; end
- # source://rack//lib/rack/null_logger.rb#25
+ # source://rack//lib/rack/null_logger.rb#32
def level; end
- # source://rack//lib/rack/null_logger.rb#30
+ # source://rack//lib/rack/null_logger.rb#37
def level=(level); end
- # source://rack//lib/rack/null_logger.rb#26
+ # source://rack//lib/rack/null_logger.rb#44
+ def log(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end
+
+ # source://rack//lib/rack/null_logger.rb#33
def progname; end
- # source://rack//lib/rack/null_logger.rb#31
+ # source://rack//lib/rack/null_logger.rb#38
def progname=(progname); end
- # source://rack//lib/rack/null_logger.rb#29
+ # source://rack//lib/rack/null_logger.rb#46
+ def reopen(logdev = T.unsafe(nil)); end
+
+ # source://rack//lib/rack/null_logger.rb#36
def sev_threshold; end
- # source://rack//lib/rack/null_logger.rb#34
+ # source://rack//lib/rack/null_logger.rb#41
def sev_threshold=(sev_threshold); end
- # source://rack//lib/rack/null_logger.rb#19
+ # source://rack//lib/rack/null_logger.rb#21
def unknown(progname = T.unsafe(nil), &block); end
- # source://rack//lib/rack/null_logger.rb#16
+ # source://rack//lib/rack/null_logger.rb#18
def warn(progname = T.unsafe(nil), &block); end
+ # source://rack//lib/rack/null_logger.rb#31
+ def warn!; end
+
# @return [Boolean]
#
- # source://rack//lib/rack/null_logger.rb#22
+ # source://rack//lib/rack/null_logger.rb#24
def warn?; end
end
-# source://rack//lib/rack.rb#45
+# source://rack//lib/rack/constants.rb#34
Rack::OPTIONS = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#42
+# source://rack//lib/rack/constants.rb#31
Rack::PATCH = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#21
+# source://rack//lib/rack/constants.rb#8
Rack::PATH_INFO = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#40
+# source://rack//lib/rack/constants.rb#29
Rack::POST = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#41
+# source://rack//lib/rack/constants.rb#30
Rack::PUT = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#25
+# source://rack//lib/rack/constants.rb#12
Rack::QUERY_STRING = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack/query_parser.rb#4
+# source://rack//lib/rack/query_parser.rb#7
class Rack::QueryParser
# @return [QueryParser] a new instance of QueryParser
#
- # source://rack//lib/rack/query_parser.rb#29
- def initialize(params_class, key_space_limit, param_depth_limit); end
-
- # Returns the value of attribute key_space_limit.
- #
- # source://rack//lib/rack/query_parser.rb#27
- def key_space_limit; end
+ # source://rack//lib/rack/query_parser.rb#36
+ def initialize(params_class, param_depth_limit); end
- # source://rack//lib/rack/query_parser.rb#128
+ # source://rack//lib/rack/query_parser.rb#166
def make_params; end
- # source://rack//lib/rack/query_parser.rb#136
+ # source://rack//lib/rack/query_parser.rb#170
def new_depth_limit(param_depth_limit); end
- # source://rack//lib/rack/query_parser.rb#132
- def new_space_limit(key_space_limit); end
-
# normalize_params recursively expands parameters into structural types. If
# the structural types represented by two different parameter names are in
- # conflict, a ParameterTypeError is raised.
- #
- # @raise [ParamsTooDeepError]
+ # conflict, a ParameterTypeError is raised. The depth argument is deprecated
+ # and should no longer be used, it is kept for backwards compatibility with
+ # earlier versions of rack.
#
- # source://rack//lib/rack/query_parser.rb#87
- def normalize_params(params, name, v, depth); end
+ # source://rack//lib/rack/query_parser.rb#94
+ def normalize_params(params, name, v, _depth = T.unsafe(nil)); end
# Returns the value of attribute param_depth_limit.
#
- # source://rack//lib/rack/query_parser.rb#27
+ # source://rack//lib/rack/query_parser.rb#34
def param_depth_limit; end
# parse_nested_query expands a query string into structural types. Supported
@@ -2681,217 +2550,166 @@ class Rack::QueryParser
# ParameterTypeError is raised. Users are encouraged to return a 400 in this
# case.
#
- # source://rack//lib/rack/query_parser.rb#68
- def parse_nested_query(qs, d = T.unsafe(nil)); end
+ # source://rack//lib/rack/query_parser.rb#73
+ def parse_nested_query(qs, separator = T.unsafe(nil)); end
# Stolen from Mongrel, with some small modifications:
- # Parses a query string by breaking it up at the '&'
- # and ';' characters. You can also use this to parse
- # cookies by changing the characters used in the second
- # parameter (which defaults to '&;').
+ # Parses a query string by breaking it up at the '&'. You can also use this
+ # to parse cookies by changing the characters used in the second parameter
+ # (which defaults to '&').
#
- # source://rack//lib/rack/query_parser.rb#40
- def parse_query(qs, d = T.unsafe(nil), &unescaper); end
+ # source://rack//lib/rack/query_parser.rb#45
+ def parse_query(qs, separator = T.unsafe(nil), &unescaper); end
private
+ # @raise [ParamsTooDeepError]
+ #
+ # source://rack//lib/rack/query_parser.rb#98
+ def _normalize_params(params, name, v, depth); end
+
# @return [Boolean]
#
- # source://rack//lib/rack/query_parser.rb#146
+ # source://rack//lib/rack/query_parser.rb#180
def params_hash_has_key?(hash, key); end
# @return [Boolean]
#
- # source://rack//lib/rack/query_parser.rb#142
+ # source://rack//lib/rack/query_parser.rb#176
def params_hash_type?(obj); end
- # source://rack//lib/rack/query_parser.rb#158
- def unescape(s); end
+ # source://rack//lib/rack/query_parser.rb#192
+ def unescape(string, encoding = T.unsafe(nil)); end
class << self
- # source://rack//lib/rack/query_parser.rb#23
- def make_default(key_space_limit, param_depth_limit); end
+ # source://rack//lib/rack/query_parser.rb#30
+ def make_default(param_depth_limit); end
end
end
-# source://rack//lib/rack/query_parser.rb#8
+# source://rack//lib/rack/query_parser.rb#9
Rack::QueryParser::COMMON_SEP = T.let(T.unsafe(nil), Hash)
-# source://rack//lib/rack/query_parser.rb#7
+# source://rack//lib/rack/query_parser.rb#8
Rack::QueryParser::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp)
# InvalidParameterError is the error that is raised when incoming structural
# parameters (parsed by parse_nested_query) contain invalid format or byte
# sequence.
#
-# source://rack//lib/rack/query_parser.rb#17
-class Rack::QueryParser::InvalidParameterError < ::ArgumentError; end
+# source://rack//lib/rack/query_parser.rb#20
+class Rack::QueryParser::InvalidParameterError < ::ArgumentError
+ include ::Rack::BadRequest
+end
# ParameterTypeError is the error that is raised when incoming structural
# parameters (parsed by parse_nested_query) contain conflicting types.
#
-# source://rack//lib/rack/query_parser.rb#12
-class Rack::QueryParser::ParameterTypeError < ::TypeError; end
-
-# source://rack//lib/rack/query_parser.rb#162
-class Rack::QueryParser::Params
- # @return [Params] a new instance of Params
- #
- # source://rack//lib/rack/query_parser.rb#163
- def initialize(limit); end
-
- # source://rack//lib/rack/query_parser.rb#169
- def [](key); end
-
- # @raise [ParamsTooDeepError]
- #
- # source://rack//lib/rack/query_parser.rb#173
- def []=(key, value); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/query_parser.rb#179
- def key?(key); end
-
- # Recursively unwraps nested `Params` objects and constructs an object
- # of the same shape, but using the objects' internal representations
- # (Ruby hashes) in place of the objects. The result is a hash consisting
- # purely of Ruby primitives.
- #
- # Mutation warning!
- #
- # 1. This method mutates the internal representation of the `Params`
- # objects in order to save object allocations.
- #
- # 2. The value you get back is a reference to the internal hash
- # representation, not a copy.
- #
- # 3. Because the `Params` object's internal representation is mutable
- # through the `#[]=` method, it is not thread safe. The result of
- # getting the hash representation while another thread is adding a
- # key to it is non-deterministic.
- #
- # source://rack//lib/rack/query_parser.rb#201
- def to_h; end
+# source://rack//lib/rack/query_parser.rb#13
+class Rack::QueryParser::ParameterTypeError < ::TypeError
+ include ::Rack::BadRequest
+end
- # Recursively unwraps nested `Params` objects and constructs an object
- # of the same shape, but using the objects' internal representations
- # (Ruby hashes) in place of the objects. The result is a hash consisting
- # purely of Ruby primitives.
- #
- # Mutation warning!
- #
- # 1. This method mutates the internal representation of the `Params`
- # objects in order to save object allocations.
- #
- # 2. The value you get back is a reference to the internal hash
- # representation, not a copy.
- #
- # 3. Because the `Params` object's internal representation is mutable
- # through the `#[]=` method, it is not thread safe. The result of
- # getting the hash representation while another thread is adding a
- # key to it is non-deterministic.
- #
- # source://rack//lib/rack/query_parser.rb#201
+# source://rack//lib/rack/query_parser.rb#196
+class Rack::QueryParser::Params < ::Hash
def to_params_hash; end
end
# ParamsTooDeepError is the error that is raised when params are recursively
# nested over the specified limit.
#
-# source://rack//lib/rack/query_parser.rb#21
-class Rack::QueryParser::ParamsTooDeepError < ::RangeError; end
+# source://rack//lib/rack/query_parser.rb#26
+class Rack::QueryParser::ParamsTooDeepError < ::RangeError
+ include ::Rack::BadRequest
+end
+
+# source://rack//lib/rack/constants.rb#43
+Rack::RACK_EARLY_HINTS = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#53
+# source://rack//lib/rack/constants.rb#44
Rack::RACK_ERRORS = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#63
+# source://rack//lib/rack/constants.rb#51
Rack::RACK_HIJACK = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#65
-Rack::RACK_HIJACK_IO = T.let(T.unsafe(nil), String)
-
-# source://rack//lib/rack.rb#55
+# source://rack//lib/rack/constants.rb#46
Rack::RACK_INPUT = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#64
+# source://rack//lib/rack/constants.rb#52
Rack::RACK_IS_HIJACK = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#54
+# source://rack//lib/rack/constants.rb#45
Rack::RACK_LOGGER = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#76
+# source://rack//lib/rack/constants.rb#66
Rack::RACK_METHODOVERRIDE_ORIGINAL_METHOD = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#67
+# source://rack//lib/rack/constants.rb#54
Rack::RACK_MULTIPART_BUFFER_SIZE = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#68
+# source://rack//lib/rack/constants.rb#55
Rack::RACK_MULTIPART_TEMPFILE_FACTORY = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#60
-Rack::RACK_MULTIPROCESS = T.let(T.unsafe(nil), String)
-
-# source://rack//lib/rack.rb#59
-Rack::RACK_MULTITHREAD = T.let(T.unsafe(nil), String)
-
-# source://rack//lib/rack.rb#66
+# source://rack//lib/rack/constants.rb#53
Rack::RACK_RECURSIVE_INCLUDE = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#72
+# source://rack//lib/rack/constants.rb#62
Rack::RACK_REQUEST_COOKIE_HASH = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#73
+# source://rack//lib/rack/constants.rb#63
Rack::RACK_REQUEST_COOKIE_STRING = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#70
+# source://rack//lib/rack/constants.rb#61
+Rack::RACK_REQUEST_FORM_ERROR = T.let(T.unsafe(nil), String)
+
+# source://rack//lib/rack/constants.rb#58
Rack::RACK_REQUEST_FORM_HASH = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#69
+# source://rack//lib/rack/constants.rb#57
Rack::RACK_REQUEST_FORM_INPUT = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#71
+# source://rack//lib/rack/constants.rb#59
+Rack::RACK_REQUEST_FORM_PAIRS = T.let(T.unsafe(nil), String)
+
+# source://rack//lib/rack/constants.rb#60
Rack::RACK_REQUEST_FORM_VARS = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#74
+# source://rack//lib/rack/constants.rb#64
Rack::RACK_REQUEST_QUERY_HASH = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#75
+# source://rack//lib/rack/constants.rb#65
Rack::RACK_REQUEST_QUERY_STRING = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#61
-Rack::RACK_RUNONCE = T.let(T.unsafe(nil), String)
+# source://rack//lib/rack/constants.rb#56
+Rack::RACK_RESPONSE_FINISHED = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#56
+# source://rack//lib/rack/constants.rb#47
Rack::RACK_SESSION = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#57
+# source://rack//lib/rack/constants.rb#48
Rack::RACK_SESSION_OPTIONS = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#77
-Rack::RACK_SESSION_UNPACKED_COOKIE_DATA = T.let(T.unsafe(nil), String)
-
-# source://rack//lib/rack.rb#58
+# source://rack//lib/rack/constants.rb#49
Rack::RACK_SHOWSTATUS_DETAIL = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#52
+# source://rack//lib/rack/constants.rb#42
Rack::RACK_TEMPFILES = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#62
+# source://rack//lib/rack/constants.rb#50
Rack::RACK_URL_SCHEME = T.let(T.unsafe(nil), String)
# Rack environment variables
#
-# source://rack//lib/rack.rb#51
+# source://rack//lib/rack/constants.rb#41
Rack::RACK_VERSION = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack/version.rb#23
+# source://rack//lib/rack/version.rb#15
Rack::RELEASE = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#22
+# source://rack//lib/rack/constants.rb#9
Rack::REQUEST_METHOD = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#23
+# source://rack//lib/rack/constants.rb#10
Rack::REQUEST_PATH = T.let(T.unsafe(nil), String)
# Rack::Recursive allows applications called down the chain to
@@ -2899,20 +2717,20 @@ Rack::REQUEST_PATH = T.let(T.unsafe(nil), String)
# rack['rack.recursive.include'][...] or raise a
# ForwardRequest to redirect internally.
#
-# source://rack//lib/rack/recursive.rb#34
+# source://rack//lib/rack/recursive.rb#36
class Rack::Recursive
# @return [Recursive] a new instance of Recursive
#
- # source://rack//lib/rack/recursive.rb#35
+ # source://rack//lib/rack/recursive.rb#37
def initialize(app); end
- # source://rack//lib/rack/recursive.rb#43
+ # source://rack//lib/rack/recursive.rb#45
def _call(env); end
- # source://rack//lib/rack/recursive.rb#39
+ # source://rack//lib/rack/recursive.rb#41
def call(env); end
- # source://rack//lib/rack/recursive.rb#50
+ # source://rack//lib/rack/recursive.rb#52
def include(env, path); end
end
@@ -2934,34 +2752,34 @@ end
class Rack::Reloader
# @return [Reloader] a new instance of Reloader
#
- # source://rack//lib/rack/reloader.rb#27
+ # source://rack//lib/rack/reloader.rb#25
def initialize(app, cooldown = T.unsafe(nil), backend = T.unsafe(nil)); end
- # source://rack//lib/rack/reloader.rb#38
+ # source://rack//lib/rack/reloader.rb#36
def call(env); end
- # source://rack//lib/rack/reloader.rb#52
+ # source://rack//lib/rack/reloader.rb#50
def reload!(stderr = T.unsafe(nil)); end
# A safe Kernel::load, issuing the hooks depending on the results
#
- # source://rack//lib/rack/reloader.rb#60
+ # source://rack//lib/rack/reloader.rb#58
def safe_load(file, mtime, stderr = T.unsafe(nil)); end
end
-# source://rack//lib/rack/reloader.rb#70
+# source://rack//lib/rack/reloader.rb#68
module Rack::Reloader::Stat
# Takes a relative or absolute +file+ name, a couple possible +paths+ that
# the +file+ might reside in. Returns the full path and File::Stat for the
# path.
#
- # source://rack//lib/rack/reloader.rb#90
+ # source://rack//lib/rack/reloader.rb#88
def figure_path(file, paths); end
- # source://rack//lib/rack/reloader.rb#71
+ # source://rack//lib/rack/reloader.rb#69
def rotation; end
- # source://rack//lib/rack/reloader.rb#105
+ # source://rack//lib/rack/reloader.rb#103
def safe_stat(file); end
end
@@ -2973,26 +2791,26 @@ end
# req.post?
# req.params["data"]
#
-# source://rack//lib/rack/request.rb#12
+# source://rack//lib/rack/request.rb#16
class Rack::Request
include ::Rack::Request::Env
include ::Rack::Request::Helpers
# @return [Request] a new instance of Request
#
- # source://rack//lib/rack/request.rb#26
+ # source://rack//lib/rack/request.rb#62
def initialize(env); end
- # source://rack//lib/rack/request.rb#40
+ # source://rack//lib/rack/request.rb#76
def delete_param(k); end
- # source://rack//lib/rack/request.rb#31
+ # source://rack//lib/rack/request.rb#67
def params; end
- # source://rack//lib/rack/request.rb#31
+ # source://rack//lib/rack/request.rb#67
def query; end
- # source://rack//lib/rack/request.rb#35
+ # source://rack//lib/rack/request.rb#71
def update_param(k, v); end
# source://yard/0.9.36/lib/yard/server/rack_adapter.rb#94
@@ -3005,26 +2823,78 @@ class Rack::Request
def xhr?; end
class << self
+ # The priority when checking forwarded headers. The default
+ # is [:forwarded, :x_forwarded], which means, check the
+ # +Forwarded+ header first, followed by the appropriate
+ # X-Forwarded-* header. You can revert the priority by
+ # reversing the priority, or remove checking of either
+ # or both headers by removing elements from the array.
+ #
+ # This should be set as appropriate in your environment
+ # based on what reverse proxies are in use. If you are not
+ # using reverse proxies, you should probably use an empty
+ # array.
+ #
+ # source://rack//lib/rack/request.rb#31
+ def forwarded_priority; end
+
+ # The priority when checking forwarded headers. The default
+ # is [:forwarded, :x_forwarded], which means, check the
+ # +Forwarded+ header first, followed by the appropriate
+ # X-Forwarded-* header. You can revert the priority by
+ # reversing the priority, or remove checking of either
+ # or both headers by removing elements from the array.
+ #
+ # This should be set as appropriate in your environment
+ # based on what reverse proxies are in use. If you are not
+ # using reverse proxies, you should probably use an empty
+ # array.
+ #
+ # source://rack//lib/rack/request.rb#31
+ def forwarded_priority=(_arg0); end
+
# Returns the value of attribute ip_filter.
#
- # source://rack//lib/rack/request.rb#16
+ # source://rack//lib/rack/request.rb#18
def ip_filter; end
# Sets the attribute ip_filter
#
# @param value the value to set the attribute ip_filter to.
#
- # source://rack//lib/rack/request.rb#16
+ # source://rack//lib/rack/request.rb#18
def ip_filter=(_arg0); end
+
+ # The priority when checking either the X-Forwarded-Proto
+ # or X-Forwarded-Scheme header for the forwarded protocol.
+ # The default is [:proto, :scheme], to try the
+ # X-Forwarded-Proto header before the
+ # X-Forwarded-Scheme header. Rack 2 had behavior
+ # similar to [:scheme, :proto]. You can remove either or
+ # both of the entries in array to ignore that respective header.
+ #
+ # source://rack//lib/rack/request.rb#40
+ def x_forwarded_proto_priority; end
+
+ # The priority when checking either the X-Forwarded-Proto
+ # or X-Forwarded-Scheme header for the forwarded protocol.
+ # The default is [:proto, :scheme], to try the
+ # X-Forwarded-Proto header before the
+ # X-Forwarded-Scheme header. Rack 2 had behavior
+ # similar to [:scheme, :proto]. You can remove either or
+ # both of the entries in array to ignore that respective header.
+ #
+ # source://rack//lib/rack/request.rb#40
+ def x_forwarded_proto_priority=(_arg0); end
end
end
-# source://rack//lib/rack/request.rb#20
+# source://rack//lib/rack/request.rb#60
Rack::Request::ALLOWED_SCHEMES = T.let(T.unsafe(nil), Array)
-# source://rack//lib/rack/request.rb#46
+# source://rack//lib/rack/request.rb#82
module Rack::Request::Env
- # source://rack//lib/rack/request.rb#50
+ # source://rack//lib/rack/request.rb#86
def initialize(env); end
# Add a header that may have multiple values.
@@ -3037,33 +2907,33 @@ module Rack::Request::Env
#
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
#
- # source://rack//lib/rack/request.rb#91
+ # source://rack//lib/rack/request.rb#129
def add_header(key, v); end
# Delete a request specific value for `name`.
#
- # source://rack//lib/rack/request.rb#102
+ # source://rack//lib/rack/request.rb#140
def delete_header(name); end
# Loops through each key / value pair in the request specific data.
#
- # source://rack//lib/rack/request.rb#73
+ # source://rack//lib/rack/request.rb#111
def each_header(&block); end
# The environment of the request.
#
- # source://rack//lib/rack/request.rb#48
+ # source://rack//lib/rack/request.rb#84
def env; end
# If a block is given, it yields to the block if the value hasn't been set
# on the request.
#
- # source://rack//lib/rack/request.rb#68
+ # source://rack//lib/rack/request.rb#106
def fetch_header(name, &block); end
# Get a request specific value for `name`.
#
- # source://rack//lib/rack/request.rb#62
+ # source://rack//lib/rack/request.rb#100
def get_header(name); end
# Predicate method to test to see if `name` has been set as request
@@ -3071,25 +2941,25 @@ module Rack::Request::Env
#
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#57
+ # source://rack//lib/rack/request.rb#95
def has_header?(name); end
# Set a request specific value for `name` to `v`
#
- # source://rack//lib/rack/request.rb#78
+ # source://rack//lib/rack/request.rb#116
def set_header(name, v); end
private
- # source://rack//lib/rack/request.rb#106
+ # source://rack//lib/rack/request.rb#144
def initialize_copy(other); end
end
-# source://rack//lib/rack/request.rb#111
+# source://rack//lib/rack/request.rb#149
module Rack::Request::Helpers
# Returns the data received in the query string.
#
- # source://rack//lib/rack/request.rb#426
+ # source://rack//lib/rack/request.rb#484
def GET; end
# Returns the data received in the request body.
@@ -3097,25 +2967,13 @@ module Rack::Request::Helpers
# This method support both application/x-www-form-urlencoded and
# multipart/form-data.
#
- # source://rack//lib/rack/request.rb#440
+ # source://rack//lib/rack/request.rb#503
def POST; end
- # shortcut for request.params[key]
- #
- # source://rack//lib/rack/request.rb#532
- def [](key); end
-
- # shortcut for request.params[key] = value
- #
- # Note that modifications will not be persisted in the env. Use update_param or delete_param if you want to destructively modify params.
- #
- # source://rack//lib/rack/request.rb#543
- def []=(key, value); end
-
- # source://rack//lib/rack/request.rb#519
+ # source://rack//lib/rack/request.rb#607
def accept_encoding; end
- # source://rack//lib/rack/request.rb#523
+ # source://rack//lib/rack/request.rb#611
def accept_language; end
# The authority of the incoming request as defined by RFC3976.
@@ -3124,13 +2982,13 @@ module Rack::Request::Helpers
# In HTTP/1, this is the `host` header.
# In HTTP/2, this is the `:authority` pseudo-header.
#
- # source://rack//lib/rack/request.rb#227
+ # source://rack//lib/rack/request.rb#266
def authority; end
- # source://rack//lib/rack/request.rb#502
+ # source://rack//lib/rack/request.rb#590
def base_url; end
- # source://rack//lib/rack/request.rb#150
+ # source://rack//lib/rack/request.rb#190
def body; end
# The character set of the request body if a "charset" media type
@@ -3138,23 +2996,23 @@ module Rack::Request::Helpers
# that, per RFC2616, text/* media types that specify no explicit
# charset are to be considered ISO-8859-1.
#
- # source://rack//lib/rack/request.rb#400
+ # source://rack//lib/rack/request.rb#458
def content_charset; end
- # source://rack//lib/rack/request.rb#159
+ # source://rack//lib/rack/request.rb#199
def content_length; end
- # source://rack//lib/rack/request.rb#271
+ # source://rack//lib/rack/request.rb#308
def content_type; end
- # source://rack//lib/rack/request.rb#256
+ # source://rack//lib/rack/request.rb#293
def cookies; end
# Checks the HTTP request method (or verb) to see if it was of type DELETE
#
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#181
+ # source://rack//lib/rack/request.rb#220
def delete?; end
# Destructively delete a parameter, whether it's in GET or POST. Returns the value of the deleted parameter.
@@ -3163,60 +3021,60 @@ module Rack::Request::Helpers
#
# env['rack.input'] is not touched.
#
- # source://rack//lib/rack/request.rb#497
+ # source://rack//lib/rack/request.rb#585
def delete_param(k); end
# Determine whether the request body contains form-data by checking
- # the request Content-Type for one of the media-types:
+ # the request content-type for one of the media-types:
# "application/x-www-form-urlencoded" or "multipart/form-data". The
# list of form-data media types can be modified through the
# +FORM_DATA_MEDIA_TYPES+ array.
#
# A request body is also assumed to contain form-data when no
- # Content-Type header is provided and the request_method is POST.
+ # content-type header is provided and the request_method is POST.
#
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#412
+ # source://rack//lib/rack/request.rb#470
def form_data?; end
- # source://rack//lib/rack/request.rb#344
+ # source://rack//lib/rack/request.rb#393
def forwarded_authority; end
- # source://rack//lib/rack/request.rb#330
+ # source://rack//lib/rack/request.rb#353
def forwarded_for; end
- # source://rack//lib/rack/request.rb#338
+ # source://rack//lib/rack/request.rb#374
def forwarded_port; end
- # source://rack//lib/rack/request.rb#515
+ # source://rack//lib/rack/request.rb#603
def fullpath; end
# Checks the HTTP request method (or verb) to see if it was of type GET
#
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#184
+ # source://rack//lib/rack/request.rb#223
def get?; end
# Checks the HTTP request method (or verb) to see if it was of type HEAD
#
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#187
+ # source://rack//lib/rack/request.rb#226
def head?; end
# Returns a formatted host, suitable for being used in a URI.
#
- # source://rack//lib/rack/request.rb#296
+ # source://rack//lib/rack/request.rb#333
def host; end
# The `HTTP_HOST` header.
#
- # source://rack//lib/rack/request.rb#281
+ # source://rack//lib/rack/request.rb#318
def host_authority; end
- # source://rack//lib/rack/request.rb#285
+ # source://rack//lib/rack/request.rb#322
def host_with_port(authority = T.unsafe(nil)); end
# Returns an address suitable for being to resolve to an address.
@@ -3224,20 +3082,20 @@ module Rack::Request::Helpers
# as +host+. In the case of IPv6 or future address formats, the square
# brackets are removed.
#
- # source://rack//lib/rack/request.rb#304
+ # source://rack//lib/rack/request.rb#341
def hostname; end
- # source://rack//lib/rack/request.rb#354
+ # source://rack//lib/rack/request.rb#414
def ip; end
# Checks the HTTP request method (or verb) to see if it was of type LINK
#
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#193
+ # source://rack//lib/rack/request.rb#232
def link?; end
- # source://rack//lib/rack/request.rb#160
+ # source://rack//lib/rack/request.rb#200
def logger; end
# The media type (type/subtype) portion of the CONTENT_TYPE header
@@ -3247,7 +3105,7 @@ module Rack::Request::Helpers
# For more information on the use of media types in HTTP, see:
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
#
- # source://rack//lib/rack/request.rb#383
+ # source://rack//lib/rack/request.rb#441
def media_type; end
# The media type parameters provided in CONTENT_TYPE as a Hash, or
@@ -3256,26 +3114,21 @@ module Rack::Request::Helpers
# this method responds with the following Hash:
# { 'charset' => 'utf-8' }
#
- # source://rack//lib/rack/request.rb#392
+ # source://rack//lib/rack/request.rb#450
def media_type_params; end
- # @return [Boolean]
- #
- # source://rack//lib/rack/request.rb#162
- def multithread?; end
-
# Checks the HTTP request method (or verb) to see if it was of type OPTIONS
#
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#190
+ # source://rack//lib/rack/request.rb#229
def options?; end
# The union of GET and POST data.
#
# Note that modifications will not be persisted in the env. Use update_param or delete_param if you want to destructively modify params.
#
- # source://rack//lib/rack/request.rb#468
+ # source://rack//lib/rack/request.rb#556
def params; end
# Determine whether the request body contains data by checking
@@ -3283,107 +3136,107 @@ module Rack::Request::Helpers
#
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#421
+ # source://rack//lib/rack/request.rb#479
def parseable_data?; end
# Checks the HTTP request method (or verb) to see if it was of type PATCH
#
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#196
+ # source://rack//lib/rack/request.rb#235
def patch?; end
- # source://rack//lib/rack/request.rb#511
+ # source://rack//lib/rack/request.rb#599
def path; end
- # source://rack//lib/rack/request.rb#154
+ # source://rack//lib/rack/request.rb#194
def path_info; end
- # source://rack//lib/rack/request.rb#155
+ # source://rack//lib/rack/request.rb#195
def path_info=(s); end
- # source://rack//lib/rack/request.rb#308
+ # source://rack//lib/rack/request.rb#345
def port; end
# Checks the HTTP request method (or verb) to see if it was of type POST
#
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#199
+ # source://rack//lib/rack/request.rb#238
def post?; end
# Checks the HTTP request method (or verb) to see if it was of type PUT
#
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#202
+ # source://rack//lib/rack/request.rb#241
def put?; end
- # source://rack//lib/rack/request.rb#158
+ # source://rack//lib/rack/request.rb#198
def query_string; end
# the referer of the client
#
- # source://rack//lib/rack/request.rb#165
+ # source://rack//lib/rack/request.rb#204
def referer; end
# the referer of the client
#
- # source://rack//lib/rack/request.rb#165
+ # source://rack//lib/rack/request.rb#204
def referrer; end
- # source://rack//lib/rack/request.rb#157
+ # source://rack//lib/rack/request.rb#197
def request_method; end
- # source://rack//lib/rack/request.rb#210
+ # source://rack//lib/rack/request.rb#249
def scheme; end
- # source://rack//lib/rack/request.rb#151
+ # source://rack//lib/rack/request.rb#191
def script_name; end
- # source://rack//lib/rack/request.rb#152
+ # source://rack//lib/rack/request.rb#192
def script_name=(s); end
# The authority as defined by the `SERVER_NAME` and `SERVER_PORT`
# variables.
#
- # source://rack//lib/rack/request.rb#233
+ # source://rack//lib/rack/request.rb#272
def server_authority; end
- # source://rack//lib/rack/request.rb#246
+ # source://rack//lib/rack/request.rb#285
def server_name; end
- # source://rack//lib/rack/request.rb#250
+ # source://rack//lib/rack/request.rb#289
def server_port; end
- # source://rack//lib/rack/request.rb#168
+ # source://rack//lib/rack/request.rb#207
def session; end
- # source://rack//lib/rack/request.rb#174
+ # source://rack//lib/rack/request.rb#213
def session_options; end
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#350
+ # source://rack//lib/rack/request.rb#410
def ssl?; end
# Checks the HTTP request method (or verb) to see if it was of type TRACE
#
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#205
+ # source://rack//lib/rack/request.rb#244
def trace?; end
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#527
+ # source://rack//lib/rack/request.rb#615
def trusted_proxy?(ip); end
# Checks the HTTP request method (or verb) to see if it was of type UNLINK
#
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#208
+ # source://rack//lib/rack/request.rb#247
def unlink?; end
# Destructively update a parameter, whether it's in GET and/or POST. Returns nil.
@@ -3392,124 +3245,138 @@ module Rack::Request::Helpers
#
# env['rack.input'] is not touched.
#
- # source://rack//lib/rack/request.rb#477
+ # source://rack//lib/rack/request.rb#565
def update_param(k, v); end
# Tries to return a remake of the original request URL as a string.
#
- # source://rack//lib/rack/request.rb#507
+ # source://rack//lib/rack/request.rb#595
def url; end
- # source://rack//lib/rack/request.rb#161
+ # source://rack//lib/rack/request.rb#201
def user_agent; end
# like Hash#values_at
#
- # source://rack//lib/rack/request.rb#552
+ # source://rack//lib/rack/request.rb#620
def values_at(*keys); end
# @return [Boolean]
#
- # source://rack//lib/rack/request.rb#276
+ # source://rack//lib/rack/request.rb#313
def xhr?; end
private
- # source://rack//lib/rack/request.rb#641
+ # source://rack//lib/rack/request.rb#776
def allowed_scheme(header); end
- # source://rack//lib/rack/request.rb#558
+ # source://rack//lib/rack/request.rb#628
def default_session; end
- # source://rack//lib/rack/request.rb#645
- def extract_proto_header(header); end
+ # source://rack//lib/rack/request.rb#684
+ def expand_param_pairs(pairs, query_parser = T.unsafe(nil)); end
+
+ # source://rack//lib/rack/request.rb#780
+ def forwarded_priority; end
- # source://rack//lib/rack/request.rb#636
+ # source://rack//lib/rack/request.rb#752
def forwarded_scheme; end
- # source://rack//lib/rack/request.rb#574
+ # Get an array of values set in the RFC 7239 `Forwarded` request header.
+ #
+ # source://rack//lib/rack/request.rb#668
+ def get_http_forwarded(token); end
+
+ # source://rack//lib/rack/request.rb#644
def parse_http_accept_header(header); end
- # source://rack//lib/rack/request.rb#593
+ # source://rack//lib/rack/request.rb#680
def parse_multipart; end
- # source://rack//lib/rack/request.rb#589
+ # source://rack//lib/rack/request.rb#676
def parse_query(qs, d = T.unsafe(nil)); end
- # source://rack//lib/rack/request.rb#585
+ # source://rack//lib/rack/request.rb#672
def query_parser; end
- # source://rack//lib/rack/request.rb#632
+ # source://rack//lib/rack/request.rb#743
def reject_trusted_ip_addresses(ip_addresses); end
- # source://rack//lib/rack/request.rb#619
+ # source://rack//lib/rack/request.rb#737
def split_authority(authority); end
- # source://rack//lib/rack/request.rb#597
+ # source://rack//lib/rack/request.rb#694
def split_header(value); end
# Assist with compatibility when processing `X-Forwarded-For`.
#
- # source://rack//lib/rack/request.rb#561
+ # source://rack//lib/rack/request.rb#631
def wrap_ipv6(host); end
+
+ # source://rack//lib/rack/request.rb#784
+ def x_forwarded_proto_priority; end
end
-# source://rack//lib/rack/request.rb#601
+# source://rack//lib/rack/request.rb#722
Rack::Request::Helpers::AUTHORITY = T.let(T.unsafe(nil), Regexp)
# Default ports depending on scheme. Used to decide whether or not
# to include the port in a generated URI.
#
-# source://rack//lib/rack/request.rb#130
+# source://rack//lib/rack/request.rb#168
Rack::Request::Helpers::DEFAULT_PORTS = T.let(T.unsafe(nil), Hash)
# The set of form-data media-types. Requests that do not indicate
# one of the media types present in this list will not be eligible
# for form-data / param parsing.
#
-# source://rack//lib/rack/request.rb#115
+# source://rack//lib/rack/request.rb#153
Rack::Request::Helpers::FORM_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array)
+# source://rack//lib/rack/request.rb#747
+Rack::Request::Helpers::FORWARDED_SCHEME_HEADERS = T.let(T.unsafe(nil), Hash)
+
+# source://rack//lib/rack/request.rb#176
+Rack::Request::Helpers::HTTP_FORWARDED = T.let(T.unsafe(nil), String)
+
# The address of the client which connected to the proxy.
#
-# source://rack//lib/rack/request.rb#133
+# source://rack//lib/rack/request.rb#171
Rack::Request::Helpers::HTTP_X_FORWARDED_FOR = T.let(T.unsafe(nil), String)
# The contents of the host/:authority header sent to the proxy.
#
-# source://rack//lib/rack/request.rb#136
+# source://rack//lib/rack/request.rb#174
Rack::Request::Helpers::HTTP_X_FORWARDED_HOST = T.let(T.unsafe(nil), String)
# The port used to connect to the proxy.
#
-# source://rack//lib/rack/request.rb#145
+# source://rack//lib/rack/request.rb#185
Rack::Request::Helpers::HTTP_X_FORWARDED_PORT = T.let(T.unsafe(nil), String)
# The protocol used to connect to the proxy.
#
-# source://rack//lib/rack/request.rb#142
+# source://rack//lib/rack/request.rb#182
Rack::Request::Helpers::HTTP_X_FORWARDED_PROTO = T.let(T.unsafe(nil), String)
# The value of the scheme sent to the proxy.
#
-# source://rack//lib/rack/request.rb#139
+# source://rack//lib/rack/request.rb#179
Rack::Request::Helpers::HTTP_X_FORWARDED_SCHEME = T.let(T.unsafe(nil), String)
-# Another way for specifing https scheme was used.
+# Another way for specifying https scheme was used.
#
-# source://rack//lib/rack/request.rb#148
+# source://rack//lib/rack/request.rb#188
Rack::Request::Helpers::HTTP_X_FORWARDED_SSL = T.let(T.unsafe(nil), String)
# The set of media-types. Requests that do not indicate
# one of the media types present in this list will not be eligible
# for param parsing like soap attachments or generic multiparts
#
-# source://rack//lib/rack/request.rb#123
+# source://rack//lib/rack/request.rb#161
Rack::Request::Helpers::PARSEABLE_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array)
-# source://rack//lib/rack/request.rb#21
-Rack::Request::SCHEME_WHITELIST = T.let(T.unsafe(nil), Array)
-
# Rack::Response provides a convenient interface to create a Rack
# response.
#
@@ -3523,63 +3390,79 @@ Rack::Request::SCHEME_WHITELIST = T.let(T.unsafe(nil), Array)
#
# Your application's +call+ should end returning Response#finish.
#
-# source://rack//lib/rack/response.rb#18
+# source://rack//lib/rack/response.rb#23
class Rack::Response
include ::Rack::Response::Helpers
- # Initialize the response object with the specified body, status
- # and headers.
+ # Initialize the response object with the specified +body+, +status+
+ # and +headers+.
+ #
+ # If the +body+ is +nil+, construct an empty response object with internal
+ # buffering.
+ #
+ # If the +body+ responds to +to_str+, assume it's a string-like object and
+ # construct a buffered response object containing using that string as the
+ # initial contents of the buffer.
#
- # HTTP protocol RFCs.
- # conform to the HTTP protocol RFCs.
+ # Otherwise it is expected +body+ conforms to the normal requirements of a
+ # Rack response body, typically implementing one of +each+ (enumerable
+ # body) or +call+ (streaming body).
#
- # Providing a body which responds to #to_str is legacy behaviour.
+ # The +status+ defaults to +200+ which is the "OK" HTTP status code. You
+ # can provide any other valid status code.
+ #
+ # The +headers+ must be a +Hash+ of key-value header pairs which conform to
+ # the Rack specification for response headers. The key must be a +String+
+ # instance and the value can be either a +String+ or +Array+ instance.
#
- # @param body [nil, #each, #to_str] the response body.
- # @param status [Integer] the integer status as defined by the
- # @param headers [#each] a list of key-value header pairs which
# @return [Response] a new instance of Response
# @yield [_self]
# @yieldparam _self [Rack::Response] the object that the method was called on
#
- # source://rack//lib/rack/response.rb#42
+ # source://rack//lib/rack/response.rb#54
def initialize(body = T.unsafe(nil), status = T.unsafe(nil), headers = T.unsafe(nil)); end
- # source://rack//lib/rack/response.rb#127
+ # @raise [ArgumentError]
+ #
+ # source://rack//lib/rack/response.rb#164
def [](key); end
- # source://rack//lib/rack/response.rb#128
- def []=(key, v); end
+ # @raise [ArgumentError]
+ #
+ # source://rack//lib/rack/response.rb#168
+ def []=(key, value); end
# Returns the value of attribute body.
#
- # source://rack//lib/rack/response.rb#26
+ # source://rack//lib/rack/response.rb#31
def body; end
# Sets the attribute body
#
# @param value the value to set the attribute body to.
#
- # source://rack//lib/rack/response.rb#26
+ # source://rack//lib/rack/response.rb#31
def body=(_arg0); end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#73
+ # source://rack//lib/rack/response.rb#95
def chunked?; end
- # source://rack//lib/rack/response.rb#118
+ # source://rack//lib/rack/response.rb#152
def close; end
- # source://rack//lib/rack/response.rb#129
+ # @raise [ArgumentError]
+ #
+ # source://rack//lib/rack/response.rb#172
def delete_header(key); end
- # source://rack//lib/rack/response.rb#98
+ # source://rack//lib/rack/response.rb#130
def each(&callback); end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#122
+ # source://rack//lib/rack/response.rb#156
def empty?; end
# Generate a response array consistent with the requirements of the SPEC.
@@ -3587,57 +3470,60 @@ class Rack::Response
#
# @return [Array] a 3-tuple suitable of `[status, headers, body]`
#
- # source://rack//lib/rack/response.rb#80
+ # source://rack//lib/rack/response.rb#107
def finish(&block); end
- # source://rack//lib/rack/response.rb#127
+ # @raise [ArgumentError]
+ #
+ # source://rack//lib/rack/response.rb#164
def get_header(key); end
+ # @raise [ArgumentError]
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#126
+ # source://rack//lib/rack/response.rb#160
def has_header?(key); end
# Returns the value of attribute headers.
#
- # @deprecated Use {#headers} instead.
- #
- # source://rack//lib/rack/response.rb#27
- def header; end
-
- # Returns the value of attribute headers.
- #
- # source://rack//lib/rack/response.rb#27
+ # source://rack//lib/rack/response.rb#32
def headers; end
# Returns the value of attribute length.
#
- # source://rack//lib/rack/response.rb#26
+ # source://rack//lib/rack/response.rb#31
def length; end
# Sets the attribute length
#
# @param value the value to set the attribute length to.
#
- # source://rack//lib/rack/response.rb#26
+ # source://rack//lib/rack/response.rb#31
def length=(_arg0); end
- # source://rack//lib/rack/response.rb#68
+ # @return [Boolean]
+ #
+ # source://rack//lib/rack/response.rb#99
+ def no_entity_body?; end
+
+ # source://rack//lib/rack/response.rb#90
def redirect(target, status = T.unsafe(nil)); end
- # source://rack//lib/rack/response.rb#128
- def set_header(key, v); end
+ # @raise [ArgumentError]
+ #
+ # source://rack//lib/rack/response.rb#168
+ def set_header(key, value); end
# Returns the value of attribute status.
#
- # source://rack//lib/rack/response.rb#26
+ # source://rack//lib/rack/response.rb#31
def status; end
# Sets the attribute status
#
# @param value the value to set the attribute status to.
#
- # source://rack//lib/rack/response.rb#26
+ # source://rack//lib/rack/response.rb#31
def status=(_arg0); end
# Generate a response array consistent with the requirements of the SPEC.
@@ -3646,48 +3532,52 @@ class Rack::Response
#
# @return [Array] a 3-tuple suitable of `[status, headers, body]`
#
- # source://rack//lib/rack/response.rb#80
+ # source://rack//lib/rack/response.rb#107
def to_a(&block); end
- # Append to body and update Content-Length.
+ # Append a chunk to the response body.
+ #
+ # Converts the response into a buffered response if it wasn't already.
#
# NOTE: Do not mix #write and direct #body access!
#
- # source://rack//lib/rack/response.rb#112
+ # source://rack//lib/rack/response.rb#146
def write(chunk); end
class << self
- # source://rack//lib/rack/response.rb#19
+ # source://rack//lib/rack/response.rb#24
def [](status, headers, body); end
end
end
-# source://rack//lib/rack/response.rb#23
+# source://rack//lib/rack/response.rb#28
Rack::Response::CHUNKED = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack/response.rb#134
+# source://rack//lib/rack/response.rb#180
module Rack::Response::Helpers
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#145
+ # source://rack//lib/rack/response.rb#191
def accepted?; end
# Add a header that may have multiple values.
#
# Example:
- # response.add_header 'Vary', 'Accept-Encoding'
- # response.add_header 'Vary', 'Cookie'
+ # response.add_header 'vary', 'accept-encoding'
+ # response.add_header 'vary', 'cookie'
#
- # assert_equal 'Accept-Encoding,Cookie', response.get_header('Vary')
+ # assert_equal 'accept-encoding,cookie', response.get_header('vary')
#
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
#
- # source://rack//lib/rack/response.rb#171
- def add_header(key, v); end
+ # @raise [ArgumentError]
+ #
+ # source://rack//lib/rack/response.rb#219
+ def add_header(key, value); end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#148
+ # source://rack//lib/rack/response.rb#194
def bad_request?; end
# Specify that the content should be cached.
@@ -3696,221 +3586,236 @@ module Rack::Response::Helpers
# @param duration [Integer] The number of seconds until the cache expires.
# @param directive [Hash] a customizable set of options
#
- # source://rack//lib/rack/response.rb#246
+ # source://rack//lib/rack/response.rb#307
def cache!(duration = T.unsafe(nil), directive: T.unsafe(nil)); end
- # source://rack//lib/rack/response.rb#229
+ # source://rack//lib/rack/response.rb#290
def cache_control; end
- # source://rack//lib/rack/response.rb#233
- def cache_control=(v); end
+ # source://rack//lib/rack/response.rb#294
+ def cache_control=(value); end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#140
+ # source://rack//lib/rack/response.rb#186
def client_error?; end
- # source://rack//lib/rack/response.rb#199
+ # source://rack//lib/rack/response.rb#257
def content_length; end
# Get the content type of the response.
#
- # source://rack//lib/rack/response.rb#182
+ # source://rack//lib/rack/response.rb#240
def content_type; end
# Set the content type of the response.
#
- # source://rack//lib/rack/response.rb#187
+ # source://rack//lib/rack/response.rb#245
def content_type=(content_type); end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#144
+ # source://rack//lib/rack/response.rb#190
def created?; end
- # source://rack//lib/rack/response.rb#217
+ # source://rack//lib/rack/response.rb#274
def delete_cookie(key, value = T.unsafe(nil)); end
# Specifies that the content shouldn't be cached. Overrides `cache!` if already called.
#
- # source://rack//lib/rack/response.rb#238
+ # source://rack//lib/rack/response.rb#299
def do_not_cache!; end
- # source://rack//lib/rack/response.rb#253
+ # source://rack//lib/rack/response.rb#314
def etag; end
- # source://rack//lib/rack/response.rb#257
- def etag=(v); end
+ # source://rack//lib/rack/response.rb#318
+ def etag=(value); end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#150
+ # source://rack//lib/rack/response.rb#196
def forbidden?; end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#158
+ # source://rack//lib/rack/response.rb#206
def include?(header); end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#137
+ # source://rack//lib/rack/response.rb#183
def informational?; end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#135
+ # source://rack//lib/rack/response.rb#181
def invalid?; end
- # source://rack//lib/rack/response.rb#204
+ # source://rack//lib/rack/response.rb#262
def location; end
- # source://rack//lib/rack/response.rb#208
+ # source://rack//lib/rack/response.rb#266
def location=(location); end
- # source://rack//lib/rack/response.rb#191
+ # source://rack//lib/rack/response.rb#249
def media_type; end
- # source://rack//lib/rack/response.rb#195
+ # source://rack//lib/rack/response.rb#253
def media_type_params; end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#152
+ # source://rack//lib/rack/response.rb#198
def method_not_allowed?; end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#147
+ # source://rack//lib/rack/response.rb#193
def moved_permanently?; end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#146
+ # source://rack//lib/rack/response.rb#192
def no_content?; end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#151
+ # source://rack//lib/rack/response.rb#199
+ def not_acceptable?; end
+
+ # @return [Boolean]
+ #
+ # source://rack//lib/rack/response.rb#197
def not_found?; end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#143
+ # source://rack//lib/rack/response.rb#189
def ok?; end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#153
+ # source://rack//lib/rack/response.rb#201
def precondition_failed?; end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#156
+ # source://rack//lib/rack/response.rb#204
def redirect?; end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#139
+ # source://rack//lib/rack/response.rb#185
def redirection?; end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#141
+ # source://rack//lib/rack/response.rb#200
+ def request_timeout?; end
+
+ # @return [Boolean]
+ #
+ # source://rack//lib/rack/response.rb#187
def server_error?; end
- # source://rack//lib/rack/response.rb#212
+ # source://rack//lib/rack/response.rb#270
def set_cookie(key, value); end
- # source://rack//lib/rack/response.rb#221
+ # source://rack//lib/rack/response.rb#282
def set_cookie_header; end
- # source://rack//lib/rack/response.rb#225
- def set_cookie_header=(v); end
+ # source://rack//lib/rack/response.rb#286
+ def set_cookie_header=(value); end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#138
+ # source://rack//lib/rack/response.rb#184
def successful?; end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#149
+ # source://rack//lib/rack/response.rb#195
def unauthorized?; end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#154
+ # source://rack//lib/rack/response.rb#202
def unprocessable?; end
protected
- # source://rack//lib/rack/response.rb#287
+ # source://rack//lib/rack/response.rb#359
def append(chunk); end
- # source://rack//lib/rack/response.rb#263
+ # Convert the body of this response into an internally buffered Array if possible.
+ #
+ # `@buffered` is a ternary value which indicates whether the body is buffered. It can be:
+ # * `nil` - The body has not been buffered yet.
+ # * `true` - The body is buffered as an Array instance.
+ # * `false` - The body is not buffered and cannot be buffered.
+ #
+ # @return [Boolean] whether the body is buffered as an Array instance.
+ #
+ # source://rack//lib/rack/response.rb#332
def buffered_body!; end
end
-# source://rack//lib/rack/response.rb#301
+# source://rack//lib/rack/response.rb#375
class Rack::Response::Raw
include ::Rack::Response::Helpers
# @return [Raw] a new instance of Raw
#
- # source://rack//lib/rack/response.rb#307
+ # source://rack//lib/rack/response.rb#381
def initialize(status, headers); end
- # source://rack//lib/rack/response.rb#315
+ # source://rack//lib/rack/response.rb#398
def delete_header(key); end
- # source://rack//lib/rack/response.rb#313
+ # source://rack//lib/rack/response.rb#390
def get_header(key); end
# @return [Boolean]
#
- # source://rack//lib/rack/response.rb#312
+ # source://rack//lib/rack/response.rb#386
def has_header?(key); end
# Returns the value of attribute headers.
#
- # source://rack//lib/rack/response.rb#304
+ # source://rack//lib/rack/response.rb#378
def headers; end
- # source://rack//lib/rack/response.rb#314
- def set_header(key, v); end
+ # source://rack//lib/rack/response.rb#394
+ def set_header(key, value); end
# Returns the value of attribute status.
#
- # source://rack//lib/rack/response.rb#305
+ # source://rack//lib/rack/response.rb#379
def status; end
# Sets the attribute status
#
# @param value the value to set the attribute status to.
#
- # source://rack//lib/rack/response.rb#305
+ # source://rack//lib/rack/response.rb#379
def status=(_arg0); end
end
-# source://rack//lib/rack/response.rb#24
+# source://rack//lib/rack/response.rb#29
Rack::Response::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash)
# Class which can make any IO object rewindable, including non-rewindable ones. It does
# this by buffering the data into a tempfile, which is rewindable.
#
-# rack.input is required to be rewindable, so if your input stream IO is non-rewindable
-# by nature (e.g. a pipe or a socket) then you can wrap it in an object of this class
-# to easily make it rewindable.
-#
# Don't forget to call #close when you're done. This frees up temporary resources that
# RewindableInput uses, though it does *not* close the original IO object.
#
-# source://rack//lib/rack/rewindable_input.rb#16
+# source://rack//lib/rack/rewindable_input.rb#14
class Rack::RewindableInput
# @return [RewindableInput] a new instance of RewindableInput
#
- # source://rack//lib/rack/rewindable_input.rb#17
+ # source://rack//lib/rack/rewindable_input.rb#29
def initialize(io); end
# Closes this RewindableInput object without closing the originally
@@ -3919,96 +3824,114 @@ class Rack::RewindableInput
#
# This method may be called multiple times. It does nothing on subsequent calls.
#
- # source://rack//lib/rack/rewindable_input.rb#48
+ # source://rack//lib/rack/rewindable_input.rb#65
def close; end
- # source://rack//lib/rack/rewindable_input.rb#33
+ # source://rack//lib/rack/rewindable_input.rb#45
def each(&block); end
- # source://rack//lib/rack/rewindable_input.rb#23
+ # source://rack//lib/rack/rewindable_input.rb#35
def gets; end
- # source://rack//lib/rack/rewindable_input.rb#28
+ # source://rack//lib/rack/rewindable_input.rb#40
def read(*args); end
- # source://rack//lib/rack/rewindable_input.rb#38
+ # source://rack//lib/rack/rewindable_input.rb#50
def rewind; end
+ # source://rack//lib/rack/rewindable_input.rb#55
+ def size; end
+
private
# @return [Boolean]
#
- # source://rack//lib/rack/rewindable_input.rb#90
+ # source://rack//lib/rack/rewindable_input.rb#109
def filesystem_has_posix_semantics?; end
- # source://rack//lib/rack/rewindable_input.rb#61
+ # source://rack//lib/rack/rewindable_input.rb#78
def make_rewindable; end
end
-# Sets an "X-Runtime" response header, indicating the response
+# Makes rack.input rewindable, for compatibility with applications and middleware
+# designed for earlier versions of Rack (where rack.input was required to be
+# rewindable).
+#
+# source://rack//lib/rack/rewindable_input.rb#18
+class Rack::RewindableInput::Middleware
+ # @return [Middleware] a new instance of Middleware
+ #
+ # source://rack//lib/rack/rewindable_input.rb#19
+ def initialize(app); end
+
+ # source://rack//lib/rack/rewindable_input.rb#23
+ def call(env); end
+end
+
+# Sets an "x-runtime" response header, indicating the response
# time of the request, in seconds
#
# You can put it right before the application to see the processing
# time, or before all the other middlewares to include time for them,
# too.
#
-# source://rack//lib/rack/runtime.rb#10
+# source://rack//lib/rack/runtime.rb#12
class Rack::Runtime
# @return [Runtime] a new instance of Runtime
#
- # source://rack//lib/rack/runtime.rb#14
+ # source://rack//lib/rack/runtime.rb#16
def initialize(app, name = T.unsafe(nil)); end
- # source://rack//lib/rack/runtime.rb#20
+ # source://rack//lib/rack/runtime.rb#22
def call(env); end
end
-# source://rack//lib/rack/runtime.rb#11
+# source://rack//lib/rack/runtime.rb#13
Rack::Runtime::FORMAT_STRING = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack/runtime.rb#12
+# source://rack//lib/rack/runtime.rb#14
Rack::Runtime::HEADER_NAME = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#24
+# source://rack//lib/rack/constants.rb#11
Rack::SCRIPT_NAME = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#27
+# source://rack//lib/rack/constants.rb#14
Rack::SERVER_NAME = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#28
+# source://rack//lib/rack/constants.rb#15
Rack::SERVER_PORT = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#26
+# source://rack//lib/rack/constants.rb#13
Rack::SERVER_PROTOCOL = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#33
+# source://rack//lib/rack/constants.rb#24
Rack::SET_COOKIE = T.let(T.unsafe(nil), String)
# = Sendfile
#
# The Sendfile middleware intercepts responses whose body is being
-# served from a file and replaces it with a server specific X-Sendfile
+# served from a file and replaces it with a server specific x-sendfile
# header. The web server is then responsible for writing the file contents
# to the client. This can dramatically reduce the amount of work required
# by the Ruby backend and takes advantage of the web server's optimized file
# delivery code.
#
# In order to take advantage of this middleware, the response body must
-# respond to +to_path+ and the request must include an X-Sendfile-Type
+# respond to +to_path+ and the request must include an x-sendfile-type
# header. Rack::Files and other components implement +to_path+ so there's
-# rarely anything you need to do in your application. The X-Sendfile-Type
+# rarely anything you need to do in your application. The x-sendfile-type
# header is typically set in your web servers configuration. The following
# sections attempt to document
#
# === Nginx
#
-# Nginx supports the X-Accel-Redirect header. This is similar to X-Sendfile
+# Nginx supports the x-accel-redirect header. This is similar to x-sendfile
# but requires parts of the filesystem to be mapped into a private URL
# hierarchy.
#
# The following example shows the Nginx configuration required to create
-# a private "/files/" area, enable X-Accel-Redirect, and pass the special
-# X-Sendfile-Type and X-Accel-Mapping headers to the backend:
+# a private "/files/" area, enable x-accel-redirect, and pass the special
+# x-sendfile-type and x-accel-mapping headers to the backend:
#
# location ~ /files/(.*) {
# internal;
@@ -4022,14 +3945,14 @@ Rack::SET_COOKIE = T.let(T.unsafe(nil), String)
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#
-# proxy_set_header X-Sendfile-Type X-Accel-Redirect;
-# proxy_set_header X-Accel-Mapping /var/www/=/files/;
+# proxy_set_header x-sendfile-type x-accel-redirect;
+# proxy_set_header x-accel-mapping /var/www/=/files/;
#
# proxy_pass http://127.0.0.1:8080/;
# }
#
-# Note that the X-Sendfile-Type header must be set exactly as shown above.
-# The X-Accel-Mapping header should specify the location on the file system,
+# Note that the x-sendfile-type header must be set exactly as shown above.
+# The x-accel-mapping header should specify the location on the file system,
# followed by an equals sign (=), followed name of the private URL pattern
# that it maps to. The middleware performs a simple substitution on the
# resulting path.
@@ -4038,8 +3961,8 @@ Rack::SET_COOKIE = T.let(T.unsafe(nil), String)
#
# === lighttpd
#
-# Lighttpd has supported some variation of the X-Sendfile header for some
-# time, although only recent version support X-Sendfile in a reverse proxy
+# Lighttpd has supported some variation of the x-sendfile header for some
+# time, although only recent version support x-sendfile in a reverse proxy
# configuration.
#
# $HTTP["host"] == "example.com" {
@@ -4053,7 +3976,7 @@ Rack::SET_COOKIE = T.let(T.unsafe(nil), String)
#
# proxy-core.allow-x-sendfile = "enable"
# proxy-core.rewrite-request = (
-# "X-Sendfile-Type" => (".*" => "X-Sendfile")
+# "x-sendfile-type" => (".*" => "x-sendfile")
# )
# }
#
@@ -4061,860 +3984,189 @@ Rack::SET_COOKIE = T.let(T.unsafe(nil), String)
#
# === Apache
#
-# X-Sendfile is supported under Apache 2.x using a separate module:
+# x-sendfile is supported under Apache 2.x using a separate module:
#
# https://tn123.org/mod_xsendfile/
#
# Once the module is compiled and installed, you can enable it using
# XSendFile config directive:
#
-# RequestHeader Set X-Sendfile-Type X-Sendfile
+# RequestHeader Set x-sendfile-type x-sendfile
# ProxyPassReverse / http://localhost:8001/
# XSendFile on
#
# === Mapping parameter
#
# The third parameter allows for an overriding extension of the
-# X-Accel-Mapping header. Mappings should be provided in tuples of internal to
+# x-accel-mapping header. Mappings should be provided in tuples of internal to
# external. The internal values may contain regular expression syntax, they
# will be matched with case indifference.
#
-# source://rack//lib/rack/sendfile.rb#100
+# source://rack//lib/rack/sendfile.rb#104
class Rack::Sendfile
# @return [Sendfile] a new instance of Sendfile
#
- # source://rack//lib/rack/sendfile.rb#101
+ # source://rack//lib/rack/sendfile.rb#105
def initialize(app, variation = T.unsafe(nil), mappings = T.unsafe(nil)); end
- # source://rack//lib/rack/sendfile.rb#109
+ # source://rack//lib/rack/sendfile.rb#113
def call(env); end
private
- # source://rack//lib/rack/sendfile.rb#149
+ # source://rack//lib/rack/sendfile.rb#154
def map_accel_path(env, path); end
- # source://rack//lib/rack/sendfile.rb#143
+ # source://rack//lib/rack/sendfile.rb#148
def variation(env); end
end
-# source://rack//lib/rack/server.rb#8
-class Rack::Server
- # Options may include:
- # * :app
- # a rack application to run (overrides :config and :builder)
- # * :builder
- # a string to evaluate a Rack::Builder from
- # * :config
- # a rackup configuration file path to load (.ru)
- # * :environment
- # this selects the middleware that will be wrapped around
- # your application. Default options available are:
- # - development: CommonLogger, ShowExceptions, and Lint
- # - deployment: CommonLogger
- # - none: no extra middleware
- # note: when the server is a cgi server, CommonLogger is not included.
- # * :server
- # choose a specific Rack::Handler, e.g. cgi, fcgi, webrick
- # * :daemonize
- # if true, the server will daemonize itself (fork, detach, etc)
- # * :pid
- # path to write a pid file after daemonize
- # * :Host
- # the host address to bind to (used by supporting Rack::Handler)
- # * :Port
- # the port to bind to (used by supporting Rack::Handler)
- # * :AccessLog
- # webrick access log options (or supporting Rack::Handler)
- # * :debug
- # turn on debug output ($DEBUG = true)
- # * :warn
- # turn on warnings ($-w = true)
- # * :include
- # add given paths to $LOAD_PATH
- # * :require
- # require the given libraries
- #
- # Additional options for profiling app initialization include:
- # * :heapfile
- # location for ObjectSpace.dump_all to write the output to
- # * :profile_file
- # location for CPU/Memory (StackProf) profile output (defaults to a tempfile)
- # * :profile_mode
- # StackProf profile mode (cpu|wall|object)
- #
- # @return [Server] a new instance of Server
- #
- # source://rack//lib/rack/server.rb#215
- def initialize(options = T.unsafe(nil)); end
-
- # source://rack//lib/rack/server.rb#248
- def app; end
+# Rack::ShowExceptions catches all exceptions raised from the app it
+# wraps. It shows a useful backtrace with the sourcefile and
+# clickable context, the whole Rack environment and the request
+# data.
+#
+# Be careful when you use this on public-facing sites as it could
+# reveal information helpful to attackers.
+#
+# source://rack//lib/rack/show_exceptions.rb#18
+class Rack::ShowExceptions
+ # @return [ShowExceptions] a new instance of ShowExceptions
+ #
+ # source://rack//lib/rack/show_exceptions.rb#26
+ def initialize(app); end
- # source://rack//lib/rack/server.rb#234
- def default_options; end
+ # source://rack//lib/rack/show_exceptions.rb#30
+ def call(env); end
- # source://rack//lib/rack/server.rb#282
- def middleware; end
+ # source://rack//lib/rack/show_exceptions.rb#65
+ def dump_exception(exception); end
- # source://rack//lib/rack/server.rb#229
- def options; end
+ # source://rack//lib/rack/show_exceptions.rb#116
+ def h(obj); end
- # Sets the attribute options
- #
- # @param value the value to set the attribute options to.
+ # @return [Boolean]
#
- # source://rack//lib/rack/server.rb#171
- def options=(_arg0); end
+ # source://rack//lib/rack/show_exceptions.rb#56
+ def prefers_plaintext?(env); end
- # source://rack//lib/rack/server.rb#330
- def server; end
+ # source://rack//lib/rack/show_exceptions.rb#76
+ def pretty(env, exception); end
- # source://rack//lib/rack/server.rb#286
- def start(&block); end
+ # source://rack//lib/rack/show_exceptions.rb#112
+ def template; end
private
- # source://rack//lib/rack/server.rb#411
- def build_app(app); end
-
- # source://rack//lib/rack/server.rb#344
- def build_app_and_options_from_config; end
+ # @return [Boolean]
+ #
+ # source://rack//lib/rack/show_exceptions.rb#60
+ def accepts_html?(env); end
+end
- # source://rack//lib/rack/server.rb#392
- def build_app_from_string; end
+# source://rack//lib/rack/show_exceptions.rb#19
+Rack::ShowExceptions::CONTEXT = T.let(T.unsafe(nil), Integer)
- # source://rack//lib/rack/server.rb#440
- def check_pid!; end
+# source://rack//lib/rack/show_exceptions.rb#21
+class Rack::ShowExceptions::Frame < ::Struct
+ # Returns the value of attribute context_line
+ #
+ # @return [Object] the current value of context_line
+ def context_line; end
- # source://rack//lib/rack/server.rb#425
- def daemonize_app; end
+ # Sets the attribute context_line
+ #
+ # @param value [Object] the value to set the attribute context_line to.
+ # @return [Object] the newly set value
+ def context_line=(_); end
- # source://rack//lib/rack/server.rb#354
- def handle_profiling(heapfile, profile_mode, filename); end
+ # Returns the value of attribute filename
+ #
+ # @return [Object] the current value of filename
+ def filename; end
- # source://rack//lib/rack/server.rb#382
- def make_profile_name(filename); end
+ # Sets the attribute filename
+ #
+ # @param value [Object] the value to set the attribute filename to.
+ # @return [Object] the newly set value
+ def filename=(_); end
- # source://rack//lib/rack/server.rb#407
- def opt_parser; end
+ # Returns the value of attribute function
+ #
+ # @return [Object] the current value of function
+ def function; end
- # source://rack//lib/rack/server.rb#396
- def parse_options(args); end
+ # Sets the attribute function
+ #
+ # @param value [Object] the value to set the attribute function to.
+ # @return [Object] the newly set value
+ def function=(_); end
- # source://rack//lib/rack/server.rb#450
- def pidfile_process_status; end
+ # Returns the value of attribute lineno
+ #
+ # @return [Object] the current value of lineno
+ def lineno; end
- # source://rack//lib/rack/server.rb#421
- def wrapped_app; end
+ # Sets the attribute lineno
+ #
+ # @param value [Object] the value to set the attribute lineno to.
+ # @return [Object] the newly set value
+ def lineno=(_); end
- # source://rack//lib/rack/server.rb#432
- def write_pid; end
+ # Returns the value of attribute post_context
+ #
+ # @return [Object] the current value of post_context
+ def post_context; end
- class << self
- # source://rack//lib/rack/server.rb#259
- def default_middleware_by_environment; end
-
- # source://rack//lib/rack/server.rb#253
- def logging_middleware; end
-
- # source://rack//lib/rack/server.rb#277
- def middleware; end
-
- # Start a new rack server (like running rackup). This will parse ARGV and
- # provide standard ARGV rackup options, defaulting to load 'config.ru'.
- #
- # Providing an options hash will prevent ARGV parsing and will not include
- # any default options.
- #
- # This method can be used to very easily launch a CGI application, for
- # example:
- #
- # Rack::Server.start(
- # :app => lambda do |e|
- # [200, {'Content-Type' => 'text/html'}, ['hello world']]
- # end,
- # :server => 'cgi'
- # )
- #
- # Further options available here are documented on Rack::Server#initialize
- #
- # source://rack//lib/rack/server.rb#167
- def start(options = T.unsafe(nil)); end
- end
-end
-
-# source://rack//lib/rack/server.rb#11
-class Rack::Server::Options
- # source://rack//lib/rack/server.rb#127
- def handler_opts(options); end
-
- # source://rack//lib/rack/server.rb#12
- def parse!(args); end
-end
-
-# source://rack//lib/rack.rb#136
-module Rack::Session; end
-
-# source://rack//lib/rack/session/abstract/id.rb#41
-module Rack::Session::Abstract; end
-
-# source://rack//lib/rack/session/abstract/id.rb#487
-class Rack::Session::Abstract::ID < ::Rack::Session::Abstract::Persisted
- # All thread safety and session destroy procedures should occur here.
- # Should return a new session id or nil if options[:drop]
- #
- # source://rack//lib/rack/session/abstract/id.rb#517
- def delete_session(req, sid, options); end
-
- # All thread safety and session retrieval procedures should occur here.
- # Should return [session_id, session].
- # If nil is provided as the session id, generation of a new valid id
- # should occur within.
- #
- # source://rack//lib/rack/session/abstract/id.rb#502
- def find_session(req, sid); end
-
- # All thread safety and session storage procedures should occur here.
- # Must return the session id if the session was saved successfully, or
- # false if the session could not be saved.
- #
- # source://rack//lib/rack/session/abstract/id.rb#510
- def write_session(req, sid, session, options); end
-
- class << self
- # @private
- #
- # source://rack//lib/rack/session/abstract/id.rb#488
- def inherited(klass); end
- end
-end
-
-# ID sets up a basic framework for implementing an id based sessioning
-# service. Cookies sent to the client for maintaining sessions will only
-# contain an id reference. Only #find_session, #write_session and
-# #delete_session are required to be overwritten.
-#
-# All parameters are optional.
-# * :key determines the name of the cookie, by default it is
-# 'rack.session'
-# * :path, :domain, :expire_after, :secure, and :httponly set the related
-# cookie options as by Rack::Response#set_cookie
-# * :skip will not a set a cookie in the response nor update the session state
-# * :defer will not set a cookie in the response but still update the session
-# state if it is used with a backend
-# * :renew (implementation dependent) will prompt the generation of a new
-# session id, and migration of data to be referenced at the new id. If
-# :defer is set, it will be overridden and the cookie will be set.
-# * :sidbits sets the number of bits in length that a generated session
-# id will be.
-#
-# These options can be set on a per request basis, at the location of
-# env['rack.session.options']. Additionally the id of the
-# session can be found within the options hash at the key :id. It is
-# highly not recommended to change its value.
-#
-# Is Rack::Utils::Context compatible.
-#
-# Not included by default; you must require 'rack/session/abstract/id'
-# to use.
-#
-# source://rack//lib/rack/session/abstract/id.rb#233
-class Rack::Session::Abstract::Persisted
- # @return [Persisted] a new instance of Persisted
- #
- # source://rack//lib/rack/session/abstract/id.rb#250
- def initialize(app, options = T.unsafe(nil)); end
-
- # source://rack//lib/rack/session/abstract/id.rb#259
- def call(env); end
-
- # Acquires the session from the environment and the session id from
- # the session options and passes them to #write_session. If successful
- # and the :defer option is not true, a cookie will be added to the
- # response with the session's id.
- #
- # source://rack//lib/rack/session/abstract/id.rb#373
- def commit_session(req, res); end
-
- # source://rack//lib/rack/session/abstract/id.rb#263
- def context(env, app = T.unsafe(nil)); end
-
- # Returns the value of attribute default_options.
- #
- # source://rack//lib/rack/session/abstract/id.rb#248
- def default_options; end
-
- # Returns the value of attribute key.
- #
- # source://rack//lib/rack/session/abstract/id.rb#248
- def key; end
-
- # Returns the value of attribute sid_secure.
- #
- # source://rack//lib/rack/session/abstract/id.rb#248
- def sid_secure; end
-
- private
-
- # Session should be committed if it was loaded, any of specific options like :renew, :drop
- # or :expire_after was given and the security permissions match. Skips if skip is given.
- #
- # @return [Boolean]
- #
- # source://rack//lib/rack/session/abstract/id.rb#342
- def commit_session?(req, session, options); end
-
- # source://rack//lib/rack/session/abstract/id.rb#408
- def cookie_value(data); end
-
- # Returns the current session id from the SessionHash.
+ # Sets the attribute post_context
#
- # source://rack//lib/rack/session/abstract/id.rb#328
- def current_session_id(req); end
-
- # All thread safety and session destroy procedures should occur here.
- # Should return a new session id or nil if options[:drop]
- #
- # source://rack//lib/rack/session/abstract/id.rb#448
- def delete_session(req, sid, options); end
-
- # Extract session id from request object.
- #
- # source://rack//lib/rack/session/abstract/id.rb#320
- def extract_session_id(request); end
-
- # All thread safety and session retrieval procedures should occur here.
- # Should return [session_id, session].
- # If nil is provided as the session id, generation of a new valid id
- # should occur within.
- #
- # source://rack//lib/rack/session/abstract/id.rb#433
- def find_session(env, sid); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/session/abstract/id.rb#359
- def force_options?(options); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/session/abstract/id.rb#355
- def forced_session_update?(session, options); end
-
- # Generate a new session id using Ruby #rand. The size of the
- # session id is controlled by the :sidbits option.
- # Monkey patch this to use custom methods for session id generation.
- #
- # source://rack//lib/rack/session/abstract/id.rb#288
- def generate_sid(secure = T.unsafe(nil)); end
-
- # source://rack//lib/rack/session/abstract/id.rb#278
- def initialize_sid; end
-
- # Extracts the session id from provided cookies and passes it and the
- # environment to #find_session.
- #
- # source://rack//lib/rack/session/abstract/id.rb#312
- def load_session(req); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/session/abstract/id.rb#351
- def loaded_session?(session); end
-
- # source://rack//lib/rack/session/abstract/id.rb#274
- def make_request(env); end
-
- # Sets the lazy session at 'rack.session' and places options and session
- # metadata into 'rack.session.options'.
- #
- # source://rack//lib/rack/session/abstract/id.rb#301
- def prepare_session(req); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/session/abstract/id.rb#363
- def security_matches?(request, options); end
-
- # Allow subclasses to prepare_session for different Session classes
- #
- # source://rack//lib/rack/session/abstract/id.rb#424
- def session_class; end
-
- # Check if the session exists or not.
- #
- # @return [Boolean]
- #
- # source://rack//lib/rack/session/abstract/id.rb#334
- def session_exists?(req); end
-
- # Sets the cookie back to the client with session id. We skip the cookie
- # setting if the value didn't change (sid is the same) or expires was given.
- #
- # source://rack//lib/rack/session/abstract/id.rb#415
- def set_cookie(request, res, cookie); end
-
- # All thread safety and session storage procedures should occur here.
- # Must return the session id if the session was saved successfully, or
- # false if the session could not be saved.
- #
- # source://rack//lib/rack/session/abstract/id.rb#441
- def write_session(req, sid, session, options); end
-end
-
-# source://rack//lib/rack/session/abstract/id.rb#234
-Rack::Session::Abstract::Persisted::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
-
-# source://rack//lib/rack/session/abstract/id.rb#453
-class Rack::Session::Abstract::PersistedSecure < ::Rack::Session::Abstract::Persisted
- # source://rack//lib/rack/session/abstract/id.rb#471
- def extract_session_id(*_arg0); end
-
- # source://rack//lib/rack/session/abstract/id.rb#465
- def generate_sid(*_arg0); end
-
- private
-
- # source://rack//lib/rack/session/abstract/id.rb#482
- def cookie_value(data); end
-
- # source://rack//lib/rack/session/abstract/id.rb#478
- def session_class; end
-end
-
-# source://rack//lib/rack/session/abstract/id.rb#454
-class Rack::Session::Abstract::PersistedSecure::SecureSessionHash < ::Rack::Session::Abstract::SessionHash
- # source://rack//lib/rack/session/abstract/id.rb#455
- def [](key); end
-end
-
-# SessionHash is responsible to lazily load the session from store.
-#
-# source://rack//lib/rack/session/abstract/id.rb#44
-class Rack::Session::Abstract::SessionHash
- include ::Enumerable
-
- # @return [SessionHash] a new instance of SessionHash
- #
- # source://rack//lib/rack/session/abstract/id.rb#62
- def initialize(store, req); end
-
- # source://rack//lib/rack/session/abstract/id.rb#82
- def [](key); end
-
- # source://rack//lib/rack/session/abstract/id.rb#108
- def []=(key, value); end
-
- # source://rack//lib/rack/session/abstract/id.rb#114
- def clear; end
-
- # source://rack//lib/rack/session/abstract/id.rb#140
- def delete(key); end
-
- # source://rack//lib/rack/session/abstract/id.rb#119
- def destroy; end
-
- # source://rack//lib/rack/session/abstract/id.rb#87
- def dig(key, *keys); end
-
- # source://rack//lib/rack/session/abstract/id.rb#77
- def each(&block); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/session/abstract/id.rb#163
- def empty?; end
+ # @param value [Object] the value to set the attribute post_context to.
+ # @return [Object] the newly set value
+ def post_context=(_); end
- # @return [Boolean]
+ # Returns the value of attribute post_context_lineno
#
- # source://rack//lib/rack/session/abstract/id.rb#153
- def exists?; end
+ # @return [Object] the current value of post_context_lineno
+ def post_context_lineno; end
- # source://rack//lib/rack/session/abstract/id.rb#92
- def fetch(key, default = T.unsafe(nil), &block); end
-
- # @return [Boolean]
+ # Sets the attribute post_context_lineno
#
- # source://rack//lib/rack/session/abstract/id.rb#101
- def has_key?(key); end
-
- # source://rack//lib/rack/session/abstract/id.rb#68
- def id; end
+ # @param value [Object] the value to set the attribute post_context_lineno to.
+ # @return [Object] the newly set value
+ def post_context_lineno=(_); end
- # Sets the attribute id
+ # Returns the value of attribute pre_context
#
- # @param value the value to set the attribute id to.
- #
- # source://rack//lib/rack/session/abstract/id.rb#46
- def id=(_arg0); end
+ # @return [Object] the current value of pre_context
+ def pre_context; end
- # @return [Boolean]
+ # Sets the attribute pre_context
#
- # source://rack//lib/rack/session/abstract/id.rb#101
- def include?(key); end
-
- # source://rack//lib/rack/session/abstract/id.rb#145
- def inspect; end
+ # @param value [Object] the value to set the attribute pre_context to.
+ # @return [Object] the newly set value
+ def pre_context=(_); end
- # @return [Boolean]
+ # Returns the value of attribute pre_context_lineno
#
- # source://rack//lib/rack/session/abstract/id.rb#101
- def key?(key); end
+ # @return [Object] the current value of pre_context_lineno
+ def pre_context_lineno; end
- # source://rack//lib/rack/session/abstract/id.rb#168
- def keys; end
-
- # @return [Boolean]
+ # Sets the attribute pre_context_lineno
#
- # source://rack//lib/rack/session/abstract/id.rb#159
- def loaded?; end
-
- # source://rack//lib/rack/session/abstract/id.rb#129
- def merge!(hash); end
-
- # source://rack//lib/rack/session/abstract/id.rb#73
- def options; end
-
- # source://rack//lib/rack/session/abstract/id.rb#135
- def replace(hash); end
-
- # source://rack//lib/rack/session/abstract/id.rb#108
- def store(key, value); end
-
- # source://rack//lib/rack/session/abstract/id.rb#124
- def to_hash; end
-
- # source://rack//lib/rack/session/abstract/id.rb#129
- def update(hash); end
-
- # source://rack//lib/rack/session/abstract/id.rb#173
- def values; end
-
- private
-
- # source://rack//lib/rack/session/abstract/id.rb#188
- def load!; end
-
- # source://rack//lib/rack/session/abstract/id.rb#180
- def load_for_read!; end
-
- # source://rack//lib/rack/session/abstract/id.rb#184
- def load_for_write!; end
-
- # source://rack//lib/rack/session/abstract/id.rb#194
- def stringify_keys(other); end
+ # @param value [Object] the value to set the attribute pre_context_lineno to.
+ # @return [Object] the newly set value
+ def pre_context_lineno=(_); end
class << self
- # source://rack//lib/rack/session/abstract/id.rb#50
- def find(req); end
-
- # source://rack//lib/rack/session/abstract/id.rb#54
- def set(req, session); end
-
- # source://rack//lib/rack/session/abstract/id.rb#58
- def set_options(req, options); end
+ def [](*_arg0); end
+ def inspect; end
+ def keyword_init?; end
+ def members; end
+ def new(*_arg0); end
end
end
-# source://rack//lib/rack/session/abstract/id.rb#48
-Rack::Session::Abstract::SessionHash::Unspecified = T.let(T.unsafe(nil), Object)
-
-# Rack::Session::Cookie provides simple cookie based session management.
-# By default, the session is a Ruby Hash stored as base64 encoded marshalled
-# data set to :key (default: rack.session). The object that encodes the
-# session data is configurable and must respond to +encode+ and +decode+.
-# Both methods must take a string and return a string.
-#
-# When the secret key is set, cookie data is checked for data integrity.
-# The old secret key is also accepted and allows graceful secret rotation.
-#
-# Example:
-#
-# use Rack::Session::Cookie, :key => 'rack.session',
-# :domain => 'foo.com',
-# :path => '/',
-# :expire_after => 2592000,
-# :secret => 'change_me',
-# :old_secret => 'also_change_me'
-#
-# All parameters are optional.
-#
-#
-# Rack::Session::Cookie.new(application, {
-# :coder => Rack::Session::Cookie::Identity.new
-# })
-#
-#
-# Rack::Session::Cookie.new(application, {
-# :coder => Class.new {
-# def encode(str); str.reverse; end
-# def decode(str); str.reverse; end
-# }.new
-# })
-#
-# source://rack//lib/rack/session/cookie.rb#50
-class Rack::Session::Cookie < ::Rack::Session::Abstract::PersistedSecure
- # @return [Cookie] a new instance of Cookie
- #
- # source://rack//lib/rack/session/cookie.rb#108
- def initialize(app, options = T.unsafe(nil)); end
-
- # Returns the value of attribute coder.
- #
- # source://rack//lib/rack/session/cookie.rb#106
- def coder; end
-
- private
-
- # source://rack//lib/rack/session/cookie.rb#181
- def delete_session(req, session_id, options); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/session/cookie.rb#186
- def digest_match?(data, digest); end
-
- # source://rack//lib/rack/session/cookie.rb#133
- def extract_session_id(request); end
-
- # source://rack//lib/rack/session/cookie.rb#127
- def find_session(req, sid); end
-
- # source://rack//lib/rack/session/cookie.rb#193
- def generate_hmac(data, secret); end
-
- # source://rack//lib/rack/session/cookie.rb#150
- def persistent_session_id!(data, sid = T.unsafe(nil)); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/session/cookie.rb#197
- def secure?(options); end
-
- # source://rack//lib/rack/session/cookie.rb#137
- def unpacked_cookie_data(request); end
-
- # source://rack//lib/rack/session/cookie.rb#165
- def write_session(req, session_id, session, options); end
-end
-
-# Encode session cookies as Base64
-#
-# source://rack//lib/rack/session/cookie.rb#52
-class Rack::Session::Cookie::Base64
- # source://rack//lib/rack/session/cookie.rb#57
- def decode(str); end
-
- # source://rack//lib/rack/session/cookie.rb#53
- def encode(str); end
-end
-
-# N.B. Unlike other encoding methods, the contained objects must be a
-# valid JSON composite type, either a Hash or an Array.
-#
-# source://rack//lib/rack/session/cookie.rb#75
-class Rack::Session::Cookie::Base64::JSON < ::Rack::Session::Cookie::Base64
- # source://rack//lib/rack/session/cookie.rb#80
- def decode(str); end
-
- # source://rack//lib/rack/session/cookie.rb#76
- def encode(obj); end
-end
-
-# Encode session cookies as Marshaled Base64 data
-#
-# source://rack//lib/rack/session/cookie.rb#62
-class Rack::Session::Cookie::Base64::Marshal < ::Rack::Session::Cookie::Base64
- # source://rack//lib/rack/session/cookie.rb#67
- def decode(str); end
-
- # source://rack//lib/rack/session/cookie.rb#63
- def encode(str); end
-end
-
-# source://rack//lib/rack/session/cookie.rb#86
-class Rack::Session::Cookie::Base64::ZipJSON < ::Rack::Session::Cookie::Base64
- # source://rack//lib/rack/session/cookie.rb#91
- def decode(str); end
-
- # source://rack//lib/rack/session/cookie.rb#87
- def encode(obj); end
-end
-
-# Use no encoding for session cookies
-#
-# source://rack//lib/rack/session/cookie.rb#101
-class Rack::Session::Cookie::Identity
- # source://rack//lib/rack/session/cookie.rb#103
- def decode(str); end
-
- # source://rack//lib/rack/session/cookie.rb#102
- def encode(str); end
-end
-
-# source://rack//lib/rack/session/cookie.rb#156
-class Rack::Session::Cookie::SessionId
- # @return [SessionId] a new instance of SessionId
- #
- # source://rack//lib/rack/session/cookie.rb#159
- def initialize(session_id, cookie_value); end
-
- # Returns the value of attribute cookie_value.
- #
- # source://rack//lib/rack/session/cookie.rb#157
- def cookie_value; end
-end
-
-# source://rack//lib/rack/session/memcache.rb#8
-Rack::Session::Memcache = Rack::Session::Dalli
-
-# Rack::Session::Pool provides simple cookie based session management.
-# Session data is stored in a hash held by @pool.
-# In the context of a multithreaded environment, sessions being
-# committed to the pool is done in a merging manner.
-#
-# The :drop option is available in rack.session.options if you wish to
-# explicitly remove the session from the session cache.
-#
-# Example:
-# myapp = MyRackApp.new
-# sessioned = Rack::Session::Pool.new(myapp,
-# :domain => 'foo.com',
-# :expire_after => 2592000
-# )
-# Rack::Handler::WEBrick.run sessioned
-#
-# source://rack//lib/rack/session/pool.rb#29
-class Rack::Session::Pool < ::Rack::Session::Abstract::PersistedSecure
- # @return [Pool] a new instance of Pool
- #
- # source://rack//lib/rack/session/pool.rb#33
- def initialize(app, options = T.unsafe(nil)); end
-
- # source://rack//lib/rack/session/pool.rb#63
- def delete_session(req, session_id, options); end
-
- # source://rack//lib/rack/session/pool.rb#46
- def find_session(req, sid); end
-
- # source://rack//lib/rack/session/pool.rb#39
- def generate_sid; end
-
- # Returns the value of attribute mutex.
- #
- # source://rack//lib/rack/session/pool.rb#30
- def mutex; end
-
- # Returns the value of attribute pool.
- #
- # source://rack//lib/rack/session/pool.rb#30
- def pool; end
-
- # source://rack//lib/rack/session/pool.rb#71
- def with_lock(req); end
-
- # source://rack//lib/rack/session/pool.rb#56
- def write_session(req, session_id, new_session, options); end
-
- private
-
- # source://rack//lib/rack/session/pool.rb#80
- def get_session_with_fallback(sid); end
-end
-
-# source://rack//lib/rack/session/pool.rb#31
-Rack::Session::Pool::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
-
-# source://rack//lib/rack/session/abstract/id.rb#15
-class Rack::Session::SessionId
- # @return [SessionId] a new instance of SessionId
- #
- # source://rack//lib/rack/session/abstract/id.rb#20
- def initialize(public_id); end
-
- # Returns the value of attribute public_id.
- #
- # source://rack//lib/rack/session/abstract/id.rb#18
- def cookie_value; end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/session/abstract/id.rb#31
- def empty?; end
-
- # source://rack//lib/rack/session/abstract/id.rb#32
- def inspect; end
-
- # source://rack//lib/rack/session/abstract/id.rb#24
- def private_id; end
-
- # Returns the value of attribute public_id.
- #
- # source://rack//lib/rack/session/abstract/id.rb#18
- def public_id; end
-
- # Returns the value of attribute public_id.
- #
- # source://rack//lib/rack/session/abstract/id.rb#18
- def to_s; end
-
- private
-
- # source://rack//lib/rack/session/abstract/id.rb#36
- def hash_sid(sid); end
-end
-
-# source://rack//lib/rack/session/abstract/id.rb#16
-Rack::Session::SessionId::ID_VERSION = T.let(T.unsafe(nil), Integer)
-
-# Rack::ShowExceptions catches all exceptions raised from the app it
-# wraps. It shows a useful backtrace with the sourcefile and
-# clickable context, the whole Rack environment and the request
-# data.
-#
-# Be careful when you use this on public-facing sites as it could
-# reveal information helpful to attackers.
-#
-# source://rack//lib/rack/show_exceptions.rb#15
-class Rack::ShowExceptions
- # @return [ShowExceptions] a new instance of ShowExceptions
- #
- # source://rack//lib/rack/show_exceptions.rb#18
- def initialize(app); end
-
- # source://rack//lib/rack/show_exceptions.rb#22
- def call(env); end
-
- # source://rack//lib/rack/show_exceptions.rb#57
- def dump_exception(exception); end
-
- # source://rack//lib/rack/show_exceptions.rb#103
- def h(obj); end
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/show_exceptions.rb#48
- def prefers_plaintext?(env); end
-
- # source://rack//lib/rack/show_exceptions.rb#63
- def pretty(env, exception); end
-
- # source://rack//lib/rack/show_exceptions.rb#99
- def template; end
-
- private
-
- # @return [Boolean]
- #
- # source://rack//lib/rack/show_exceptions.rb#52
- def accepts_html?(env); end
-end
-
-# source://rack//lib/rack/show_exceptions.rb#16
-Rack::ShowExceptions::CONTEXT = T.let(T.unsafe(nil), Integer)
-
-# source://rack//lib/rack/show_exceptions.rb#118
+# source://rack//lib/rack/show_exceptions.rb#131
Rack::ShowExceptions::TEMPLATE = T.let(T.unsafe(nil), ERB)
# Rack::ShowStatus catches all empty responses and replaces them
@@ -4924,21 +4176,21 @@ Rack::ShowExceptions::TEMPLATE = T.let(T.unsafe(nil), ERB)
# and will be shown as HTML. If such details exist, the error page
# is always rendered, even if the reply was not empty.
#
-# source://rack//lib/rack/show_status.rb#13
+# source://rack//lib/rack/show_status.rb#18
class Rack::ShowStatus
# @return [ShowStatus] a new instance of ShowStatus
#
- # source://rack//lib/rack/show_status.rb#14
+ # source://rack//lib/rack/show_status.rb#19
def initialize(app); end
- # source://rack//lib/rack/show_status.rb#19
+ # source://rack//lib/rack/show_status.rb#24
def call(env); end
- # source://rack//lib/rack/show_status.rb#44
+ # source://rack//lib/rack/show_status.rb#54
def h(obj); end
end
-# source://rack//lib/rack/show_status.rb#59
+# source://rack//lib/rack/show_status.rb#69
Rack::ShowStatus::TEMPLATE = T.let(T.unsafe(nil), String)
# The Rack::Static middleware intercepts requests for static files
@@ -5017,23 +4269,23 @@ Rack::ShowStatus::TEMPLATE = T.let(T.unsafe(nil), String)
# :header_rules => [
# # Cache all static files in public caches (e.g. Rack::Cache)
# # as well as in the browser
-# [:all, {'Cache-Control' => 'public, max-age=31536000'}],
+# [:all, {'cache-control' => 'public, max-age=31536000'}],
#
# # Provide web fonts with cross-origin access-control-headers
# # Firefox requires this when serving assets using a Content Delivery Network
-# [:fonts, {'Access-Control-Allow-Origin' => '*'}]
+# [:fonts, {'access-control-allow-origin' => '*'}]
# ]
#
-# source://rack//lib/rack/static.rb#88
+# source://rack//lib/rack/static.rb#92
class Rack::Static
# @return [Static] a new instance of Static
#
- # source://rack//lib/rack/static.rb#91
+ # source://rack//lib/rack/static.rb#93
def initialize(app, options = T.unsafe(nil)); end
# @return [Boolean]
#
- # source://rack//lib/rack/static.rb#107
+ # source://rack//lib/rack/static.rb#109
def add_index_root?(path); end
# Convert HTTP header rules to HTTP headers
@@ -5041,41 +4293,41 @@ class Rack::Static
# source://rack//lib/rack/static.rb#166
def applicable_rules(path); end
- # source://rack//lib/rack/static.rb#123
+ # source://rack//lib/rack/static.rb#125
def call(env); end
- # source://rack//lib/rack/static.rb#119
+ # source://rack//lib/rack/static.rb#121
def can_serve(path); end
- # source://rack//lib/rack/static.rb#111
+ # source://rack//lib/rack/static.rb#113
def overwrite_file_path(path); end
- # source://rack//lib/rack/static.rb#115
+ # source://rack//lib/rack/static.rb#117
def route_file(path); end
end
-# source://rack//lib/rack.rb#48
+# source://rack//lib/rack/constants.rb#38
Rack::TRACE = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack.rb#34
+# source://rack//lib/rack/constants.rb#25
Rack::TRANSFER_ENCODING = T.let(T.unsafe(nil), String)
# Middleware tracks and cleans Tempfiles created throughout a request (i.e. Rack::Multipart)
# Ideas/strategy based on posts by Eric Wong and Charles Oliver Nutter
# https://groups.google.com/forum/#!searchin/rack-devel/temp/rack-devel/brK8eh-MByw/sw61oJJCGRMJ
#
-# source://rack//lib/rack/tempfile_reaper.rb#8
+# source://rack//lib/rack/tempfile_reaper.rb#11
class Rack::TempfileReaper
# @return [TempfileReaper] a new instance of TempfileReaper
#
- # source://rack//lib/rack/tempfile_reaper.rb#9
+ # source://rack//lib/rack/tempfile_reaper.rb#12
def initialize(app); end
- # source://rack//lib/rack/tempfile_reaper.rb#13
+ # source://rack//lib/rack/tempfile_reaper.rb#16
def call(env); end
end
-# source://rack//lib/rack.rb#47
+# source://rack//lib/rack/constants.rb#37
Rack::UNLINK = T.let(T.unsafe(nil), String)
# Rack::URLMap takes a hash mapping urls or paths to apps, and
@@ -5090,196 +4342,254 @@ Rack::UNLINK = T.let(T.unsafe(nil), String)
# URLMap dispatches in such a way that the longest paths are tried
# first, since they are most specific.
#
-# source://rack//lib/rack/urlmap.rb#18
+# source://rack//lib/rack/urlmap.rb#20
class Rack::URLMap
# @return [URLMap] a new instance of URLMap
#
- # source://rack//lib/rack/urlmap.rb#19
+ # source://rack//lib/rack/urlmap.rb#21
def initialize(map = T.unsafe(nil)); end
- # source://rack//lib/rack/urlmap.rb#46
+ # source://rack//lib/rack/urlmap.rb#48
def call(env); end
- # source://rack//lib/rack/urlmap.rb#23
+ # source://rack//lib/rack/urlmap.rb#25
def remap(map); end
private
# @return [Boolean]
#
- # source://rack//lib/rack/urlmap.rb#85
+ # source://rack//lib/rack/urlmap.rb#87
def casecmp?(v1, v2); end
end
# Rack::Utils contains a grab-bag of useful methods for writing web
# applications adopted from all kinds of Ruby libraries.
#
-# source://rack//lib/rack/utils.rb#16
+# source://rack//lib/rack/utils.rb#20
module Rack::Utils
private
- # source://rack//lib/rack/utils.rb#237
- def add_cookie_to_header(header, key, value); end
-
- # Adds a cookie that will *remove* a cookie from the client. Hence the
- # strange method name.
- #
- # source://rack//lib/rack/utils.rb#320
- def add_remove_cookie_to_header(header, key, value = T.unsafe(nil)); end
-
# Return best accept value to use, based on the algorithm
# in RFC 2616 Section 14. If there are multiple best
# matches (same specificity and quality), the value returned
# is arbitrary.
#
- # source://rack//lib/rack/utils.rb#159
+ # source://rack//lib/rack/utils.rb#166
def best_q_match(q_value_header, available_mimes); end
- # source://rack//lib/rack/utils.rb#126
+ # source://rack//lib/rack/utils.rb#119
def build_nested_query(value, prefix = T.unsafe(nil)); end
- # source://rack//lib/rack/utils.rb#116
+ # source://rack//lib/rack/utils.rb#109
def build_query(params); end
# Parses the "Range:" header, if present, into an array of Range objects.
# Returns nil if the header is missing or syntactically invalid.
# Returns an empty array if none of the ranges are satisfiable.
#
- # source://rack//lib/rack/utils.rb#352
+ # source://rack//lib/rack/utils.rb#408
def byte_ranges(env, size); end
- # source://rack//lib/rack/utils.rb#609
+ # source://rack//lib/rack/utils.rb#608
def clean_path_info(path_info); end
# :nocov:
#
- # source://rack//lib/rack/utils.rb#97
+ # source://rack//lib/rack/utils.rb#90
def clock_time; end
- # source://rack//lib/rack/utils.rb#313
- def delete_cookie_header!(header, key, value = T.unsafe(nil)); end
+ # source://rack//lib/rack/utils.rb#366
+ def delete_cookie_header!(headers, key, value = T.unsafe(nil)); end
+
+ # :call-seq:
+ # delete_set_cookie_header(key, value = {}) -> encoded string
+ #
+ # Generate an encoded string based on the given +key+ and +value+ using
+ # set_cookie_header for the purpose of causing the specified cookie to be
+ # deleted. The +value+ may be an instance of +Hash+ and can include
+ # attributes as outlined by set_cookie_header. The encoded cookie will have
+ # a +max_age+ of 0 seconds, an +expires+ date in the past and an empty
+ # +value+. When used with the +set-cookie+ header, it will cause the client
+ # to *remove* any matching cookie.
+ #
+ # delete_set_cookie_header("myname")
+ # # => "myname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
+ #
+ # source://rack//lib/rack/utils.rb#362
+ def delete_set_cookie_header(key, value = T.unsafe(nil)); end
+
+ # :call-seq:
+ # delete_set_cookie_header!(header, key, value = {}) -> header value
+ #
+ # Set an expired cookie in the specified headers with the given cookie
+ # +key+ and +value+ using delete_set_cookie_header. This causes
+ # the client to immediately delete the specified cookie.
+ #
+ # delete_set_cookie_header!(nil, "mycookie")
+ # # => "mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
+ #
+ # If the header is non-nil, it will be modified in place.
+ #
+ # header = []
+ # delete_set_cookie_header!(header, "mycookie")
+ # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
+ # header
+ # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
+ #
+ # source://rack//lib/rack/utils.rb#390
+ def delete_set_cookie_header!(header, key, value = T.unsafe(nil)); end
# URI escapes. (CGI style space to +)
#
- # source://rack//lib/rack/utils.rb#38
+ # source://rack//lib/rack/utils.rb#39
def escape(s); end
+ # source://rack//lib/rack/utils.rb#261
+ def escape_cookie_key(key); end
+
# Escape ampersands, brackets and quotes to their HTML/XML entities.
- #
- # source://rack//lib/rack/utils.rb#184
- def escape_html(string); end
+ def escape_html(_arg0); end
# Like URI escaping, but with %20 instead of +. Strictly speaking this is
# true URI escaping.
#
- # source://rack//lib/rack/utils.rb#44
+ # source://rack//lib/rack/utils.rb#45
def escape_path(s); end
- # source://rack//lib/rack/utils.rb#357
- def get_byte_ranges(http_range, size); end
+ # source://rack//lib/rack/utils.rb#148
+ def forwarded_values(forwarded_header); end
- # source://rack//lib/rack/utils.rb#283
- def make_delete_cookie_header(header, key, value); end
+ # source://rack//lib/rack/utils.rb#412
+ def get_byte_ranges(http_range, size); end
- # source://rack//lib/rack/utils.rb#220
+ # :call-seq:
+ # parse_cookies(env) -> hash
+ #
+ # Parse cookies from the provided request environment using
+ # parse_cookies_header. Returns a map of cookie +key+ to cookie +value+.
+ #
+ # parse_cookies({'HTTP_COOKIE' => 'myname=myvalue'})
+ # # => {'myname' => 'myvalue'}
+ #
+ # source://rack//lib/rack/utils.rb#252
def parse_cookies(env); end
- # source://rack//lib/rack/utils.rb#224
- def parse_cookies_header(header); end
+ # :call-seq:
+ # parse_cookies_header(value) -> hash
+ #
+ # Parse cookies from the provided header +value+ according to RFC6265. The
+ # syntax for cookie headers only supports semicolons. Returns a map of
+ # cookie +key+ to cookie +value+.
+ #
+ # parse_cookies_header('myname=myvalue; max-age=0')
+ # # => {"myname"=>"myvalue", "max-age"=>"0"}
+ #
+ # source://rack//lib/rack/utils.rb#233
+ def parse_cookies_header(value); end
- # source://rack//lib/rack/utils.rb#112
+ # source://rack//lib/rack/utils.rb#105
def parse_nested_query(qs, d = T.unsafe(nil)); end
- # source://rack//lib/rack/utils.rb#108
+ # source://rack//lib/rack/utils.rb#101
def parse_query(qs, d = T.unsafe(nil), &unescaper); end
- # source://rack//lib/rack/utils.rb#144
+ # source://rack//lib/rack/utils.rb#137
def q_values(q_value_header); end
- # Modified version of stdlib time.rb Time#rfc2822 to use '%d-%b-%Y' instead
- # of '% %b %Y'.
- # It assumes that the time is in GMT to comply to the RFC 2109.
- #
- # NOTE: I'm not sure the RFC says it requires GMT, but is ambiguous enough
- # that I'm certain someone implemented only that option.
- # Do not use %a and %b from Time.strptime, it would use localized names for
- # weekday and month.
- #
- # source://rack//lib/rack/utils.rb#343
- def rfc2109(time); end
-
- # source://rack//lib/rack/utils.rb#330
+ # source://rack//lib/rack/utils.rb#401
def rfc2822(time); end
- # Constant time string comparison.
- #
- # NOTE: the values compared should be of fixed length, such as strings
- # that have already been processed by HMAC. This should not be used
- # on variable length plaintext strings because it could leak length info
- # via timing attacks.
+ # :nocov:
#
- # source://rack//lib/rack/utils.rb#395
+ # source://rack//lib/rack/utils.rb#454
def secure_compare(a, b); end
- # source://rack//lib/rack/utils.rb#188
+ # source://rack//lib/rack/utils.rb#191
def select_best_encoding(available_encodings, accept_encoding); end
- # source://rack//lib/rack/utils.rb#278
- def set_cookie_header!(header, key, value); end
+ # :call-seq:
+ # set_cookie_header(key, value) -> encoded string
+ #
+ # Generate an encoded string using the provided +key+ and +value+ suitable
+ # for the +set-cookie+ header according to RFC6265. The +value+ may be an
+ # instance of either +String+ or +Hash+.
+ #
+ # If the cookie +value+ is an instance of +Hash+, it considers the following
+ # cookie attribute keys: +domain+, +max_age+, +expires+ (must be instance
+ # of +Time+), +secure+, +http_only+, +same_site+ and +value+. For more
+ # details about the interpretation of these fields, consult
+ # [RFC6265 Section 5.2](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2).
+ #
+ # An extra cookie attribute +escape_key+ can be provided to control whether
+ # or not the cookie key is URL encoded. If explicitly set to +false+, the
+ # cookie key name will not be url encoded (escaped). The default is +true+.
+ #
+ # set_cookie_header("myname", "myvalue")
+ # # => "myname=myvalue"
+ #
+ # set_cookie_header("myname", {value: "myvalue", max_age: 10})
+ # # => "myname=myvalue; max-age=10"
+ #
+ # source://rack//lib/rack/utils.rb#293
+ def set_cookie_header(key, value); end
- # source://rack//lib/rack/utils.rb#599
+ # :call-seq:
+ # set_cookie_header!(headers, key, value) -> header value
+ #
+ # Append a cookie in the specified headers with the given cookie +key+ and
+ # +value+ using set_cookie_header.
+ #
+ # If the headers already contains a +set-cookie+ key, it will be converted
+ # to an +Array+ if not already, and appended to.
+ #
+ # source://rack//lib/rack/utils.rb#336
+ def set_cookie_header!(headers, key, value); end
+
+ # source://rack//lib/rack/utils.rb#588
def status_code(status); end
# Unescapes a URI escaped string with +encoding+. +encoding+ will be the
# target encoding of the string returned, and it defaults to UTF-8
#
- # source://rack//lib/rack/utils.rb#56
+ # source://rack//lib/rack/utils.rb#57
def unescape(s, encoding = T.unsafe(nil)); end
# Unescapes the **path** component of a URI. See Rack::Utils.unescape for
# unescaping query parameters or form components.
#
- # source://rack//lib/rack/utils.rb#50
+ # source://rack//lib/rack/utils.rb#51
def unescape_path(s); end
- # source://rack//lib/rack/utils.rb#626
+ # source://rack//lib/rack/utils.rb#625
def valid_path?(path); end
class << self
- # source://rack//lib/rack/utils.rb#237
- def add_cookie_to_header(header, key, value); end
-
- # Adds a cookie that will *remove* a cookie from the client. Hence the
- # strange method name.
- #
- # source://rack//lib/rack/utils.rb#320
- def add_remove_cookie_to_header(header, key, value = T.unsafe(nil)); end
-
# Return best accept value to use, based on the algorithm
# in RFC 2616 Section 14. If there are multiple best
# matches (same specificity and quality), the value returned
# is arbitrary.
#
- # source://rack//lib/rack/utils.rb#159
+ # source://rack//lib/rack/utils.rb#166
def best_q_match(q_value_header, available_mimes); end
- # source://rack//lib/rack/utils.rb#126
+ # source://rack//lib/rack/utils.rb#119
def build_nested_query(value, prefix = T.unsafe(nil)); end
- # source://rack//lib/rack/utils.rb#116
+ # source://rack//lib/rack/utils.rb#109
def build_query(params); end
# Parses the "Range:" header, if present, into an array of Range objects.
# Returns nil if the header is missing or syntactically invalid.
# Returns an empty array if none of the ranges are satisfiable.
#
- # source://rack//lib/rack/utils.rb#352
+ # source://rack//lib/rack/utils.rb#408
def byte_ranges(env, size); end
- # source://rack//lib/rack/utils.rb#609
+ # source://rack//lib/rack/utils.rb#608
def clean_path_info(path_info); end
- # source://rack//lib/rack/utils.rb#97
+ # source://rack//lib/rack/utils.rb#90
def clock_time; end
# Returns the value of attribute default_query_parser.
@@ -5294,150 +4604,217 @@ module Rack::Utils
# source://rack//lib/rack/utils.rb#29
def default_query_parser=(_arg0); end
- # source://rack//lib/rack/utils.rb#313
- def delete_cookie_header!(header, key, value = T.unsafe(nil)); end
+ # source://rack//lib/rack/utils.rb#366
+ def delete_cookie_header!(headers, key, value = T.unsafe(nil)); end
+
+ # :call-seq:
+ # delete_set_cookie_header(key, value = {}) -> encoded string
+ #
+ # Generate an encoded string based on the given +key+ and +value+ using
+ # set_cookie_header for the purpose of causing the specified cookie to be
+ # deleted. The +value+ may be an instance of +Hash+ and can include
+ # attributes as outlined by set_cookie_header. The encoded cookie will have
+ # a +max_age+ of 0 seconds, an +expires+ date in the past and an empty
+ # +value+. When used with the +set-cookie+ header, it will cause the client
+ # to *remove* any matching cookie.
+ #
+ # delete_set_cookie_header("myname")
+ # # => "myname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
+ #
+ # source://rack//lib/rack/utils.rb#362
+ def delete_set_cookie_header(key, value = T.unsafe(nil)); end
+
+ # :call-seq:
+ # delete_set_cookie_header!(header, key, value = {}) -> header value
+ #
+ # Set an expired cookie in the specified headers with the given cookie
+ # +key+ and +value+ using delete_set_cookie_header. This causes
+ # the client to immediately delete the specified cookie.
+ #
+ # delete_set_cookie_header!(nil, "mycookie")
+ # # => "mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
+ #
+ # If the header is non-nil, it will be modified in place.
+ #
+ # header = []
+ # delete_set_cookie_header!(header, "mycookie")
+ # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
+ # header
+ # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
+ #
+ # source://rack//lib/rack/utils.rb#390
+ def delete_set_cookie_header!(header, key, value = T.unsafe(nil)); end
# URI escapes. (CGI style space to +)
#
- # source://rack//lib/rack/utils.rb#38
+ # source://rack//lib/rack/utils.rb#39
def escape(s); end
- # Escape ampersands, brackets and quotes to their HTML/XML entities.
- #
- # source://rack//lib/rack/utils.rb#184
- def escape_html(string); end
+ # source://rack//lib/rack/utils.rb#261
+ def escape_cookie_key(key); end
+
+ def escape_html(_arg0); end
# Like URI escaping, but with %20 instead of +. Strictly speaking this is
# true URI escaping.
#
- # source://rack//lib/rack/utils.rb#44
+ # source://rack//lib/rack/utils.rb#45
def escape_path(s); end
- # source://rack//lib/rack/utils.rb#357
- def get_byte_ranges(http_range, size); end
-
- # source://rack//lib/rack/utils.rb#88
- def key_space_limit; end
-
- # source://rack//lib/rack/utils.rb#92
- def key_space_limit=(v); end
+ # source://rack//lib/rack/utils.rb#148
+ def forwarded_values(forwarded_header); end
- # source://rack//lib/rack/utils.rb#283
- def make_delete_cookie_header(header, key, value); end
+ # source://rack//lib/rack/utils.rb#412
+ def get_byte_ranges(http_range, size); end
# Returns the value of attribute multipart_file_limit.
#
- # source://rack//lib/rack/utils.rb#63
+ # source://rack//lib/rack/utils.rb#64
def multipart_file_limit; end
# Sets the attribute multipart_file_limit
#
# @param value the value to set the attribute multipart_file_limit to.
#
- # source://rack//lib/rack/utils.rb#63
+ # source://rack//lib/rack/utils.rb#64
def multipart_file_limit=(_arg0); end
# Returns the value of attribute multipart_file_limit.
# multipart_part_limit is the original name of multipart_file_limit, but
# the limit only counts parts with filenames.
#
- # source://rack//lib/rack/utils.rb#63
+ # source://rack//lib/rack/utils.rb#64
def multipart_part_limit; end
# Sets the attribute multipart_file_limit
#
# @param value the value to set the attribute multipart_file_limit to.
#
- # source://rack//lib/rack/utils.rb#63
+ # source://rack//lib/rack/utils.rb#64
def multipart_part_limit=(_arg0); end
# Returns the value of attribute multipart_total_part_limit.
#
- # source://rack//lib/rack/utils.rb#61
+ # source://rack//lib/rack/utils.rb#62
def multipart_total_part_limit; end
# Sets the attribute multipart_total_part_limit
#
# @param value the value to set the attribute multipart_total_part_limit to.
#
- # source://rack//lib/rack/utils.rb#61
+ # source://rack//lib/rack/utils.rb#62
def multipart_total_part_limit=(_arg0); end
- # source://rack//lib/rack/utils.rb#80
+ # source://rack//lib/rack/utils.rb#81
def param_depth_limit; end
- # source://rack//lib/rack/utils.rb#84
+ # source://rack//lib/rack/utils.rb#85
def param_depth_limit=(v); end
- # source://rack//lib/rack/utils.rb#220
+ # :call-seq:
+ # parse_cookies(env) -> hash
+ #
+ # Parse cookies from the provided request environment using
+ # parse_cookies_header. Returns a map of cookie +key+ to cookie +value+.
+ #
+ # parse_cookies({'HTTP_COOKIE' => 'myname=myvalue'})
+ # # => {'myname' => 'myvalue'}
+ #
+ # source://rack//lib/rack/utils.rb#252
def parse_cookies(env); end
- # source://rack//lib/rack/utils.rb#224
- def parse_cookies_header(header); end
+ # :call-seq:
+ # parse_cookies_header(value) -> hash
+ #
+ # Parse cookies from the provided header +value+ according to RFC6265. The
+ # syntax for cookie headers only supports semicolons. Returns a map of
+ # cookie +key+ to cookie +value+.
+ #
+ # parse_cookies_header('myname=myvalue; max-age=0')
+ # # => {"myname"=>"myvalue", "max-age"=>"0"}
+ #
+ # source://rack//lib/rack/utils.rb#233
+ def parse_cookies_header(value); end
- # source://rack//lib/rack/utils.rb#112
+ # source://rack//lib/rack/utils.rb#105
def parse_nested_query(qs, d = T.unsafe(nil)); end
- # source://rack//lib/rack/utils.rb#108
+ # source://rack//lib/rack/utils.rb#101
def parse_query(qs, d = T.unsafe(nil), &unescaper); end
- # source://rack//lib/rack/utils.rb#144
+ # source://rack//lib/rack/utils.rb#137
def q_values(q_value_header); end
- # Modified version of stdlib time.rb Time#rfc2822 to use '%d-%b-%Y' instead
- # of '% %b %Y'.
- # It assumes that the time is in GMT to comply to the RFC 2109.
- #
- # NOTE: I'm not sure the RFC says it requires GMT, but is ambiguous enough
- # that I'm certain someone implemented only that option.
- # Do not use %a and %b from Time.strptime, it would use localized names for
- # weekday and month.
- #
- # source://rack//lib/rack/utils.rb#343
- def rfc2109(time); end
-
- # source://rack//lib/rack/utils.rb#330
+ # source://rack//lib/rack/utils.rb#401
def rfc2822(time); end
- # Constant time string comparison.
- #
- # NOTE: the values compared should be of fixed length, such as strings
- # that have already been processed by HMAC. This should not be used
- # on variable length plaintext strings because it could leak length info
- # via timing attacks.
- #
- # source://rack//lib/rack/utils.rb#395
+ # source://rack//lib/rack/utils.rb#454
def secure_compare(a, b); end
- # source://rack//lib/rack/utils.rb#188
+ # source://rack//lib/rack/utils.rb#191
def select_best_encoding(available_encodings, accept_encoding); end
- # source://rack//lib/rack/utils.rb#278
- def set_cookie_header!(header, key, value); end
+ # :call-seq:
+ # set_cookie_header(key, value) -> encoded string
+ #
+ # Generate an encoded string using the provided +key+ and +value+ suitable
+ # for the +set-cookie+ header according to RFC6265. The +value+ may be an
+ # instance of either +String+ or +Hash+.
+ #
+ # If the cookie +value+ is an instance of +Hash+, it considers the following
+ # cookie attribute keys: +domain+, +max_age+, +expires+ (must be instance
+ # of +Time+), +secure+, +http_only+, +same_site+ and +value+. For more
+ # details about the interpretation of these fields, consult
+ # [RFC6265 Section 5.2](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2).
+ #
+ # An extra cookie attribute +escape_key+ can be provided to control whether
+ # or not the cookie key is URL encoded. If explicitly set to +false+, the
+ # cookie key name will not be url encoded (escaped). The default is +true+.
+ #
+ # set_cookie_header("myname", "myvalue")
+ # # => "myname=myvalue"
+ #
+ # set_cookie_header("myname", {value: "myvalue", max_age: 10})
+ # # => "myname=myvalue; max-age=10"
+ #
+ # source://rack//lib/rack/utils.rb#293
+ def set_cookie_header(key, value); end
+
+ # :call-seq:
+ # set_cookie_header!(headers, key, value) -> header value
+ #
+ # Append a cookie in the specified headers with the given cookie +key+ and
+ # +value+ using set_cookie_header.
+ #
+ # If the headers already contains a +set-cookie+ key, it will be converted
+ # to an +Array+ if not already, and appended to.
+ #
+ # source://rack//lib/rack/utils.rb#336
+ def set_cookie_header!(headers, key, value); end
- # source://rack//lib/rack/utils.rb#599
+ # source://rack//lib/rack/utils.rb#588
def status_code(status); end
# Unescapes a URI escaped string with +encoding+. +encoding+ will be the
# target encoding of the string returned, and it defaults to UTF-8
#
- # source://rack//lib/rack/utils.rb#56
+ # source://rack//lib/rack/utils.rb#57
def unescape(s, encoding = T.unsafe(nil)); end
# Unescapes the **path** component of a URI. See Rack::Utils.unescape for
# unescaping query parameters or form components.
#
- # source://rack//lib/rack/utils.rb#50
+ # source://rack//lib/rack/utils.rb#51
def unescape_path(s); end
# @return [Boolean]
#
- # source://rack//lib/rack/utils.rb#626
+ # source://rack//lib/rack/utils.rb#625
def valid_path?(path); end
end
end
-# source://rack//lib/rack/utils.rb#22
+# source://rack//lib/rack/utils.rb#25
Rack::Utils::COMMON_SEP = T.let(T.unsafe(nil), Hash)
# Context allows the use of a compatible middleware at different points
@@ -5446,189 +4823,80 @@ Rack::Utils::COMMON_SEP = T.let(T.unsafe(nil), Hash)
# would be the request environment. The second of which would be the rack
# application that the request would be forwarded to.
#
-# source://rack//lib/rack/utils.rb#410
+# source://rack//lib/rack/utils.rb#477
class Rack::Utils::Context
# @return [Context] a new instance of Context
#
- # source://rack//lib/rack/utils.rb#413
+ # source://rack//lib/rack/utils.rb#480
def initialize(app_f, app_r); end
# Returns the value of attribute app.
#
- # source://rack//lib/rack/utils.rb#411
+ # source://rack//lib/rack/utils.rb#478
def app; end
- # source://rack//lib/rack/utils.rb#418
+ # source://rack//lib/rack/utils.rb#485
def call(env); end
- # source://rack//lib/rack/utils.rb#426
+ # source://rack//lib/rack/utils.rb#493
def context(env, app = T.unsafe(nil)); end
# Returns the value of attribute for.
#
- # source://rack//lib/rack/utils.rb#411
+ # source://rack//lib/rack/utils.rb#478
def for; end
- # source://rack//lib/rack/utils.rb#422
+ # source://rack//lib/rack/utils.rb#489
def recontext(app); end
end
-# source://rack//lib/rack/utils.rb#21
+# source://rack//lib/rack/utils.rb#24
Rack::Utils::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp)
-# source://rack//lib/rack/utils.rb#172
-Rack::Utils::ESCAPE_HTML = T.let(T.unsafe(nil), Hash)
-
-# source://rack//lib/rack/utils.rb#181
-Rack::Utils::ESCAPE_HTML_PATTERN = T.let(T.unsafe(nil), Regexp)
-
# Every standard HTTP code mapped to the appropriate message.
# Generated with:
-# curl -s https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv | \
-# ruby -ne 'm = /^(\d{3}),(?!Unassigned|\(Unused\))([^,]+)/.match($_) and \
-# puts "#{m[1]} => \x27#{m[2].strip}\x27,"'
+# curl -s https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv \
+# | ruby -rcsv -e "puts CSV.parse(STDIN, headers: true) \
+# .reject {|v| v['Description'] == 'Unassigned' or v['Description'].include? '(' } \
+# .map {|v| %Q/#{v['Value']} => '#{v['Description']}'/ }.join(','+?\n)"
#
-# source://rack//lib/rack/utils.rb#526
+# source://rack//lib/rack/utils.rb#504
Rack::Utils::HTTP_STATUS_CODES = T.let(T.unsafe(nil), Hash)
-# A case-insensitive Hash that preserves the original case of a
-# header when set.
-#
-# @api private
-#
-# source://rack//lib/rack/utils.rb#435
-class Rack::Utils::HeaderHash < ::Hash
- # @api private
- # @return [HeaderHash] a new instance of HeaderHash
- #
- # source://rack//lib/rack/utils.rb#444
- def initialize(hash = T.unsafe(nil)); end
-
- # @api private
- #
- # source://rack//lib/rack/utils.rb#474
- def [](k); end
-
- # @api private
- #
- # source://rack//lib/rack/utils.rb#478
- def []=(k, v); end
-
- # on clear, we need to clear @names hash
- #
- # @api private
- #
- # source://rack//lib/rack/utils.rb#457
- def clear; end
-
- # @api private
- #
- # source://rack//lib/rack/utils.rb#485
- def delete(k); end
-
- # @api private
- #
- # source://rack//lib/rack/utils.rb#462
- def each; end
-
- # @api private
- # @return [Boolean]
- #
- # source://rack//lib/rack/utils.rb#491
- def has_key?(k); end
-
- # @api private
- # @return [Boolean]
- #
- # source://rack//lib/rack/utils.rb#491
- def include?(k); end
-
- # @api private
- # @return [Boolean]
- #
- # source://rack//lib/rack/utils.rb#491
- def key?(k); end
-
- # @api private
- # @return [Boolean]
- #
- # source://rack//lib/rack/utils.rb#491
- def member?(k); end
-
- # @api private
- #
- # source://rack//lib/rack/utils.rb#504
- def merge(other); end
-
- # @api private
- #
- # source://rack//lib/rack/utils.rb#499
- def merge!(other); end
-
- # @api private
- #
- # source://rack//lib/rack/utils.rb#509
- def replace(other); end
-
- # @api private
- #
- # source://rack//lib/rack/utils.rb#468
- def to_hash; end
-
- protected
-
- # @api private
- #
- # source://rack//lib/rack/utils.rb#516
- def names; end
-
- private
-
- # on dup/clone, we need to duplicate @names hash
- #
- # @api private
- #
- # source://rack//lib/rack/utils.rb#451
- def initialize_copy(other); end
-
- class << self
- # @api private
- #
- # source://rack//lib/rack/utils.rb#436
- def [](headers); end
- end
-end
-
-# source://rack//lib/rack/utils.rb#20
+# source://rack//lib/rack/utils.rb#22
Rack::Utils::InvalidParameterError = Rack::QueryParser::InvalidParameterError
-# source://rack//lib/rack/utils.rb#23
+# source://rack//lib/rack/utils.rb#26
Rack::Utils::KeySpaceConstrainedParams = Rack::QueryParser::Params
-# source://rack//lib/rack/utils.rb#624
+# source://rack//lib/rack/utils.rb#623
Rack::Utils::NULL_BYTE = T.let(T.unsafe(nil), String)
-# source://rack//lib/rack/utils.rb#607
+# source://rack//lib/rack/utils.rb#574
+Rack::Utils::OBSOLETE_SYMBOLS_TO_STATUS_CODES = T.let(T.unsafe(nil), Hash)
+
+# source://rack//lib/rack/utils.rb#582
+Rack::Utils::OBSOLETE_SYMBOL_MAPPINGS = T.let(T.unsafe(nil), Hash)
+
+# source://rack//lib/rack/utils.rb#606
Rack::Utils::PATH_SEPS = T.let(T.unsafe(nil), Regexp)
-# source://rack//lib/rack/utils.rb#19
+# source://rack//lib/rack/utils.rb#21
Rack::Utils::ParameterTypeError = Rack::QueryParser::ParameterTypeError
-# source://rack//lib/rack/utils.rb#25
-Rack::Utils::RFC2822_DAY_NAME = T.let(T.unsafe(nil), Array)
-
-# source://rack//lib/rack/utils.rb#26
-Rack::Utils::RFC2822_MONTH_NAME = T.let(T.unsafe(nil), Array)
+# source://rack//lib/rack/utils.rb#23
+Rack::Utils::ParamsTooDeepError = Rack::QueryParser::ParamsTooDeepError
# Responses with HTTP status codes that should not have an entity body
#
-# source://rack//lib/rack/utils.rb#593
+# source://rack//lib/rack/utils.rb#568
Rack::Utils::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash)
-# source://rack//lib/rack/utils.rb#595
+# source://rack//lib/rack/utils.rb#570
Rack::Utils::SYMBOL_TO_STATUS_CODE = T.let(T.unsafe(nil), Hash)
-# The Rack protocol version number implemented.
+# A valid cookie key according to RFC2616.
+# A can be any US-ASCII characters, except control characters, spaces, or tabs. It also must not contain a separator character like the following: ( ) < > @ , ; : \ " / [ ] ? = { }.
#
-# source://rack//lib/rack/version.rb#16
-Rack::VERSION = T.let(T.unsafe(nil), Array)
+# source://rack//lib/rack/utils.rb#258
+Rack::Utils::VALID_COOKIE_KEY = T.let(T.unsafe(nil), Regexp)
diff --git a/sorbet/rbi/gems/rackup@1.0.0.rbi b/sorbet/rbi/gems/rackup@1.0.0.rbi
deleted file mode 100644
index f556867b0..000000000
--- a/sorbet/rbi/gems/rackup@1.0.0.rbi
+++ /dev/null
@@ -1,9 +0,0 @@
-# typed: true
-
-# DO NOT EDIT MANUALLY
-# This is an autogenerated file for types exported from the `rackup` gem.
-# Please instead update this file by running `bin/tapioca gem rackup`.
-
-
-# THIS IS AN EMPTY RBI FILE.
-# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
diff --git a/sorbet/rbi/gems/rackup@2.1.0.rbi b/sorbet/rbi/gems/rackup@2.1.0.rbi
new file mode 100644
index 000000000..6195ce7a4
--- /dev/null
+++ b/sorbet/rbi/gems/rackup@2.1.0.rbi
@@ -0,0 +1,390 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `rackup` gem.
+# Please instead update this file by running `bin/tapioca gem rackup`.
+
+
+# source://rackup//lib/rackup/handler.rb#6
+module Rackup; end
+
+# *Handlers* connect web servers with Rack.
+#
+# Rackup includes Handlers for WEBrick and CGI.
+#
+# Handlers usually are activated by calling MyHandler.run(myapp).
+# A second optional hash can be passed to include server-specific
+# configuration.
+#
+# source://rackup//lib/rackup/handler.rb#14
+module Rackup::Handler
+ class << self
+ # source://rackup//lib/rackup/handler.rb#30
+ def [](name); end
+
+ # source://rackup//lib/rackup/handler.rb#84
+ def default; end
+
+ # source://rackup//lib/rackup/handler.rb#40
+ def get(name); end
+
+ # Select first available Rack handler given an `Array` of server names.
+ # Raises `LoadError` if no handler was found.
+ #
+ # > pick ['puma', 'webrick']
+ # => Rackup::Handler::WEBrick
+ #
+ # @raise [LoadError]
+ #
+ # source://rackup//lib/rackup/handler.rb#69
+ def pick(server_names); end
+
+ # Register a named handler class.
+ #
+ # source://rackup//lib/rackup/handler.rb#18
+ def register(name, klass); end
+
+ # Transforms server-name constants to their canonical form as filenames,
+ # then tries to require them but silences the LoadError if not found
+ #
+ # Naming convention:
+ #
+ # Foo # => 'foo'
+ # FooBar # => 'foo_bar.rb'
+ # FooBAR # => 'foobar.rb'
+ # FOObar # => 'foobar.rb'
+ # FOOBAR # => 'foobar.rb'
+ # FooBarBaz # => 'foo_bar_baz.rb'
+ #
+ # source://rackup//lib/rackup/handler.rb#106
+ def require_handler(prefix, const_name); end
+ end
+end
+
+# source://rackup//lib/rackup/handler/cgi.rb#8
+class Rackup::Handler::CGI
+ include ::Rack
+
+ class << self
+ # source://rackup//lib/rackup/handler/cgi.rb#11
+ def run(app, **options); end
+
+ # source://rackup//lib/rackup/handler/cgi.rb#51
+ def send_body(body); end
+
+ # source://rackup//lib/rackup/handler/cgi.rb#40
+ def send_headers(status, headers); end
+
+ # source://rackup//lib/rackup/handler/cgi.rb#16
+ def serve(app); end
+ end
+end
+
+# source://rackup//lib/rackup/handler.rb#59
+Rackup::Handler::RACKUP_HANDLER = T.let(T.unsafe(nil), String)
+
+# source://rackup//lib/rackup/handler.rb#58
+Rackup::Handler::RACK_HANDLER = T.let(T.unsafe(nil), String)
+
+# source://rackup//lib/rackup/handler.rb#61
+Rackup::Handler::SERVER_NAMES = T.let(T.unsafe(nil), Array)
+
+# source://rackup//lib/rackup/handler/webrick.rb#18
+class Rackup::Handler::WEBrick < ::WEBrick::HTTPServlet::AbstractServlet
+ # @return [WEBrick] a new instance of WEBrick
+ #
+ # source://rackup//lib/rackup/handler/webrick.rb#54
+ def initialize(server, app); end
+
+ # source://rackup//lib/rackup/handler/webrick.rb#91
+ def service(req, res); end
+
+ class << self
+ # @yield [@server]
+ #
+ # source://rackup//lib/rackup/handler/webrick.rb#19
+ def run(app, **options); end
+
+ # source://rackup//lib/rackup/handler/webrick.rb#47
+ def shutdown; end
+
+ # source://rackup//lib/rackup/handler/webrick.rb#37
+ def valid_options; end
+ end
+end
+
+# This handles mapping the WEBrick request to a Rack input stream.
+#
+# source://rackup//lib/rackup/handler/webrick.rb#60
+class Rackup::Handler::WEBrick::Input
+ include ::Rackup::Stream::Reader
+
+ # @return [Input] a new instance of Input
+ #
+ # source://rackup//lib/rackup/handler/webrick.rb#63
+ def initialize(request); end
+
+ # source://rackup//lib/rackup/handler/webrick.rb#78
+ def close; end
+
+ private
+
+ # Read one chunk from the request body.
+ #
+ # source://rackup//lib/rackup/handler/webrick.rb#86
+ def read_next; end
+end
+
+# source://rackup//lib/rackup/server.rb#22
+class Rackup::Server
+ # Options may include:
+ # * :app
+ # a rack application to run (overrides :config and :builder)
+ # * :builder
+ # a string to evaluate a Rack::Builder from
+ # * :config
+ # a rackup configuration file path to load (.ru)
+ # * :environment
+ # this selects the middleware that will be wrapped around
+ # your application. Default options available are:
+ # - development: CommonLogger, ShowExceptions, and Lint
+ # - deployment: CommonLogger
+ # - none: no extra middleware
+ # note: when the server is a cgi server, CommonLogger is not included.
+ # * :server
+ # choose a specific Rackup::Handler, e.g. cgi, fcgi, webrick
+ # * :daemonize
+ # if truthy, the server will daemonize itself (fork, detach, etc)
+ # if :noclose, the server will not close STDOUT/STDERR
+ # * :pid
+ # path to write a pid file after daemonize
+ # * :Host
+ # the host address to bind to (used by supporting Rackup::Handler)
+ # * :Port
+ # the port to bind to (used by supporting Rackup::Handler)
+ # * :AccessLog
+ # webrick access log options (or supporting Rackup::Handler)
+ # * :debug
+ # turn on debug output ($DEBUG = true)
+ # * :warn
+ # turn on warnings ($-w = true)
+ # * :include
+ # add given paths to $LOAD_PATH
+ # * :require
+ # require the given libraries
+ #
+ # Additional options for profiling app initialization include:
+ # * :heapfile
+ # location for ObjectSpace.dump_all to write the output to
+ # * :profile_file
+ # location for CPU/Memory (StackProf) profile output (defaults to a tempfile)
+ # * :profile_mode
+ # StackProf profile mode (cpu|wall|object)
+ #
+ # @return [Server] a new instance of Server
+ #
+ # source://rackup//lib/rackup/server.rb#230
+ def initialize(options = T.unsafe(nil)); end
+
+ # source://rackup//lib/rackup/server.rb#262
+ def app; end
+
+ # source://rackup//lib/rackup/server.rb#248
+ def default_options; end
+
+ # source://rackup//lib/rackup/server.rb#296
+ def middleware; end
+
+ # source://rackup//lib/rackup/server.rb#243
+ def options; end
+
+ # Sets the attribute options
+ #
+ # @param value the value to set the attribute options to.
+ #
+ # source://rackup//lib/rackup/server.rb#185
+ def options=(_arg0); end
+
+ # source://rackup//lib/rackup/server.rb#344
+ def server; end
+
+ # source://rackup//lib/rackup/server.rb#300
+ def start(&block); end
+
+ private
+
+ # source://rackup//lib/rackup/server.rb#413
+ def build_app(app); end
+
+ # source://rackup//lib/rackup/server.rb#349
+ def build_app_and_options_from_config; end
+
+ # source://rackup//lib/rackup/server.rb#395
+ def build_app_from_string; end
+
+ # source://rackup//lib/rackup/server.rb#442
+ def check_pid!; end
+
+ # source://rackup//lib/rackup/server.rb#427
+ def daemonize_app; end
+
+ # source://rackup//lib/rackup/server.rb#456
+ def exit_with_pid(pid); end
+
+ # source://rackup//lib/rackup/server.rb#357
+ def handle_profiling(heapfile, profile_mode, filename); end
+
+ # source://rackup//lib/rackup/server.rb#385
+ def make_profile_name(filename); end
+
+ # source://rackup//lib/rackup/server.rb#409
+ def opt_parser; end
+
+ # source://rackup//lib/rackup/server.rb#399
+ def parse_options(args); end
+
+ # source://rackup//lib/rackup/server.rb#423
+ def wrapped_app; end
+
+ # source://rackup//lib/rackup/server.rb#434
+ def write_pid; end
+
+ class << self
+ # source://rackup//lib/rackup/server.rb#273
+ def default_middleware_by_environment; end
+
+ # source://rackup//lib/rackup/server.rb#267
+ def logging_middleware; end
+
+ # source://rackup//lib/rackup/server.rb#291
+ def middleware; end
+
+ # Start a new rack server (like running rackup). This will parse ARGV and
+ # provide standard ARGV rackup options, defaulting to load 'config.ru'.
+ #
+ # Providing an options hash will prevent ARGV parsing and will not include
+ # any default options.
+ #
+ # This method can be used to very easily launch a CGI application, for
+ # example:
+ #
+ # Rack::Server.start(
+ # :app => lambda do |e|
+ # [200, {'content-type' => 'text/html'}, ['hello world']]
+ # end,
+ # :server => 'cgi'
+ # )
+ #
+ # Further options available here are documented on Rack::Server#initialize
+ #
+ # source://rackup//lib/rackup/server.rb#181
+ def start(options = T.unsafe(nil)); end
+ end
+end
+
+# source://rackup//lib/rackup/server.rb#23
+class Rackup::Server::Options
+ # source://rackup//lib/rackup/server.rb#143
+ def handler_opts(options); end
+
+ # source://rackup//lib/rackup/server.rb#24
+ def parse!(args); end
+end
+
+# The input stream is an IO-like object which contains the raw HTTP POST data. When applicable, its external encoding must be “ASCII-8BIT” and it must be opened in binary mode, for Ruby 1.9 compatibility. The input stream must respond to gets, each, read and rewind.
+#
+# source://rackup//lib/rackup/stream.rb#8
+class Rackup::Stream
+ include ::Rackup::Stream::Reader
+
+ # @raise [ArgumentError]
+ # @return [Stream] a new instance of Stream
+ #
+ # source://rackup//lib/rackup/stream.rb#9
+ def initialize(input = T.unsafe(nil), output = T.unsafe(nil)); end
+
+ # source://rackup//lib/rackup/stream.rb#147
+ def <<(buffer); end
+
+ # Close the input and output bodies.
+ #
+ # source://rackup//lib/rackup/stream.rb#169
+ def close(error = T.unsafe(nil)); end
+
+ # source://rackup//lib/rackup/stream.rb#154
+ def close_read; end
+
+ # close must never be called on the input stream. huh?
+ #
+ # source://rackup//lib/rackup/stream.rb#160
+ def close_write; end
+
+ # Whether the stream has been closed.
+ #
+ # @return [Boolean]
+ #
+ # source://rackup//lib/rackup/stream.rb#179
+ def closed?; end
+
+ # Whether there are any output chunks remaining?
+ #
+ # @return [Boolean]
+ #
+ # source://rackup//lib/rackup/stream.rb#184
+ def empty?; end
+
+ # source://rackup//lib/rackup/stream.rb#151
+ def flush; end
+
+ # Returns the value of attribute input.
+ #
+ # source://rackup//lib/rackup/stream.rb#20
+ def input; end
+
+ # Returns the value of attribute output.
+ #
+ # source://rackup//lib/rackup/stream.rb#21
+ def output; end
+
+ # source://rackup//lib/rackup/stream.rb#134
+ def write(buffer); end
+
+ # source://rackup//lib/rackup/stream.rb#143
+ def write_nonblock(buffer); end
+
+ private
+
+ # source://rackup//lib/rackup/stream.rb#190
+ def read_next; end
+end
+
+# This provides a read-only interface for data, which is surprisingly tricky to implement correctly.
+#
+# source://rackup//lib/rackup/stream.rb#24
+module Rackup::Stream::Reader
+ # source://rackup//lib/rackup/stream.rb#99
+ def each; end
+
+ # source://rackup//lib/rackup/stream.rb#95
+ def gets; end
+
+ # read behaves like IO#read. Its signature is read([length, [buffer]]). If given, length must be a non-negative Integer (>= 0) or nil, and buffer must be a String and may not be nil. If length is given and not nil, then this method reads at most length bytes from the input stream. If length is not given or nil, then this method reads all data until EOF. When EOF is reached, this method returns nil if length is given and not nil, or “” if length is not given or is nil. If buffer is given, then the read data will be placed into buffer instead of a newly created String object.
+ #
+ # @param length [Integer] the amount of data to read
+ # @param buffer [String] the buffer which will receive the data
+ # @return a buffer containing the data
+ #
+ # source://rackup//lib/rackup/stream.rb#32
+ def read(length = T.unsafe(nil), buffer = T.unsafe(nil)); end
+
+ # source://rackup//lib/rackup/stream.rb#105
+ def read_nonblock(length, buffer = T.unsafe(nil)); end
+
+ # Read at most `length` bytes from the stream. Will avoid reading from the underlying stream if possible.
+ #
+ # source://rackup//lib/rackup/stream.rb#74
+ def read_partial(length = T.unsafe(nil)); end
+end
+
+# source://rackup//lib/rackup/version.rb#7
+Rackup::VERSION = T.let(T.unsafe(nil), String)
diff --git a/sorbet/rbi/gems/redis-client@0.22.2.rbi b/sorbet/rbi/gems/redis-client@0.22.2.rbi
new file mode 100644
index 000000000..c02e88f13
--- /dev/null
+++ b/sorbet/rbi/gems/redis-client@0.22.2.rbi
@@ -0,0 +1,1360 @@
+# typed: true
+
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `redis-client` gem.
+# Please instead update this file by running `bin/tapioca gem redis-client`.
+
+
+module Process
+ extend ::Dalli::PIDCache::CoreExt
+ extend ::ConnectionPool::ForkTracker
+ extend ::RedisClient::PIDCache::CoreExt
+ extend ::ActiveSupport::ForkTracker::ModernCoreExt
+end
+
+# source://redis-client//lib/redis_client/version.rb#3
+class RedisClient
+ include ::RedisClient::Common
+
+ # @return [RedisClient] a new instance of RedisClient
+ #
+ # source://redis-client//lib/redis_client.rb#188
+ def initialize(config, **_arg1); end
+
+ # source://redis-client//lib/redis_client.rb#335
+ def blocking_call(timeout, *command, **kwargs); end
+
+ # source://redis-client//lib/redis_client.rb#355
+ def blocking_call_v(timeout, command); end
+
+ # source://redis-client//lib/redis_client.rb#275
+ def call(*command, **kwargs); end
+
+ # source://redis-client//lib/redis_client.rb#305
+ def call_once(*command, **kwargs); end
+
+ # source://redis-client//lib/redis_client.rb#320
+ def call_once_v(command); end
+
+ # source://redis-client//lib/redis_client.rb#290
+ def call_v(command); end
+
+ # source://redis-client//lib/redis_client.rb#415
+ def close; end
+
+ # @return [Boolean]
+ #
+ # source://redis-client//lib/redis_client.rb#411
+ def connected?; end
+
+ # source://redis-client//lib/redis_client.rb#212
+ def db; end
+
+ # source://redis-client//lib/redis_client.rb#420
+ def disable_reconnection(&block); end
+
+ # source://redis-client//lib/redis_client.rb#216
+ def host; end
+
+ # source://redis-client//lib/redis_client.rb#393
+ def hscan(key, *args, **kwargs, &block); end
+
+ # source://redis-client//lib/redis_client.rb#204
+ def id; end
+
+ # source://redis-client//lib/redis_client.rb#195
+ def inspect; end
+
+ # source://redis-client//lib/redis_client.rb#267
+ def measure_round_trip_delay; end
+
+ # source://redis-client//lib/redis_client.rb#442
+ def multi(watch: T.unsafe(nil), &block); end
+
+ # source://redis-client//lib/redis_client.rb#232
+ def password; end
+
+ # source://redis-client//lib/redis_client.rb#224
+ def path; end
+
+ # @yield [pipeline]
+ #
+ # source://redis-client//lib/redis_client.rb#424
+ def pipelined(exception: T.unsafe(nil)); end
+
+ # source://redis-client//lib/redis_client.rb#220
+ def port; end
+
+ # source://redis-client//lib/redis_client.rb#261
+ def pubsub; end
+
+ # source://redis-client//lib/redis_client.rb#251
+ def read_timeout=(timeout); end
+
+ # source://redis-client//lib/redis_client.rb#375
+ def scan(*args, **kwargs, &block); end
+
+ # source://redis-client//lib/redis_client.rb#200
+ def server_url; end
+
+ # source://redis-client//lib/redis_client.rb#236
+ def size; end
+
+ # source://redis-client//lib/redis_client.rb#384
+ def sscan(key, *args, **kwargs, &block); end
+
+ # @yield [_self]
+ # @yieldparam _self [RedisClient] the object that the method was called on
+ #
+ # source://redis-client//lib/redis_client.rb#240
+ def then(_options = T.unsafe(nil)); end
+
+ # source://redis-client//lib/redis_client.rb#208
+ def timeout; end
+
+ # source://redis-client//lib/redis_client.rb#245
+ def timeout=(timeout); end
+
+ # source://redis-client//lib/redis_client.rb#228
+ def username; end
+
+ # @yield [_self]
+ # @yieldparam _self [RedisClient] the object that the method was called on
+ #
+ # source://redis-client//lib/redis_client.rb#240
+ def with(_options = T.unsafe(nil)); end
+
+ # source://redis-client//lib/redis_client.rb#256
+ def write_timeout=(timeout); end
+
+ # source://redis-client//lib/redis_client.rb#402
+ def zscan(key, *args, **kwargs, &block); end
+
+ private
+
+ # @yield [transaction]
+ #
+ # source://redis-client//lib/redis_client.rb#649
+ def build_transaction; end
+
+ # source://redis-client//lib/redis_client.rb#737
+ def connect; end
+
+ # source://redis-client//lib/redis_client.rb#683
+ def ensure_connected(retryable: T.unsafe(nil)); end
+
+ # source://redis-client//lib/redis_client.rb#730
+ def raw_connection; end
+
+ # source://redis-client//lib/redis_client.rb#657
+ def scan_list(cursor_index, command, &block); end
+
+ # source://redis-client//lib/redis_client.rb#667
+ def scan_pairs(cursor_index, command); end
+
+ class << self
+ # source://redis-client//lib/redis_client.rb#165
+ def config(**kwargs); end
+
+ # source://redis-client//lib/redis_client.rb#33
+ def default_driver; end
+
+ # source://redis-client//lib/redis_client.rb#45
+ def default_driver=(name); end
+
+ # source://redis-client//lib/redis_client.rb#22
+ def driver(name); end
+
+ # source://redis-client//lib/redis_client.rb#173
+ def new(arg = T.unsafe(nil), **kwargs); end
+
+ # source://redis-client//lib/redis_client.rb#181
+ def register(middleware); end
+
+ # source://redis-client//lib/redis_client.rb#18
+ def register_driver(name, &block); end
+
+ # source://redis-client//lib/redis_client.rb#169
+ def sentinel(**kwargs); end
+ end
+end
+
+# source://redis-client//lib/redis_client.rb#144
+class RedisClient::AuthenticationError < ::RedisClient::CommandError; end
+
+# source://redis-client//lib/redis_client/middlewares.rb#4
+class RedisClient::BasicMiddleware
+ # @return [BasicMiddleware] a new instance of BasicMiddleware
+ #
+ # source://redis-client//lib/redis_client/middlewares.rb#7
+ def initialize(client); end
+
+ # @yield [command]
+ #
+ # source://redis-client//lib/redis_client/middlewares.rb#15
+ def call(command, _config); end
+
+ # @yield [command]
+ #
+ # source://redis-client//lib/redis_client/middlewares.rb#15
+ def call_pipelined(command, _config); end
+
+ # Returns the value of attribute client.
+ #
+ # source://redis-client//lib/redis_client/middlewares.rb#5
+ def client; end
+
+ # source://redis-client//lib/redis_client/middlewares.rb#11
+ def connect(_config); end
+end
+
+# source://redis-client//lib/redis_client.rb#108
+class RedisClient::CannotConnectError < ::RedisClient::ConnectionError; end
+
+# source://redis-client//lib/redis_client.rb#115
+class RedisClient::CheckoutTimeoutError < ::RedisClient::TimeoutError; end
+
+# source://redis-client//lib/redis_client/circuit_breaker.rb#4
+class RedisClient::CircuitBreaker
+ # @return [CircuitBreaker] a new instance of CircuitBreaker
+ #
+ # source://redis-client//lib/redis_client/circuit_breaker.rb#23
+ def initialize(error_threshold:, error_timeout:, error_threshold_timeout: T.unsafe(nil), success_threshold: T.unsafe(nil)); end
+
+ # Returns the value of attribute error_threshold.
+ #
+ # source://redis-client//lib/redis_client/circuit_breaker.rb#21
+ def error_threshold; end
+
+ # Returns the value of attribute error_threshold_timeout.
+ #
+ # source://redis-client//lib/redis_client/circuit_breaker.rb#21
+ def error_threshold_timeout; end
+
+ # Returns the value of attribute error_timeout.
+ #
+ # source://redis-client//lib/redis_client/circuit_breaker.rb#21
+ def error_timeout; end
+
+ # source://redis-client//lib/redis_client/circuit_breaker.rb#34
+ def protect; end
+
+ # Returns the value of attribute success_threshold.
+ #
+ # source://redis-client//lib/redis_client/circuit_breaker.rb#21
+ def success_threshold; end
+
+ private
+
+ # source://redis-client//lib/redis_client/circuit_breaker.rb#80
+ def record_error; end
+
+ # source://redis-client//lib/redis_client/circuit_breaker.rb#95
+ def record_success; end
+
+ # source://redis-client//lib/redis_client/circuit_breaker.rb#65
+ def refresh_state; end
+end
+
+# source://redis-client//lib/redis_client/circuit_breaker.rb#5
+module RedisClient::CircuitBreaker::Middleware
+ # source://redis-client//lib/redis_client/circuit_breaker.rb#10
+ def call(_command, config); end
+
+ # source://redis-client//lib/redis_client/circuit_breaker.rb#14
+ def call_pipelined(_commands, config); end
+
+ # source://redis-client//lib/redis_client/circuit_breaker.rb#6
+ def connect(config); end
+end
+
+# source://redis-client//lib/redis_client/circuit_breaker.rb#19
+class RedisClient::CircuitBreaker::OpenCircuitError < ::RedisClient::CannotConnectError; end
+
+# source://redis-client//lib/redis_client/command_builder.rb#4
+module RedisClient::CommandBuilder
+ extend ::RedisClient::CommandBuilder
+
+ # source://redis-client//lib/redis_client/command_builder.rb#8
+ def generate(args, kwargs = T.unsafe(nil)); end
+end
+
+# source://redis-client//lib/redis_client.rb#125
+class RedisClient::CommandError < ::RedisClient::Error
+ include ::RedisClient::HasCommand
+
+ class << self
+ # source://redis-client//lib/redis_client.rb#129
+ def parse(error_message); end
+ end
+end
+
+# source://redis-client//lib/redis_client.rb#155
+RedisClient::CommandError::ERRORS = T.let(T.unsafe(nil), Hash)
+
+# source://redis-client//lib/redis_client.rb#55
+module RedisClient::Common
+ # source://redis-client//lib/redis_client.rb#59
+ def initialize(config, id: T.unsafe(nil), connect_timeout: T.unsafe(nil), read_timeout: T.unsafe(nil), write_timeout: T.unsafe(nil)); end
+
+ # Returns the value of attribute config.
+ #
+ # source://redis-client//lib/redis_client.rb#56
+ def config; end
+
+ # Returns the value of attribute connect_timeout.
+ #
+ # source://redis-client//lib/redis_client.rb#57
+ def connect_timeout; end
+
+ # Sets the attribute connect_timeout
+ #
+ # @param value the value to set the attribute connect_timeout to.
+ #
+ # source://redis-client//lib/redis_client.rb#57
+ def connect_timeout=(_arg0); end
+
+ # Returns the value of attribute id.
+ #
+ # source://redis-client//lib/redis_client.rb#56
+ def id; end
+
+ # Returns the value of attribute read_timeout.
+ #
+ # source://redis-client//lib/redis_client.rb#57
+ def read_timeout; end
+
+ # Sets the attribute read_timeout
+ #
+ # @param value the value to set the attribute read_timeout to.
+ #
+ # source://redis-client//lib/redis_client.rb#57
+ def read_timeout=(_arg0); end
+
+ # source://redis-client//lib/redis_client.rb#75
+ def timeout=(timeout); end
+
+ # Returns the value of attribute write_timeout.
+ #
+ # source://redis-client//lib/redis_client.rb#57
+ def write_timeout; end
+
+ # Sets the attribute write_timeout
+ #
+ # @param value the value to set the attribute write_timeout to.
+ #
+ # source://redis-client//lib/redis_client.rb#57
+ def write_timeout=(_arg0); end
+end
+
+# source://redis-client//lib/redis_client/config.rb#7
+class RedisClient::Config
+ include ::RedisClient::Config::Common
+
+ # @return [Config] a new instance of Config
+ #
+ # source://redis-client//lib/redis_client/config.rb#185
+ def initialize(url: T.unsafe(nil), host: T.unsafe(nil), port: T.unsafe(nil), path: T.unsafe(nil), username: T.unsafe(nil), password: T.unsafe(nil), **kwargs); end
+
+ # Returns the value of attribute host.
+ #
+ # source://redis-client//lib/redis_client/config.rb#183
+ def host; end
+
+ # Returns the value of attribute path.
+ #
+ # source://redis-client//lib/redis_client/config.rb#183
+ def path; end
+
+ # Returns the value of attribute port.
+ #
+ # source://redis-client//lib/redis_client/config.rb#183
+ def port; end
+end
+
+# source://redis-client//lib/redis_client/config.rb#14
+module RedisClient::Config::Common
+ # source://redis-client//lib/redis_client/config.rb#21
+ def initialize(username: T.unsafe(nil), password: T.unsafe(nil), db: T.unsafe(nil), id: T.unsafe(nil), timeout: T.unsafe(nil), read_timeout: T.unsafe(nil), write_timeout: T.unsafe(nil), connect_timeout: T.unsafe(nil), ssl: T.unsafe(nil), custom: T.unsafe(nil), ssl_params: T.unsafe(nil), driver: T.unsafe(nil), protocol: T.unsafe(nil), client_implementation: T.unsafe(nil), command_builder: T.unsafe(nil), inherit_socket: T.unsafe(nil), reconnect_attempts: T.unsafe(nil), middlewares: T.unsafe(nil), circuit_breaker: T.unsafe(nil)); end
+
+ # Returns the value of attribute circuit_breaker.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def circuit_breaker; end
+
+ # Returns the value of attribute command_builder.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def command_builder; end
+
+ # Returns the value of attribute connect_timeout.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def connect_timeout; end
+
+ # Returns the value of attribute connection_prelude.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def connection_prelude; end
+
+ # Returns the value of attribute custom.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def custom; end
+
+ # Returns the value of attribute db.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def db; end
+
+ # Returns the value of attribute driver.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def driver; end
+
+ # Returns the value of attribute id.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def id; end
+
+ # Returns the value of attribute inherit_socket.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def inherit_socket; end
+
+ # Returns the value of attribute middlewares_stack.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def middlewares_stack; end
+
+ # source://redis-client//lib/redis_client/config.rb#107
+ def new_client(**kwargs); end
+
+ # source://redis-client//lib/redis_client/config.rb#102
+ def new_pool(**kwargs); end
+
+ # Returns the value of attribute password.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def password; end
+
+ # Returns the value of attribute protocol.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def protocol; end
+
+ # Returns the value of attribute read_timeout.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def read_timeout; end
+
+ # @return [Boolean]
+ #
+ # source://redis-client//lib/redis_client/config.rb#94
+ def resolved?; end
+
+ # @return [Boolean]
+ #
+ # source://redis-client//lib/redis_client/config.rb#111
+ def retry_connecting?(attempt, _error); end
+
+ # @return [Boolean]
+ #
+ # source://redis-client//lib/redis_client/config.rb#98
+ def sentinel?; end
+
+ # source://redis-client//lib/redis_client/config.rb#129
+ def server_url; end
+
+ # Returns the value of attribute ssl.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def ssl; end
+
+ # Returns the value of attribute ssl.
+ def ssl?; end
+
+ # source://redis-client//lib/redis_client/config.rb#123
+ def ssl_context; end
+
+ # Returns the value of attribute ssl_params.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def ssl_params; end
+
+ # source://redis-client//lib/redis_client/config.rb#90
+ def username; end
+
+ # Returns the value of attribute write_timeout.
+ #
+ # source://redis-client//lib/redis_client/config.rb#15
+ def write_timeout; end
+
+ private
+
+ # source://redis-client//lib/redis_client/config.rb#152
+ def build_connection_prelude; end
+end
+
+# source://redis-client//lib/redis_client/config.rb#12
+RedisClient::Config::DEFAULT_DB = T.let(T.unsafe(nil), Integer)
+
+# source://redis-client//lib/redis_client/config.rb#9
+RedisClient::Config::DEFAULT_HOST = T.let(T.unsafe(nil), String)
+
+# source://redis-client//lib/redis_client/config.rb#10
+RedisClient::Config::DEFAULT_PORT = T.let(T.unsafe(nil), Integer)
+
+# source://redis-client//lib/redis_client/config.rb#8
+RedisClient::Config::DEFAULT_TIMEOUT = T.let(T.unsafe(nil), Float)
+
+# source://redis-client//lib/redis_client/config.rb#11
+RedisClient::Config::DEFAULT_USERNAME = T.let(T.unsafe(nil), String)
+
+# source://redis-client//lib/redis_client.rb#107
+class RedisClient::ConnectionError < ::RedisClient::Error; end
+
+# source://redis-client//lib/redis_client/connection_mixin.rb#4
+module RedisClient::ConnectionMixin
+ # source://redis-client//lib/redis_client/connection_mixin.rb#5
+ def initialize; end
+
+ # source://redis-client//lib/redis_client/connection_mixin.rb#28
+ def call(command, timeout); end
+
+ # source://redis-client//lib/redis_client/connection_mixin.rb#42
+ def call_pipelined(commands, timeouts, exception: T.unsafe(nil)); end
+
+ # source://redis-client//lib/redis_client/connection_mixin.rb#14
+ def close; end
+
+ # source://redis-client//lib/redis_client/connection_mixin.rb#77
+ def connection_timeout(timeout); end
+
+ # source://redis-client//lib/redis_client/connection_mixin.rb#9
+ def reconnect; end
+
+ # source://redis-client//lib/redis_client/connection_mixin.rb#19
+ def revalidate; end
+end
+
+# source://redis-client//lib/redis_client/decorator.rb#4
+module RedisClient::Decorator
+ class << self
+ # source://redis-client//lib/redis_client/decorator.rb#6
+ def create(commands_mixin); end
+ end
+end
+
+# source://redis-client//lib/redis_client/decorator.rb#37
+class RedisClient::Decorator::Client
+ include ::RedisClient::Decorator::CommandsMixin
+
+ # @return [Client] a new instance of Client
+ #
+ # source://redis-client//lib/redis_client/decorator.rb#40
+ def initialize(_client); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#60
+ def close(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#69
+ def config; end
+
+ # source://redis-client//lib/redis_client/decorator.rb#69
+ def connect_timeout; end
+
+ # source://redis-client//lib/redis_client/decorator.rb#77
+ def connect_timeout=(value); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#60
+ def hscan(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#69
+ def id; end
+
+ # source://redis-client//lib/redis_client/decorator.rb#54
+ def multi(**kwargs); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#50
+ def pipelined(exception: T.unsafe(nil)); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#69
+ def pubsub; end
+
+ # source://redis-client//lib/redis_client/decorator.rb#69
+ def read_timeout; end
+
+ # source://redis-client//lib/redis_client/decorator.rb#77
+ def read_timeout=(value); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#60
+ def scan(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#69
+ def size; end
+
+ # source://redis-client//lib/redis_client/decorator.rb#60
+ def sscan(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#77
+ def timeout=(value); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#45
+ def with(*args, **_arg1); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#69
+ def write_timeout; end
+
+ # source://redis-client//lib/redis_client/decorator.rb#77
+ def write_timeout=(value); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#60
+ def zscan(*args, **_arg1, &block); end
+end
+
+# source://redis-client//lib/redis_client/decorator.rb#18
+module RedisClient::Decorator::CommandsMixin
+ # source://redis-client//lib/redis_client/decorator.rb#19
+ def initialize(client); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#25
+ def blocking_call(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#25
+ def blocking_call_v(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#25
+ def call(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#25
+ def call_once(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#25
+ def call_once_v(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/decorator.rb#25
+ def call_v(*args, **_arg1, &block); end
+end
+
+# source://redis-client//lib/redis_client/decorator.rb#33
+class RedisClient::Decorator::Pipeline
+ include ::RedisClient::Decorator::CommandsMixin
+end
+
+# source://redis-client//lib/redis_client.rb#94
+class RedisClient::Error < ::StandardError
+ include ::RedisClient::HasConfig
+
+ class << self
+ # source://redis-client//lib/redis_client.rb#97
+ def with_config(message, config = T.unsafe(nil)); end
+ end
+end
+
+# source://redis-client//lib/redis_client.rb#110
+class RedisClient::FailoverError < ::RedisClient::ConnectionError; end
+
+# source://redis-client//lib/redis_client.rb#117
+module RedisClient::HasCommand
+ # source://redis-client//lib/redis_client.rb#120
+ def _set_command(command); end
+
+ # Returns the value of attribute command.
+ #
+ # source://redis-client//lib/redis_client.rb#118
+ def command; end
+end
+
+# source://redis-client//lib/redis_client.rb#80
+module RedisClient::HasConfig
+ # source://redis-client//lib/redis_client.rb#83
+ def _set_config(config); end
+
+ # Returns the value of attribute config.
+ #
+ # source://redis-client//lib/redis_client.rb#81
+ def config; end
+
+ # source://redis-client//lib/redis_client.rb#87
+ def message; end
+end
+
+# source://redis-client//lib/redis_client.rb#152
+class RedisClient::MasterDownError < ::RedisClient::ConnectionError
+ include ::RedisClient::HasCommand
+end
+
+# source://redis-client//lib/redis_client/middlewares.rb#21
+class RedisClient::Middlewares < ::RedisClient::BasicMiddleware; end
+
+# source://redis-client//lib/redis_client.rb#523
+class RedisClient::Multi
+ # @return [Multi] a new instance of Multi
+ #
+ # source://redis-client//lib/redis_client.rb#524
+ def initialize(command_builder); end
+
+ # source://redis-client//lib/redis_client.rb#566
+ def _blocks; end
+
+ # source://redis-client//lib/redis_client.rb#586
+ def _coerce!(results); end
+
+ # source://redis-client//lib/redis_client.rb#562
+ def _commands; end
+
+ # @return [Boolean]
+ #
+ # source://redis-client//lib/redis_client.rb#574
+ def _empty?; end
+
+ # @return [Boolean]
+ #
+ # source://redis-client//lib/redis_client.rb#582
+ def _retryable?; end
+
+ # source://redis-client//lib/redis_client.rb#570
+ def _size; end
+
+ # source://redis-client//lib/redis_client.rb#578
+ def _timeouts; end
+
+ # source://redis-client//lib/redis_client.rb#532
+ def call(*command, **kwargs, &block); end
+
+ # source://redis-client//lib/redis_client.rb#546
+ def call_once(*command, **kwargs, &block); end
+
+ # source://redis-client//lib/redis_client.rb#554
+ def call_once_v(command, &block); end
+
+ # source://redis-client//lib/redis_client.rb#539
+ def call_v(command, &block); end
+end
+
+# source://redis-client//lib/redis_client.rb#147
+class RedisClient::OutOfMemoryError < ::RedisClient::CommandError; end
+
+# source://redis-client//lib/redis_client/pid_cache.rb#4
+module RedisClient::PIDCache
+ class << self
+ # Returns the value of attribute pid.
+ #
+ # source://redis-client//lib/redis_client/pid_cache.rb#10
+ def pid; end
+
+ # source://redis-client//lib/redis_client/pid_cache.rb#12
+ def update!; end
+ end
+end
+
+# source://redis-client//lib/redis_client/pid_cache.rb#18
+module RedisClient::PIDCache::CoreExt
+ # source://redis-client//lib/redis_client/pid_cache.rb#19
+ def _fork; end
+end
+
+# source://redis-client//lib/redis_client.rb#145
+class RedisClient::PermissionError < ::RedisClient::CommandError; end
+
+# source://redis-client//lib/redis_client.rb#602
+class RedisClient::Pipeline < ::RedisClient::Multi
+ # @return [Pipeline] a new instance of Pipeline
+ #
+ # source://redis-client//lib/redis_client.rb#603
+ def initialize(_command_builder); end
+
+ # source://redis-client//lib/redis_client.rb#634
+ def _coerce!(results); end
+
+ # @return [Boolean]
+ #
+ # source://redis-client//lib/redis_client.rb#630
+ def _empty?; end
+
+ # source://redis-client//lib/redis_client.rb#626
+ def _timeouts; end
+
+ # source://redis-client//lib/redis_client.rb#608
+ def blocking_call(timeout, *command, **kwargs, &block); end
+
+ # source://redis-client//lib/redis_client.rb#617
+ def blocking_call_v(timeout, command, &block); end
+end
+
+# source://redis-client//lib/redis_client/pooled.rb#6
+class RedisClient::Pooled
+ include ::RedisClient::Common
+
+ # @return [Pooled] a new instance of Pooled
+ #
+ # source://redis-client//lib/redis_client/pooled.rb#11
+ def initialize(config, id: T.unsafe(nil), connect_timeout: T.unsafe(nil), read_timeout: T.unsafe(nil), write_timeout: T.unsafe(nil), **kwargs); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#56
+ def blocking_call(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#56
+ def blocking_call_v(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#56
+ def call(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#56
+ def call_once(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#56
+ def call_once_v(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#56
+ def call_v(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#37
+ def close; end
+
+ # source://redis-client//lib/redis_client/pooled.rb#65
+ def hscan(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#56
+ def multi(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#56
+ def pipelined(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#56
+ def pubsub(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#65
+ def scan(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#48
+ def size; end
+
+ # source://redis-client//lib/redis_client/pooled.rb#65
+ def sscan(*args, **_arg1, &block); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#25
+ def then(options = T.unsafe(nil)); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#25
+ def with(options = T.unsafe(nil)); end
+
+ # source://redis-client//lib/redis_client/pooled.rb#65
+ def zscan(*args, **_arg1, &block); end
+
+ private
+
+ # source://redis-client//lib/redis_client/pooled.rb#82
+ def new_pool; end
+
+ # source://redis-client//lib/redis_client/pooled.rb#78
+ def pool; end
+end
+
+# source://redis-client//lib/redis_client/pooled.rb#7
+RedisClient::Pooled::EMPTY_HASH = T.let(T.unsafe(nil), Hash)
+
+# source://redis-client//lib/redis_client.rb#104
+class RedisClient::ProtocolError < ::RedisClient::Error; end
+
+# source://redis-client//lib/redis_client.rb#486
+class RedisClient::PubSub
+ # @return [PubSub] a new instance of PubSub
+ #
+ # source://redis-client//lib/redis_client.rb#487
+ def initialize(raw_connection, command_builder); end
+
+ # source://redis-client//lib/redis_client.rb#492
+ def call(*command, **kwargs); end
+
+ # source://redis-client//lib/redis_client.rb#497
+ def call_v(command); end
+
+ # source://redis-client//lib/redis_client.rb#502
+ def close; end
+
+ # source://redis-client//lib/redis_client.rb#508
+ def next_event(timeout = T.unsafe(nil)); end
+
+ private
+
+ # Returns the value of attribute raw_connection.
+ #
+ # source://redis-client//lib/redis_client.rb#520
+ def raw_connection; end
+end
+
+# source://redis-client//lib/redis_client/ruby_connection/resp3.rb#4
+module RedisClient::RESP3
+ private
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#36
+ def dump(command, buffer = T.unsafe(nil)); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#57
+ def dump_any(object, buffer); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#68
+ def dump_array(array, buffer); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#84
+ def dump_hash(hash, buffer); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#93
+ def dump_numeric(numeric, buffer); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#76
+ def dump_set(set, buffer); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#97
+ def dump_string(string, buffer); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#103
+ def dump_symbol(symbol, buffer); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#49
+ def load(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#53
+ def new_buffer; end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#112
+ def parse(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#166
+ def parse_array(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#218
+ def parse_blob(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#155
+ def parse_boolean(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#200
+ def parse_double(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#151
+ def parse_error(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#196
+ def parse_integer(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#174
+ def parse_map(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#213
+ def parse_null(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#182
+ def parse_push(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#186
+ def parse_sequence(io, size); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#170
+ def parse_set(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#145
+ def parse_string(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#227
+ def parse_verbatim_string(io); end
+
+ class << self
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#36
+ def dump(command, buffer = T.unsafe(nil)); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#57
+ def dump_any(object, buffer); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#68
+ def dump_array(array, buffer); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#84
+ def dump_hash(hash, buffer); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#93
+ def dump_numeric(numeric, buffer); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#76
+ def dump_set(set, buffer); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#97
+ def dump_string(string, buffer); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#103
+ def dump_symbol(symbol, buffer); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#49
+ def load(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#53
+ def new_buffer; end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#112
+ def parse(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#166
+ def parse_array(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#218
+ def parse_blob(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#155
+ def parse_boolean(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#200
+ def parse_double(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#151
+ def parse_error(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#196
+ def parse_integer(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#174
+ def parse_map(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#213
+ def parse_null(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#182
+ def parse_push(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#186
+ def parse_sequence(io, size); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#170
+ def parse_set(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#145
+ def parse_string(io); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/resp3.rb#227
+ def parse_verbatim_string(io); end
+ end
+end
+
+# source://redis-client//lib/redis_client/ruby_connection/resp3.rb#13
+RedisClient::RESP3::DUMP_TYPES = T.let(T.unsafe(nil), Hash)
+
+# source://redis-client//lib/redis_client/ruby_connection/resp3.rb#11
+RedisClient::RESP3::EOL = T.let(T.unsafe(nil), String)
+
+# source://redis-client//lib/redis_client/ruby_connection/resp3.rb#12
+RedisClient::RESP3::EOL_SIZE = T.let(T.unsafe(nil), Integer)
+
+# source://redis-client//lib/redis_client/ruby_connection/resp3.rb#7
+class RedisClient::RESP3::Error < ::RedisClient::Error; end
+
+# source://redis-client//lib/redis_client/ruby_connection/resp3.rb#34
+RedisClient::RESP3::INTEGER_RANGE = T.let(T.unsafe(nil), Range)
+
+# source://redis-client//lib/redis_client/ruby_connection/resp3.rb#19
+RedisClient::RESP3::PARSER_TYPES = T.let(T.unsafe(nil), Hash)
+
+# source://redis-client//lib/redis_client/ruby_connection/resp3.rb#9
+class RedisClient::RESP3::SyntaxError < ::RedisClient::RESP3::Error; end
+
+# source://redis-client//lib/redis_client/ruby_connection/resp3.rb#8
+class RedisClient::RESP3::UnknownType < ::RedisClient::RESP3::Error; end
+
+# source://redis-client//lib/redis_client.rb#149
+class RedisClient::ReadOnlyError < ::RedisClient::ConnectionError
+ include ::RedisClient::HasCommand
+end
+
+# source://redis-client//lib/redis_client.rb#113
+class RedisClient::ReadTimeoutError < ::RedisClient::TimeoutError; end
+
+# source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#6
+class RedisClient::RubyConnection
+ include ::RedisClient::ConnectionMixin
+
+ # @return [RubyConnection] a new instance of RubyConnection
+ #
+ # source://redis-client//lib/redis_client/ruby_connection.rb#45
+ def initialize(config, connect_timeout:, read_timeout:, write_timeout:); end
+
+ # source://redis-client//lib/redis_client/ruby_connection.rb#58
+ def close; end
+
+ # Returns the value of attribute config.
+ #
+ # source://redis-client//lib/redis_client/ruby_connection.rb#43
+ def config; end
+
+ # @return [Boolean]
+ #
+ # source://redis-client//lib/redis_client/ruby_connection.rb#54
+ def connected?; end
+
+ # source://redis-client//lib/redis_client/ruby_connection.rb#106
+ def measure_round_trip_delay; end
+
+ # source://redis-client//lib/redis_client/ruby_connection.rb#94
+ def read(timeout = T.unsafe(nil)); end
+
+ # source://redis-client//lib/redis_client/ruby_connection.rb#63
+ def read_timeout=(timeout); end
+
+ # source://redis-client//lib/redis_client/ruby_connection.rb#73
+ def write(command); end
+
+ # source://redis-client//lib/redis_client/ruby_connection.rb#82
+ def write_multi(commands); end
+
+ # source://redis-client//lib/redis_client/ruby_connection.rb#68
+ def write_timeout=(timeout); end
+
+ private
+
+ # source://redis-client//lib/redis_client/ruby_connection.rb#114
+ def connect; end
+
+ # unknown
+ #
+ # source://redis-client//lib/redis_client/ruby_connection.rb#165
+ def enable_socket_keep_alive(socket); end
+
+ class << self
+ # source://redis-client//lib/redis_client/ruby_connection.rb#14
+ def ssl_context(ssl_params); end
+ end
+end
+
+# source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#7
+class RedisClient::RubyConnection::BufferedIO
+ # @return [BufferedIO] a new instance of BufferedIO
+ #
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#16
+ def initialize(io, read_timeout:, write_timeout:, chunk_size: T.unsafe(nil)); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#89
+ def close; end
+
+ # @return [Boolean]
+ #
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#93
+ def closed?; end
+
+ # @return [Boolean]
+ #
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#97
+ def eof?; end
+
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#150
+ def getbyte; end
+
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#26
+ def gets_chomp; end
+
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#159
+ def gets_integer; end
+
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#37
+ def read_chomp(bytes); end
+
+ # Returns the value of attribute read_timeout.
+ #
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#11
+ def read_timeout; end
+
+ # Sets the attribute read_timeout
+ #
+ # @param value the value to set the attribute read_timeout to.
+ #
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#11
+ def read_timeout=(_arg0); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#121
+ def skip(offset); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#101
+ def with_timeout(new_timeout); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#127
+ def write(string); end
+
+ # Returns the value of attribute write_timeout.
+ #
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#11
+ def write_timeout; end
+
+ # Sets the attribute write_timeout
+ #
+ # @param value the value to set the attribute write_timeout to.
+ #
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#11
+ def write_timeout=(_arg0); end
+
+ private
+
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#44
+ def ensure_line; end
+
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#184
+ def ensure_remaining(bytes); end
+
+ # source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#191
+ def fill_buffer(strict, size = T.unsafe(nil)); end
+end
+
+# source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#14
+RedisClient::RubyConnection::BufferedIO::ENCODING = T.let(T.unsafe(nil), Encoding)
+
+# source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#8
+RedisClient::RubyConnection::BufferedIO::EOL = T.let(T.unsafe(nil), String)
+
+# source://redis-client//lib/redis_client/ruby_connection/buffered_io.rb#9
+RedisClient::RubyConnection::BufferedIO::EOL_SIZE = T.let(T.unsafe(nil), Integer)
+
+# Same as hiredis defaults
+#
+# source://redis-client//lib/redis_client/ruby_connection.rb#157
+RedisClient::RubyConnection::KEEP_ALIVE_INTERVAL = T.let(T.unsafe(nil), Integer)
+
+# source://redis-client//lib/redis_client/ruby_connection.rb#159
+RedisClient::RubyConnection::KEEP_ALIVE_PROBES = T.let(T.unsafe(nil), Integer)
+
+# Longer than hiredis defaults
+#
+# source://redis-client//lib/redis_client/ruby_connection.rb#158
+RedisClient::RubyConnection::KEEP_ALIVE_TTL = T.let(T.unsafe(nil), Integer)
+
+# source://redis-client//lib/redis_client/ruby_connection.rb#41
+RedisClient::RubyConnection::SUPPORTS_RESOLV_TIMEOUT = T.let(T.unsafe(nil), TrueClass)
+
+# source://redis-client//lib/redis_client/sentinel_config.rb#4
+class RedisClient::SentinelConfig
+ include ::RedisClient::Config::Common
+
+ # @return [SentinelConfig] a new instance of SentinelConfig
+ #
+ # source://redis-client//lib/redis_client/sentinel_config.rb#12
+ def initialize(sentinels:, sentinel_password: T.unsafe(nil), sentinel_username: T.unsafe(nil), role: T.unsafe(nil), name: T.unsafe(nil), url: T.unsafe(nil), **client_config); end
+
+ # source://redis-client//lib/redis_client/sentinel_config.rb#101
+ def check_role!(role); end
+
+ # source://redis-client//lib/redis_client/sentinel_config.rb#80
+ def host; end
+
+ # Returns the value of attribute name.
+ #
+ # source://redis-client//lib/redis_client/sentinel_config.rb#10
+ def name; end
+
+ # source://redis-client//lib/redis_client/sentinel_config.rb#88
+ def path; end
+
+ # source://redis-client//lib/redis_client/sentinel_config.rb#84
+ def port; end
+
+ # source://redis-client//lib/redis_client/sentinel_config.rb#74
+ def reset; end
+
+ # @return [Boolean]
+ #
+ # source://redis-client//lib/redis_client/sentinel_config.rb#115
+ def resolved?; end
+
+ # @return [Boolean]
+ #
+ # source://redis-client//lib/redis_client/sentinel_config.rb#92
+ def retry_connecting?(attempt, error); end
+
+ # @return [Boolean]
+ #
+ # source://redis-client//lib/redis_client/sentinel_config.rb#97
+ def sentinel?; end
+
+ # source://redis-client//lib/redis_client/sentinel_config.rb#68
+ def sentinels; end
+
+ private
+
+ # source://redis-client//lib/redis_client/sentinel_config.rb#134
+ def config; end
+
+ # source://redis-client//lib/redis_client/sentinel_config.rb#181
+ def each_sentinel; end
+
+ # source://redis-client//lib/redis_client/sentinel_config.rb#207
+ def refresh_sentinels(sentinel_client); end
+
+ # source://redis-client//lib/redis_client/sentinel_config.rb#144
+ def resolve_master; end
+
+ # source://redis-client//lib/redis_client/sentinel_config.rb#163
+ def resolve_replica; end
+
+ # source://redis-client//lib/redis_client/sentinel_config.rb#159
+ def sentinel_client(sentinel_config); end
+
+ # source://redis-client//lib/redis_client/sentinel_config.rb#123
+ def sentinels_to_configs(sentinels); end
+end
+
+# source://redis-client//lib/redis_client/sentinel_config.rb#8
+RedisClient::SentinelConfig::DEFAULT_RECONNECT_ATTEMPTS = T.let(T.unsafe(nil), Integer)
+
+# source://redis-client//lib/redis_client/sentinel_config.rb#7
+RedisClient::SentinelConfig::SENTINEL_DELAY = T.let(T.unsafe(nil), Float)
+
+# source://redis-client//lib/redis_client.rb#112
+class RedisClient::TimeoutError < ::RedisClient::ConnectionError; end
+
+# source://redis-client//lib/redis_client/url_config.rb#6
+class RedisClient::URLConfig
+ # @return [URLConfig] a new instance of URLConfig
+ #
+ # source://redis-client//lib/redis_client/url_config.rb#9
+ def initialize(url); end
+
+ # source://redis-client//lib/redis_client/url_config.rb#30
+ def db; end
+
+ # source://redis-client//lib/redis_client/url_config.rb#56
+ def host; end
+
+ # source://redis-client//lib/redis_client/url_config.rb#48
+ def password; end
+
+ # source://redis-client//lib/redis_client/url_config.rb#62
+ def path; end
+
+ # source://redis-client//lib/redis_client/url_config.rb#68
+ def port; end
+
+ # @return [Boolean]
+ #
+ # source://redis-client//lib/redis_client/url_config.rb#26
+ def ssl?; end
+
+ # Returns the value of attribute uri.
+ #
+ # source://redis-client//lib/redis_client/url_config.rb#7
+ def uri; end
+
+ # Returns the value of attribute url.
+ #
+ # source://redis-client//lib/redis_client/url_config.rb#7
+ def url; end
+
+ # source://redis-client//lib/redis_client/url_config.rb#44
+ def username; end
+end
+
+# source://redis-client//lib/redis_client.rb#105
+class RedisClient::UnsupportedServer < ::RedisClient::Error; end
+
+# source://redis-client//lib/redis_client/version.rb#4
+RedisClient::VERSION = T.let(T.unsafe(nil), String)
+
+# source://redis-client//lib/redis_client.rb#114
+class RedisClient::WriteTimeoutError < ::RedisClient::TimeoutError; end
+
+# source://redis-client//lib/redis_client.rb#146
+class RedisClient::WrongTypeError < ::RedisClient::CommandError; end
diff --git a/sorbet/rbi/gems/redis@4.8.1.rbi b/sorbet/rbi/gems/redis@5.2.0.rbi
similarity index 69%
rename from sorbet/rbi/gems/redis@4.8.1.rbi
rename to sorbet/rbi/gems/redis@5.2.0.rbi
index 29786e22d..54bb4e00a 100644
--- a/sorbet/rbi/gems/redis@4.8.1.rbi
+++ b/sorbet/rbi/gems/redis@5.2.0.rbi
@@ -42,179 +42,101 @@ class Redis
# @option options
# @option options
# @option options
- # @option options
- # @option options
- # @option options
- # @option options
- # @option options
# @param options [Hash]
# @return [Redis] a new client instance
#
- # source://redis//lib/redis.rb#83
+ # source://redis//lib/redis.rb#63
def initialize(options = T.unsafe(nil)); end
- # source://redis//lib/redis.rb#160
+ # source://redis//lib/redis.rb#98
def _client; end
# Disconnect the client as quickly and silently as possible.
#
- # source://redis//lib/redis.rb#110
+ # source://redis//lib/redis.rb#88
def close; end
- # See http://redis.io/topics/pipelining for more details.
- #
- # @deprecated Sends all commands in the queue.
- #
- # source://redis//lib/redis.rb#140
- def commit; end
-
# Test whether or not the client is connected
#
# @return [Boolean]
#
- # source://redis//lib/redis.rb#105
+ # source://redis//lib/redis.rb#83
def connected?; end
- # source://redis//lib/redis.rb#250
+ # source://redis//lib/redis.rb#122
def connection; end
# Disconnect the client as quickly and silently as possible.
#
- # source://redis//lib/redis.rb#110
+ # source://redis//lib/redis.rb#88
def disconnect!; end
- # source://redis//lib/redis.rb#246
+ # source://redis//lib/redis.rb#118
def dup; end
- # source://redis//lib/redis.rb#238
+ # source://redis//lib/redis.rb#110
def id; end
- # source://redis//lib/redis.rb#242
+ # source://redis//lib/redis.rb#114
def inspect; end
- # Mark the start of a transaction block.
- #
- # Passing a block is optional.
- #
- # @example With a block
- # redis.multi do |multi|
- # multi.set("key", "value")
- # multi.incr("counter")
- # end # => ["OK", 6]
- # @example Without a block
- # redis.multi
- # # => "OK"
- # redis.set("key", "value")
- # # => "QUEUED"
- # redis.incr("counter")
- # # => "QUEUED"
- # redis.exec
- # # => ["OK", 6]
- # @return [String, Array<...>] - when a block is not given, `OK`
- # - when a block is given, an array with replies
- # @see #watch
- # @see #unwatch
- # @yield [multi] the commands that are called inside this block are cached
- # and written to the server upon returning from it
- # @yieldparam multi [Redis] `self`
- #
- # source://redis//lib/redis.rb#214
- def multi(&block); end
-
- # source://redis//lib/redis.rb#164
- def pipelined(&block); end
-
- # Commands in the queue are executed with the Redis#commit method.
- #
- # See http://redis.io/topics/pipelining for more details.
- #
- # @deprecated Queues a command for pipelining.
- #
- # source://redis//lib/redis.rb#125
- def queue(*command); end
+ # source://redis//lib/redis.rb#102
+ def pipelined(exception: T.unsafe(nil)); end
# @yield [_self]
# @yieldparam _self [Redis] the object that the method was called on
#
- # source://redis//lib/redis.rb#115
+ # source://redis//lib/redis.rb#94
def with; end
- # Run code with the client reconnecting
- #
- # source://redis//lib/redis.rb#93
- def with_reconnect(val = T.unsafe(nil), &blk); end
-
# Run code without the client reconnecting
#
- # source://redis//lib/redis.rb#100
- def without_reconnect(&blk); end
+ # source://redis//lib/redis.rb#78
+ def without_reconnect(&block); end
private
- # source://redis//lib/redis.rb#280
+ # source://redis//lib/redis.rb#164
def _subscription(method, timeout, channels, block); end
- # source://redis//lib/redis.rb#274
+ # source://redis//lib/redis.rb#134
+ def initialize_client(options); end
+
+ # source://redis//lib/redis.rb#158
def send_blocking_command(command, timeout, &block); end
- # source://redis//lib/redis.rb#268
+ # source://redis//lib/redis.rb#150
def send_command(command, &block); end
- # source://redis//lib/redis.rb#264
+ # source://redis//lib/redis.rb#146
def synchronize; end
class << self
- # source://redis//lib/redis.rb#40
- def current; end
-
- # source://redis//lib/redis.rb#45
- def current=(redis); end
-
- # source://redis//lib/redis.rb#30
+ # source://redis//lib/redis.rb#14
def deprecate!(message); end
- # Returns the value of attribute exists_returns_integer.
- #
- # source://redis//lib/redis.rb#15
- def exists_returns_integer; end
-
- # source://redis//lib/redis.rb#18
- def exists_returns_integer=(value); end
-
# Returns the value of attribute raise_deprecations.
#
- # source://redis//lib/redis.rb#16
+ # source://redis//lib/redis.rb#12
def raise_deprecations; end
# Sets the attribute raise_deprecations
#
# @param value the value to set the attribute raise_deprecations to.
#
- # source://redis//lib/redis.rb#16
+ # source://redis//lib/redis.rb#12
def raise_deprecations=(_arg0); end
- # Returns the value of attribute sadd_returns_boolean.
- #
- # source://redis//lib/redis.rb#16
- def sadd_returns_boolean; end
-
- # Sets the attribute sadd_returns_boolean
- #
- # @param value the value to set the attribute sadd_returns_boolean to.
- #
- # source://redis//lib/redis.rb#16
- def sadd_returns_boolean=(_arg0); end
-
# Returns the value of attribute silence_deprecations.
#
- # source://redis//lib/redis.rb#16
+ # source://redis//lib/redis.rb#12
def silence_deprecations; end
# Sets the attribute silence_deprecations
#
# @param value the value to set the attribute silence_deprecations to.
#
- # source://redis//lib/redis.rb#16
+ # source://redis//lib/redis.rb#12
def silence_deprecations=(_arg0); end
end
end
@@ -224,763 +146,84 @@ Redis::BASE_PATH = T.let(T.unsafe(nil), String)
# Base error for connection related errors.
#
-# source://redis//lib/redis/errors.rb#24
+# source://redis//lib/redis/errors.rb#33
class Redis::BaseConnectionError < ::Redis::BaseError; end
# Base error for all redis-rb errors.
#
# source://redis//lib/redis/errors.rb#5
-class Redis::BaseError < ::RuntimeError; end
+class Redis::BaseError < ::StandardError; end
# Raised when connection to a Redis server cannot be made.
#
-# source://redis//lib/redis/errors.rb#28
+# source://redis//lib/redis/errors.rb#37
class Redis::CannotConnectError < ::Redis::BaseConnectionError; end
-# source://redis//lib/redis/client.rb#8
-class Redis::Client
- # @return [Client] a new instance of Client
- #
- # source://redis//lib/redis/client.rb#91
- def initialize(options = T.unsafe(nil)); end
-
- # source://redis//lib/redis/client.rb#160
- def call(command); end
-
- # source://redis//lib/redis/client.rb#171
- def call_loop(command, timeout = T.unsafe(nil)); end
-
- # source://redis//lib/redis/client.rb#195
- def call_pipeline(pipeline); end
-
- # source://redis//lib/redis/client.rb#214
- def call_pipelined(pipeline); end
-
- # source://redis//lib/redis/client.rb#254
- def call_with_timeout(command, extra_timeout, &blk); end
-
- # source://redis//lib/redis/client.rb#263
- def call_without_timeout(command, &blk); end
-
- # source://redis//lib/redis/client.rb#288
- def close; end
-
- # Returns the value of attribute command_map.
- #
- # source://redis//lib/redis/client.rb#35
- def command_map; end
-
- # source://redis//lib/redis/client.rb#110
- def connect; end
-
- # source://redis//lib/redis/client.rb#57
- def connect_timeout; end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/client.rb#284
- def connected?; end
+# source://redis//lib/redis/client.rb#6
+class Redis::Client < ::RedisClient
+ # source://redis//lib/redis/client.rb#95
+ def blocking_call_v(timeout, command, &block); end
- # Returns the value of attribute connection.
- #
- # source://redis//lib/redis/client.rb#35
- def connection; end
+ # source://redis//lib/redis/client.rb#89
+ def call_v(command, &block); end
- # source://redis//lib/redis/client.rb#73
+ # source://redis//lib/redis/client.rb#60
def db; end
- # source://redis//lib/redis/client.rb#77
- def db=(db); end
-
- # source://redis//lib/redis/client.rb#288
- def disconnect; end
-
- # source://redis//lib/redis/client.rb#81
- def driver; end
-
- # source://redis//lib/redis/client.rb#41
+ # source://redis//lib/redis/client.rb#64
def host; end
- # source://redis//lib/redis/client.rb#152
+ # source://redis//lib/redis/client.rb#48
def id; end
- # @return [Boolean]
- #
- # source://redis//lib/redis/client.rb#85
- def inherit_socket?; end
-
- # source://redis//lib/redis/client.rb#298
- def io; end
-
- # source://redis//lib/redis/client.rb#156
- def location; end
-
- # Returns the value of attribute logger.
- #
- # source://redis//lib/redis/client.rb#89
- def logger; end
-
- # Sets the attribute logger
- #
- # @param value the value to set the attribute logger to.
- #
- # source://redis//lib/redis/client.rb#89
- def logger=(_arg0); end
+ # source://redis//lib/redis/client.rb#120
+ def inherit_socket!; end
- # Returns the value of attribute options.
- #
- # source://redis//lib/redis/client.rb#35
- def options; end
+ # source://redis//lib/redis/client.rb#114
+ def multi(watch: T.unsafe(nil)); end
- # source://redis//lib/redis/client.rb#69
+ # source://redis//lib/redis/client.rb#80
def password; end
- # source://redis//lib/redis/client.rb#49
+ # source://redis//lib/redis/client.rb#72
def path; end
- # source://redis//lib/redis/client.rb#45
- def port; end
-
- # source://redis//lib/redis/client.rb#267
- def process(commands); end
-
- # source://redis//lib/redis/client.rb#309
- def read; end
-
- # source://redis//lib/redis/client.rb#53
- def read_timeout; end
+ # source://redis//lib/redis/client.rb#108
+ def pipelined(exception: T.unsafe(nil)); end
- # source://redis//lib/redis/client.rb#293
- def reconnect; end
+ # source://redis//lib/redis/client.rb#68
+ def port; end
- # source://redis//lib/redis/client.rb#37
- def scheme; end
+ # source://redis//lib/redis/client.rb#52
+ def server_url; end
- # source://redis//lib/redis/client.rb#61
+ # source://redis//lib/redis/client.rb#56
def timeout; end
- # source://redis//lib/redis/client.rb#65
+ # source://redis//lib/redis/client.rb#76
def username; end
- # source://redis//lib/redis/client.rb#342
- def with_reconnect(val = T.unsafe(nil)); end
-
- # source://redis//lib/redis/client.rb#324
- def with_socket_timeout(timeout); end
-
- # source://redis//lib/redis/client.rb#349
- def without_reconnect(&blk); end
-
- # source://redis//lib/redis/client.rb#338
- def without_socket_timeout(&blk); end
-
- # source://redis//lib/redis/client.rb#317
- def write(command); end
-
- protected
-
- # source://redis//lib/redis/client.rb#529
- def _parse_driver(driver); end
-
- # source://redis//lib/redis/client.rb#430
- def _parse_options(options); end
-
- # source://redis//lib/redis/client.rb#401
- def ensure_connected; end
-
- # source://redis//lib/redis/client.rb#379
- def establish_connection; end
-
- # source://redis//lib/redis/client.rb#355
- def logging(commands); end
-end
-
-# source://redis//lib/redis/client.rb#549
-class Redis::Client::Connector
- # @return [Connector] a new instance of Connector
- #
- # source://redis//lib/redis/client.rb#550
- def initialize(options); end
-
- # source://redis//lib/redis/client.rb#558
- def check(client); end
-
- # source://redis//lib/redis/client.rb#554
- def resolve; end
-end
-
-# source://redis//lib/redis/client.rb#560
-class Redis::Client::Connector::Sentinel < ::Redis::Client::Connector
- # @return [Sentinel] a new instance of Sentinel
- #
- # source://redis//lib/redis/client.rb#561
- def initialize(options); end
-
- # source://redis//lib/redis/client.rb#571
- def check(client); end
-
- # source://redis//lib/redis/client.rb#588
- def resolve; end
-
- # source://redis//lib/redis/client.rb#628
- def resolve_master; end
-
- # source://redis//lib/redis/client.rb#636
- def resolve_slave; end
-
- # @raise [CannotConnectError]
- #
- # source://redis//lib/redis/client.rb#601
- def sentinel_detect; end
-end
-
-# Defaults are also used for converting string keys to symbols.
-#
-# source://redis//lib/redis/client.rb#10
-Redis::Client::DEFAULTS = T.let(T.unsafe(nil), Hash)
-
-# source://redis//lib/redis/errors.rb#47
-class Redis::Cluster
- # @return [Cluster] a new instance of Cluster
- #
- # source://redis//lib/redis/cluster.rb#24
- def initialize(options = T.unsafe(nil)); end
-
- # source://redis//lib/redis/cluster.rb#71
- def call(command, &block); end
-
- # source://redis//lib/redis/cluster.rb#75
- def call_loop(command, timeout = T.unsafe(nil), &block); end
-
- # source://redis//lib/redis/cluster.rb#80
- def call_pipeline(pipeline); end
-
- # source://redis//lib/redis/cluster.rb#90
- def call_with_timeout(command, timeout, &block); end
-
- # source://redis//lib/redis/cluster.rb#95
- def call_without_timeout(command, &block); end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/cluster.rb#46
- def connected?; end
-
- # source://redis//lib/redis/cluster.rb#55
- def connection_info; end
-
- # db feature is disabled in cluster mode
- #
- # source://redis//lib/redis/cluster.rb#35
- def db; end
-
- # db feature is disabled in cluster mode
- #
- # source://redis//lib/redis/cluster.rb#40
- def db=(_db); end
-
- # source://redis//lib/redis/cluster.rb#50
- def disconnect; end
-
- # source://redis//lib/redis/cluster.rb#30
- def id; end
-
- # source://redis//lib/redis/cluster.rb#99
- def process(commands, &block); end
-
- # source://redis//lib/redis/cluster.rb#42
- def timeout; end
-
- # source://redis//lib/redis/cluster.rb#67
- def with_reconnect(val = T.unsafe(nil), &block); end
-
- private
-
- # source://redis//lib/redis/cluster.rb#242
- def _scan(command, &block); end
-
- # source://redis//lib/redis/cluster.rb#272
- def assign_asking_node(err_msg); end
-
- # source://redis//lib/redis/cluster.rb#277
- def assign_node(command); end
-
- # source://redis//lib/redis/cluster.rb#265
- def assign_redirection_node(err_msg); end
-
- # source://redis//lib/redis/cluster.rb#114
- def fetch_cluster_info!(option); end
-
- # source://redis//lib/redis/cluster.rb#125
- def fetch_command_details(nodes); end
-
- # source://redis//lib/redis/cluster.rb#296
- def find_node(node_key); end
-
- # source://redis//lib/redis/cluster.rb#282
- def find_node_key(command, primary_only: T.unsafe(nil)); end
-
- # source://redis//lib/redis/cluster.rb#175
- def send_client_command(command, &block); end
-
- # source://redis//lib/redis/cluster.rb#184
- def send_cluster_command(command, &block); end
-
- # source://redis//lib/redis/cluster.rb#130
- def send_command(command, &block); end
-
- # source://redis//lib/redis/cluster.rb#159
- def send_config_command(command, &block); end
-
- # source://redis//lib/redis/cluster.rb#167
- def send_memory_command(command, &block); end
-
- # source://redis//lib/redis/cluster.rb#205
- def send_pubsub_command(command, &block); end
-
- # source://redis//lib/redis/cluster.rb#195
- def send_script_command(command, &block); end
-
- # @see https://redis.io/topics/cluster-spec#redirection-and-resharding Redirection and resharding
- #
- # source://redis//lib/redis/cluster.rb#218
- def try_send(node, method_name, *args, retry_count: T.unsafe(nil), &block); end
-
- # source://redis//lib/redis/cluster.rb#305
- def update_cluster_info!(node_key = T.unsafe(nil)); end
-end
-
-# Raised when cluster client can't select node.
-#
-# source://redis//lib/redis/errors.rb#83
-class Redis::Cluster::AmbiguousNodeError < ::Redis::BaseError
- # @return [AmbiguousNodeError] a new instance of AmbiguousNodeError
- #
- # source://redis//lib/redis/errors.rb#84
- def initialize(command); end
-end
-
-# Keep details about Redis commands for Redis Cluster Client.
-#
-# @see https://redis.io/commands/command
-#
-# source://redis//lib/redis/cluster/command.rb#9
-class Redis::Cluster::Command
- # @return [Command] a new instance of Command
- #
- # source://redis//lib/redis/cluster/command.rb#10
- def initialize(details); end
-
- # source://redis//lib/redis/cluster/command.rb#14
- def extract_first_key(command); end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/cluster/command.rb#23
- def should_send_to_master?(command); end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/cluster/command.rb#27
- def should_send_to_slave?(command); end
-
- private
-
- # source://redis//lib/redis/cluster/command.rb#50
- def determine_first_key_position(command); end
-
- # source://redis//lib/redis/cluster/command.rb#63
- def determine_optional_key_position(command, option_name); end
-
- # source://redis//lib/redis/cluster/command.rb#43
- def dig_details(command, key); end
-
- # @see https://redis.io/topics/cluster-spec#keys-hash-tags Keys hash tags
- #
- # source://redis//lib/redis/cluster/command.rb#69
- def extract_hash_tag(key); end
-
- # source://redis//lib/redis/cluster/command.rb#33
- def pick_details(details); end
-end
-
-# Raised when error occurs on any node of cluster.
-#
-# source://redis//lib/redis/errors.rb#71
-class Redis::Cluster::CommandErrorCollection < ::Redis::BaseError
- # @param errors [Hash{String => Redis::CommandError}]
- # @param error_message [String]
- # @return [CommandErrorCollection] a new instance of CommandErrorCollection
- #
- # source://redis//lib/redis/errors.rb#76
- def initialize(errors, error_message = T.unsafe(nil)); end
-
- # Returns the value of attribute errors.
- #
- # source://redis//lib/redis/errors.rb#72
- def errors; end
-end
-
-# Load details about Redis commands for Redis Cluster Client
-#
-# @see https://redis.io/commands/command
-#
-# source://redis//lib/redis/cluster/command_loader.rb#9
-module Redis::Cluster::CommandLoader
- private
-
- # source://redis//lib/redis/cluster/command_loader.rb#24
- def fetch_command_details(node); end
-
- # source://redis//lib/redis/cluster/command_loader.rb#12
- def load(nodes); end
-
class << self
- # @raise [InitialSetupError]
- #
- # source://redis//lib/redis/cluster/command_loader.rb#12
- def load(nodes); end
+ # source://redis//lib/redis/client.rb#22
+ def config(**kwargs); end
- private
+ # source://redis//lib/redis/client.rb#26
+ def sentinel(**kwargs); end
- # source://redis//lib/redis/cluster/command_loader.rb#24
- def fetch_command_details(node); end
- end
-end
-
-# Raised when commands in pipelining include cross slot keys.
-#
-# source://redis//lib/redis/errors.rb#90
-class Redis::Cluster::CrossSlotPipeliningError < ::Redis::BaseError
- # @return [CrossSlotPipeliningError] a new instance of CrossSlotPipeliningError
- #
- # source://redis//lib/redis/errors.rb#91
- def initialize(keys); end
-end
-
-# Raised when client connected to redis as cluster mode
-# and failed to fetch cluster state information by commands.
-#
-# source://redis//lib/redis/errors.rb#50
-class Redis::Cluster::InitialSetupError < ::Redis::BaseError
- # @param errors [Array]
- # @return [InitialSetupError] a new instance of InitialSetupError
- #
- # source://redis//lib/redis/errors.rb#52
- def initialize(errors); end
-end
-
-# source://redis//lib/redis/cluster/key_slot_converter.rb#17
-module Redis::Cluster::KeySlotConverter
- private
-
- # Convert key into slot.
- #
- # @param key [String] the key of the redis command
- # @return [Integer] slot number
- #
- # source://redis//lib/redis/cluster/key_slot_converter.rb#62
- def convert(key); end
-
- class << self
- # Convert key into slot.
- #
- # @param key [String] the key of the redis command
- # @return [Integer] slot number
+ # @raise [redis_error]
#
- # source://redis//lib/redis/cluster/key_slot_converter.rb#62
- def convert(key); end
- end
-end
-
-# source://redis//lib/redis/cluster/key_slot_converter.rb#53
-Redis::Cluster::KeySlotConverter::HASH_SLOTS = T.let(T.unsafe(nil), Integer)
-
-# source://redis//lib/redis/cluster/key_slot_converter.rb#18
-Redis::Cluster::KeySlotConverter::XMODEM_CRC16_LOOKUP = T.let(T.unsafe(nil), Array)
-
-# Keep client list of node for Redis Cluster Client
-#
-# source://redis//lib/redis/cluster/node.rb#8
-class Redis::Cluster::Node
- include ::Enumerable
-
- # @return [Node] a new instance of Node
- #
- # source://redis//lib/redis/cluster/node.rb#15
- def initialize(options, node_flags = T.unsafe(nil), with_replica = T.unsafe(nil)); end
-
- # source://redis//lib/redis/cluster/node.rb#35
- def call_all(command, &block); end
-
- # source://redis//lib/redis/cluster/node.rb#39
- def call_master(command, &block); end
-
- # source://redis//lib/redis/cluster/node.rb#47
- def call_slave(command, &block); end
-
- # source://redis//lib/redis/cluster/node.rb#21
- def each(&block); end
-
- # source://redis//lib/redis/cluster/node.rb#29
- def find_by(node_key); end
-
- # source://redis//lib/redis/cluster/node.rb#57
- def process_all(commands, &block); end
-
- # source://redis//lib/redis/cluster/node.rb#25
- def sample; end
-
- # source://redis//lib/redis/cluster/node.rb#61
- def scale_reading_clients; end
-
- private
-
- # source://redis//lib/redis/cluster/node.rb#87
- def build_clients(options); end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/cluster/node.rb#79
- def master?(node_key); end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/cluster/node.rb#75
- def replica_disabled?; end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/cluster/node.rb#83
- def slave?(node_key); end
-
- # @raise [CommandErrorCollection]
- #
- # source://redis//lib/redis/cluster/node.rb#100
- def try_map; end
-end
-
-# source://redis//lib/redis/cluster/node.rb#13
-Redis::Cluster::Node::ROLE_SLAVE = T.let(T.unsafe(nil), String)
-
-# source://redis//lib/redis/cluster/node.rb#11
-class Redis::Cluster::Node::ReloadNeeded < ::StandardError; end
-
-# Node key's format is `:`.
-# It is different from node id.
-# Node id is internal identifying code in Redis Cluster.
-#
-# source://redis//lib/redis/cluster/node_key.rb#8
-module Redis::Cluster::NodeKey
- private
-
- # source://redis//lib/redis/cluster/node_key.rb#26
- def build_from_host_port(host, port); end
-
- # source://redis//lib/redis/cluster/node_key.rb#22
- def build_from_uri(uri); end
-
- # source://redis//lib/redis/cluster/node_key.rb#13
- def optionize(node_key); end
-
- # source://redis//lib/redis/cluster/node_key.rb#18
- def split(node_key); end
-
- class << self
- # source://redis//lib/redis/cluster/node_key.rb#26
- def build_from_host_port(host, port); end
-
- # source://redis//lib/redis/cluster/node_key.rb#22
- def build_from_uri(uri); end
-
- # source://redis//lib/redis/cluster/node_key.rb#13
- def optionize(node_key); end
-
- # source://redis//lib/redis/cluster/node_key.rb#18
- def split(node_key); end
- end
-end
-
-# source://redis//lib/redis/cluster/node_key.rb#9
-Redis::Cluster::NodeKey::DELIMITER = T.let(T.unsafe(nil), String)
-
-# Load and hashify node info for Redis Cluster Client
-#
-# source://redis//lib/redis/cluster/node_loader.rb#8
-module Redis::Cluster::NodeLoader
- private
-
- # source://redis//lib/redis/cluster/node_loader.rb#23
- def fetch_node_info(node); end
-
- # source://redis//lib/redis/cluster/node_loader.rb#11
- def load_flags(nodes); end
-
- class << self
- # @raise [InitialSetupError]
- #
- # source://redis//lib/redis/cluster/node_loader.rb#11
- def load_flags(nodes); end
+ # source://redis//lib/redis/client.rb#30
+ def translate_error!(error, mapping: T.unsafe(nil)); end
private
- # source://redis//lib/redis/cluster/node_loader.rb#23
- def fetch_node_info(node); end
+ # source://redis//lib/redis/client.rb#37
+ def translate_error_class(error_class, mapping: T.unsafe(nil)); end
end
end
-# Keep options for Redis Cluster Client
-#
-# source://redis//lib/redis/cluster/option.rb#10
-class Redis::Cluster::Option
- # @return [Option] a new instance of Option
- #
- # source://redis//lib/redis/cluster/option.rb#15
- def initialize(options); end
-
- # source://redis//lib/redis/cluster/option.rb#44
- def add_node(host, port); end
-
- # source://redis//lib/redis/cluster/option.rb#27
- def per_node_key; end
-
- # source://redis//lib/redis/cluster/option.rb#40
- def update_node(addrs); end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/cluster/option.rb#36
- def use_replica?; end
-
- private
-
- # Redis cluster node returns only host and port information.
- # So we should complement additional information such as:
- # scheme, username, password and so on.
- #
- # source://redis//lib/redis/cluster/option.rb#93
- def add_common_node_option_if_needed(options, node_opts, key); end
-
- # @raise [InvalidClientOptionError]
- #
- # source://redis//lib/redis/cluster/option.rb#50
- def build_node_options(addrs); end
-
- # source://redis//lib/redis/cluster/option.rb#56
- def parse_node_addr(addr); end
-
- # source://redis//lib/redis/cluster/option.rb#81
- def parse_node_option(addr); end
-
- # source://redis//lib/redis/cluster/option.rb#67
- def parse_node_url(addr); end
-end
-
-# source://redis//lib/redis/cluster/option.rb#11
-Redis::Cluster::Option::DEFAULT_SCHEME = T.let(T.unsafe(nil), String)
-
-# source://redis//lib/redis/cluster/option.rb#12
-Redis::Cluster::Option::SECURE_SCHEME = T.let(T.unsafe(nil), String)
-
-# source://redis//lib/redis/cluster/option.rb#13
-Redis::Cluster::Option::VALID_SCHEMES = T.let(T.unsafe(nil), Array)
-
-# Raised when client connected to redis as cluster mode
-# and some cluster subcommands were called.
-#
-# source://redis//lib/redis/errors.rb#59
-class Redis::Cluster::OrchestrationCommandNotSupported < ::Redis::BaseError
- # @return [OrchestrationCommandNotSupported] a new instance of OrchestrationCommandNotSupported
- #
- # source://redis//lib/redis/errors.rb#60
- def initialize(command, subcommand = T.unsafe(nil)); end
-end
-
-# Keep slot and node key map for Redis Cluster Client
-#
-# source://redis//lib/redis/cluster/slot.rb#6
-class Redis::Cluster::Slot
- # @return [Slot] a new instance of Slot
- #
- # source://redis//lib/redis/cluster/slot.rb#9
- def initialize(available_slots, node_flags = T.unsafe(nil), with_replica = T.unsafe(nil)); end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/cluster/slot.rb#15
- def exists?(slot); end
-
- # source://redis//lib/redis/cluster/slot.rb#19
- def find_node_key_of_master(slot); end
-
- # source://redis//lib/redis/cluster/slot.rb#25
- def find_node_key_of_slave(slot); end
-
- # source://redis//lib/redis/cluster/slot.rb#32
- def put(slot, node_key); end
-
- private
-
- # available_slots is mapping of node_key to list of slot ranges
- #
- # source://redis//lib/redis/cluster/slot.rb#61
- def build_slot_node_key_map(available_slots); end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/cluster/slot.rb#52
- def master?(node_key); end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/cluster/slot.rb#48
- def replica_disabled?; end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/cluster/slot.rb#56
- def slave?(node_key); end
-end
-
-# source://redis//lib/redis/cluster/slot.rb#7
-Redis::Cluster::Slot::ROLE_SLAVE = T.let(T.unsafe(nil), String)
-
-# Load and hashify slot info for Redis Cluster Client
-#
-# source://redis//lib/redis/cluster/slot_loader.rb#9
-module Redis::Cluster::SlotLoader
- private
-
- # source://redis//lib/redis/cluster/slot_loader.rb#24
- def fetch_slot_info(node); end
-
- # source://redis//lib/redis/cluster/slot_loader.rb#12
- def load(nodes); end
-
- # source://redis//lib/redis/cluster/slot_loader.rb#31
- def parse_slot_info(arr, default_ip:); end
-
- # source://redis//lib/redis/cluster/slot_loader.rb#37
- def stringify_node_key(arr, default_ip); end
-
- class << self
- # @raise [InitialSetupError]
- #
- # source://redis//lib/redis/cluster/slot_loader.rb#12
- def load(nodes); end
-
- private
-
- # source://redis//lib/redis/cluster/slot_loader.rb#24
- def fetch_slot_info(node); end
-
- # source://redis//lib/redis/cluster/slot_loader.rb#31
- def parse_slot_info(arr, default_ip:); end
-
- # source://redis//lib/redis/cluster/slot_loader.rb#37
- def stringify_node_key(arr, default_ip); end
- end
-end
+# source://redis//lib/redis/client.rb#7
+Redis::Client::ERROR_MAPPING = T.let(T.unsafe(nil), Hash)
# Raised by the client when command execution returns an error reply.
#
@@ -1015,7 +258,7 @@ module Redis::Commands
#
# Redis error replies are raised as Ruby exceptions.
#
- # source://redis//lib/redis/commands.rb#205
+ # source://redis//lib/redis/commands.rb#202
def call(*command); end
# Interact with the sentinel command (masters, master, slaves, failover)
@@ -1024,12 +267,12 @@ module Redis::Commands
# @param args [Array] depends on subcommand
# @return [Array, Hash, String] depends on subcommand
#
- # source://redis//lib/redis/commands.rb#214
+ # source://redis//lib/redis/commands.rb#211
def sentinel(subcommand, *args); end
private
- # source://redis//lib/redis/commands.rb#236
+ # source://redis//lib/redis/commands.rb#233
def method_missing(*command); end
end
@@ -1040,10 +283,12 @@ module Redis::Commands::Bitmaps
# @param key [String]
# @param start [Integer] start index
# @param stop [Integer] stop index
+ # @param scale [String, Symbol] the scale of the offset range
+ # e.g. 'BYTE' - interpreted as a range of bytes, 'BIT' - interpreted as a range of bits
# @return [Integer] the number of bits set to 1
#
- # source://redis//lib/redis/commands/bitmaps.rb#31
- def bitcount(key, start = T.unsafe(nil), stop = T.unsafe(nil)); end
+ # source://redis//lib/redis/commands/bitmaps.rb#33
+ def bitcount(key, start = T.unsafe(nil), stop = T.unsafe(nil), scale: T.unsafe(nil)); end
# Perform a bitwise operation between strings and store the resulting string in a key.
#
@@ -1052,7 +297,7 @@ module Redis::Commands::Bitmaps
# @param keys [String, Array] one or more source keys to perform `operation`
# @return [Integer] the length of the string stored in `destkey`
#
- # source://redis//lib/redis/commands/bitmaps.rb#41
+ # source://redis//lib/redis/commands/bitmaps.rb#45
def bitop(operation, destkey, *keys); end
# Return the position of the first bit set to 1 or 0 in a string.
@@ -1061,12 +306,14 @@ module Redis::Commands::Bitmaps
# @param bit [Integer] whether to look for the first 1 or 0 bit
# @param start [Integer] start index
# @param stop [Integer] stop index
+ # @param scale [String, Symbol] the scale of the offset range
+ # e.g. 'BYTE' - interpreted as a range of bytes, 'BIT' - interpreted as a range of bits
# @raise [ArgumentError]
# @return [Integer] the position of the first 1/0 bit.
# -1 if looking for 1 and it is not found or start and stop are given.
#
- # source://redis//lib/redis/commands/bitmaps.rb#53
- def bitpos(key, bit, start = T.unsafe(nil), stop = T.unsafe(nil)); end
+ # source://redis//lib/redis/commands/bitmaps.rb#62
+ def bitpos(key, bit, start = T.unsafe(nil), stop = T.unsafe(nil), scale: T.unsafe(nil)); end
# Returns the bit value at offset in the string value stored at key.
#
@@ -1095,7 +342,7 @@ end
# source://redis//lib/redis/commands.rb#42
Redis::Commands::Boolify = T.let(T.unsafe(nil), Proc)
-# source://redis//lib/redis/commands.rb#51
+# source://redis//lib/redis/commands.rb#46
Redis::Commands::BoolifySet = T.let(T.unsafe(nil), Proc)
# source://redis//lib/redis/commands/cluster.rb#5
@@ -1105,7 +352,7 @@ module Redis::Commands::Cluster
# @return [String] `'OK'`
# @see https://redis.io/topics/cluster-spec#ask-redirection ASK redirection
#
- # source://redis//lib/redis/commands/cluster.rb#40
+ # source://redis//lib/redis/commands/cluster.rb#23
def asking; end
# Sends `CLUSTER *` command to random node and returns its reply.
@@ -1151,7 +398,7 @@ module Redis::Commands::Connection
#
# @return [String] `OK`
#
- # source://redis//lib/redis/commands/connection.rb#46
+ # source://redis//lib/redis/commands/connection.rb#43
def quit; end
# Change the selected database for the current connection.
@@ -1163,13 +410,13 @@ module Redis::Commands::Connection
def select(db); end
end
-# source://redis//lib/redis/commands.rb#115
+# source://redis//lib/redis/commands.rb#110
Redis::Commands::EMPTY_STREAM_RESPONSE = T.let(T.unsafe(nil), Array)
-# source://redis//lib/redis/commands.rb#78
+# source://redis//lib/redis/commands.rb#73
Redis::Commands::Floatify = T.let(T.unsafe(nil), Proc)
-# source://redis//lib/redis/commands.rb#91
+# source://redis//lib/redis/commands.rb#86
Redis::Commands::FloatifyPairs = T.let(T.unsafe(nil), Proc)
# source://redis//lib/redis/commands/geo.rb#5
@@ -1252,7 +499,7 @@ module Redis::Commands::Hashes
# @param field [String, Array]
# @return [Integer] the number of fields that were removed from the hash
#
- # source://redis//lib/redis/commands/hashes.rb#154
+ # source://redis//lib/redis/commands/hashes.rb#156
def hdel(key, *fields); end
# Determine if a hash field exists.
@@ -1261,7 +508,7 @@ module Redis::Commands::Hashes
# @param field [String]
# @return [Boolean] whether or not the field exists in the hash
#
- # source://redis//lib/redis/commands/hashes.rb#163
+ # source://redis//lib/redis/commands/hashes.rb#166
def hexists(key, field); end
# Get the value of a hash field.
@@ -1278,7 +525,7 @@ module Redis::Commands::Hashes
# @param key [String]
# @return [Hash]
#
- # source://redis//lib/redis/commands/hashes.rb#207
+ # source://redis//lib/redis/commands/hashes.rb#210
def hgetall(key); end
# Increment the integer value of a hash field by the given integer number.
@@ -1288,7 +535,7 @@ module Redis::Commands::Hashes
# @param increment [Integer]
# @return [Integer] value of the field after incrementing it
#
- # source://redis//lib/redis/commands/hashes.rb#173
+ # source://redis//lib/redis/commands/hashes.rb#176
def hincrby(key, field, increment); end
# Increment the numeric value of a hash field by the given float number.
@@ -1298,7 +545,7 @@ module Redis::Commands::Hashes
# @param increment [Float]
# @return [Float] value of the field after incrementing it
#
- # source://redis//lib/redis/commands/hashes.rb#183
+ # source://redis//lib/redis/commands/hashes.rb#186
def hincrbyfloat(key, field, increment); end
# Get all the fields in a hash.
@@ -1306,7 +553,7 @@ module Redis::Commands::Hashes
# @param key [String]
# @return [Array]
#
- # source://redis//lib/redis/commands/hashes.rb#191
+ # source://redis//lib/redis/commands/hashes.rb#194
def hkeys(key); end
# Get the number of fields in a hash.
@@ -1362,7 +609,7 @@ module Redis::Commands::Hashes
# - when `count` is specified and `:with_values` is not specified, an array of field names
# - when `:with_values` is specified, an array with `[field, value]` pairs
#
- # source://redis//lib/redis/commands/hashes.rb#136
+ # source://redis//lib/redis/commands/hashes.rb#138
def hrandfield(key, count = T.unsafe(nil), withvalues: T.unsafe(nil), with_values: T.unsafe(nil)); end
# Scan a hash
@@ -1374,7 +621,7 @@ module Redis::Commands::Hashes
# - `:count => Integer`: return count keys at most per iteration
# @return [String, Array<[String, String]>] the next cursor and all found keys
#
- # source://redis//lib/redis/commands/hashes.rb#222
+ # source://redis//lib/redis/commands/hashes.rb#225
def hscan(key, cursor, **options); end
# Scan a hash
@@ -1386,7 +633,7 @@ module Redis::Commands::Hashes
# - `:count => Integer`: return count keys at most per iteration
# @return [Enumerator] an enumerator for all found keys
#
- # source://redis//lib/redis/commands/hashes.rb#239
+ # source://redis//lib/redis/commands/hashes.rb#242
def hscan_each(key, **options, &block); end
# Set one or more hash values.
@@ -1416,7 +663,7 @@ module Redis::Commands::Hashes
# @param key [String]
# @return [Array]
#
- # source://redis//lib/redis/commands/hashes.rb#199
+ # source://redis//lib/redis/commands/hashes.rb#202
def hvals(key); end
# Get the values of all the given hash fields.
@@ -1429,7 +676,7 @@ module Redis::Commands::Hashes
# @return [Hash] a hash mapping the specified fields to their values
# @see #hmget
#
- # source://redis//lib/redis/commands/hashes.rb#104
+ # source://redis//lib/redis/commands/hashes.rb#105
def mapped_hmget(key, *fields); end
# Set one or more hash values.
@@ -1446,40 +693,40 @@ module Redis::Commands::Hashes
def mapped_hmset(key, hash); end
end
-# source://redis//lib/redis/commands.rb#62
+# source://redis//lib/redis/commands.rb#57
Redis::Commands::Hashify = T.let(T.unsafe(nil), Proc)
-# source://redis//lib/redis/commands.rb#158
+# source://redis//lib/redis/commands.rb#155
Redis::Commands::HashifyClusterNodeInfo = T.let(T.unsafe(nil), Proc)
-# source://redis//lib/redis/commands.rb#187
+# source://redis//lib/redis/commands.rb#184
Redis::Commands::HashifyClusterNodes = T.let(T.unsafe(nil), Proc)
-# source://redis//lib/redis/commands.rb#191
+# source://redis//lib/redis/commands.rb#188
Redis::Commands::HashifyClusterSlaves = T.let(T.unsafe(nil), Proc)
-# source://redis//lib/redis/commands.rb#173
+# source://redis//lib/redis/commands.rb#170
Redis::Commands::HashifyClusterSlots = T.let(T.unsafe(nil), Proc)
-# source://redis//lib/redis/commands.rb#99
+# source://redis//lib/redis/commands.rb#94
Redis::Commands::HashifyInfo = T.let(T.unsafe(nil), Proc)
-# source://redis//lib/redis/commands.rb#124
+# source://redis//lib/redis/commands.rb#119
Redis::Commands::HashifyStreamAutoclaim = T.let(T.unsafe(nil), Proc)
-# source://redis//lib/redis/commands.rb#131
+# source://redis//lib/redis/commands.rb#128
Redis::Commands::HashifyStreamAutoclaimJustId = T.let(T.unsafe(nil), Proc)
-# source://redis//lib/redis/commands.rb#118
+# source://redis//lib/redis/commands.rb#113
Redis::Commands::HashifyStreamEntries = T.let(T.unsafe(nil), Proc)
-# source://redis//lib/redis/commands.rb#147
+# source://redis//lib/redis/commands.rb#144
Redis::Commands::HashifyStreamPendingDetails = T.let(T.unsafe(nil), Proc)
-# source://redis//lib/redis/commands.rb#138
+# source://redis//lib/redis/commands.rb#135
Redis::Commands::HashifyStreamPendings = T.let(T.unsafe(nil), Proc)
-# source://redis//lib/redis/commands.rb#106
+# source://redis//lib/redis/commands.rb#101
Redis::Commands::HashifyStreams = T.let(T.unsafe(nil), Proc)
# source://redis//lib/redis/commands/hyper_log_log.rb#5
@@ -1517,9 +764,6 @@ end
# source://redis//lib/redis/commands/keys.rb#5
module Redis::Commands::Keys
- # source://redis//lib/redis/commands/keys.rb#269
- def _exists(*keys); end
-
# Copy a value from one key to another.
#
# @example Copy a value to another key
@@ -1544,7 +788,7 @@ module Redis::Commands::Keys
# @param replace [Boolean] removes the `destination` key before copying value to it
# @return [Boolean] whether the key was copied or not
#
- # source://redis//lib/redis/commands/keys.rb#345
+ # source://redis//lib/redis/commands/keys.rb#343
def copy(source, destination, db: T.unsafe(nil), replace: T.unsafe(nil)); end
# Delete one or more keys.
@@ -1552,7 +796,7 @@ module Redis::Commands::Keys
# @param keys [String, Array]
# @return [Integer] number of keys that were deleted
#
- # source://redis//lib/redis/commands/keys.rb#232
+ # source://redis//lib/redis/commands/keys.rb#248
def del(*keys); end
# Return a serialized version of the value stored at a key.
@@ -1560,7 +804,7 @@ module Redis::Commands::Keys
# @param key [String]
# @return [String] serialized_value
#
- # source://redis//lib/redis/commands/keys.rb#183
+ # source://redis//lib/redis/commands/keys.rb#199
def dump(key); end
# Determine how many of the keys exists.
@@ -1568,7 +812,7 @@ module Redis::Commands::Keys
# @param keys [String, Array]
# @return [Integer]
#
- # source://redis//lib/redis/commands/keys.rb#251
+ # source://redis//lib/redis/commands/keys.rb#267
def exists(*keys); end
# Determine if any of the keys exists.
@@ -1576,7 +820,7 @@ module Redis::Commands::Keys
# @param keys [String, Array]
# @return [Boolean]
#
- # source://redis//lib/redis/commands/keys.rb#277
+ # source://redis//lib/redis/commands/keys.rb#275
def exists?(*keys); end
# Set a key's time to live in seconds.
@@ -1605,12 +849,20 @@ module Redis::Commands::Keys
# source://redis//lib/redis/commands/keys.rb#98
def expireat(key, unix_time, nx: T.unsafe(nil), xx: T.unsafe(nil), gt: T.unsafe(nil), lt: T.unsafe(nil)); end
+ # Get a key's expiry time specified as number of seconds from UNIX Epoch
+ #
+ # @param key [String]
+ # @return [Integer] expiry time specified as number of seconds from UNIX Epoch
+ #
+ # source://redis//lib/redis/commands/keys.rb#112
+ def expiretime(key); end
+
# Find all keys matching the given pattern.
#
# @param pattern [String]
# @return [Array]
#
- # source://redis//lib/redis/commands/keys.rb#287
+ # source://redis//lib/redis/commands/keys.rb#285
def keys(pattern = T.unsafe(nil)); end
# Transfer a key from the connected instance to another instance.
@@ -1624,7 +876,7 @@ module Redis::Commands::Keys
# - `:replace => Boolean`: Replace existing key on the remote instance.
# @return [String] `"OK"`
#
- # source://redis//lib/redis/commands/keys.rb#214
+ # source://redis//lib/redis/commands/keys.rb#230
def migrate(key, options); end
# Move a key to another database.
@@ -1646,10 +898,10 @@ module Redis::Commands::Keys
# @param db [Integer]
# @return [Boolean] whether the key was moved or not
#
- # source://redis//lib/redis/commands/keys.rb#316
+ # source://redis//lib/redis/commands/keys.rb#314
def move(key, db); end
- # source://redis//lib/redis/commands/keys.rb#353
+ # source://redis//lib/redis/commands/keys.rb#351
def object(*args); end
# Remove the expiration from a key.
@@ -1670,7 +922,7 @@ module Redis::Commands::Keys
# - `:lt => true`: Set expiry only when the new expiry is less than current one.
# @return [Boolean] whether the timeout was set or not
#
- # source://redis//lib/redis/commands/keys.rb#134
+ # source://redis//lib/redis/commands/keys.rb#142
def pexpire(key, milliseconds, nx: T.unsafe(nil), xx: T.unsafe(nil), gt: T.unsafe(nil), lt: T.unsafe(nil)); end
# Set the expiration for a key as number of milliseconds from UNIX Epoch.
@@ -1683,9 +935,17 @@ module Redis::Commands::Keys
# - `:lt => true`: Set expiry only when the new expiry is less than current one.
# @return [Boolean] whether the timeout was set or not
#
- # source://redis//lib/redis/commands/keys.rb#154
+ # source://redis//lib/redis/commands/keys.rb#162
def pexpireat(key, ms_unix_time, nx: T.unsafe(nil), xx: T.unsafe(nil), gt: T.unsafe(nil), lt: T.unsafe(nil)); end
+ # Get a key's expiry time specified as number of milliseconds from UNIX Epoch
+ #
+ # @param key [String]
+ # @return [Integer] expiry time specified as number of milliseconds from UNIX Epoch
+ #
+ # source://redis//lib/redis/commands/keys.rb#176
+ def pexpiretime(key); end
+
# Get the time to live (in milliseconds) for a key.
#
# In Redis 2.6 or older the command returns -1 if the key does not exist or if
@@ -1699,14 +959,14 @@ module Redis::Commands::Keys
# @param key [String]
# @return [Integer] remaining time to live in milliseconds
#
- # source://redis//lib/redis/commands/keys.rb#175
+ # source://redis//lib/redis/commands/keys.rb#191
def pttl(key); end
# Return a random key from the keyspace.
#
# @return [String]
#
- # source://redis//lib/redis/commands/keys.rb#360
+ # source://redis//lib/redis/commands/keys.rb#358
def randomkey; end
# Rename a key. If the new key already exists it is overwritten.
@@ -1715,7 +975,7 @@ module Redis::Commands::Keys
# @param new_name [String]
# @return [String] `OK`
#
- # source://redis//lib/redis/commands/keys.rb#369
+ # source://redis//lib/redis/commands/keys.rb#367
def rename(old_name, new_name); end
# Rename a key, only if the new key does not exist.
@@ -1724,7 +984,7 @@ module Redis::Commands::Keys
# @param new_name [String]
# @return [Boolean] whether the key was renamed or not
#
- # source://redis//lib/redis/commands/keys.rb#378
+ # source://redis//lib/redis/commands/keys.rb#376
def renamenx(old_name, new_name); end
# Create a key using the serialized value, previously obtained using DUMP.
@@ -1736,7 +996,7 @@ module Redis::Commands::Keys
# @raise [Redis::CommandError]
# @return [String] `"OK"`
#
- # source://redis//lib/redis/commands/keys.rb#196
+ # source://redis//lib/redis/commands/keys.rb#212
def restore(key, ttl, serialized_value, replace: T.unsafe(nil)); end
# Scan the keyspace
@@ -1802,7 +1062,7 @@ module Redis::Commands::Keys
# element specified in `:get`
# - when `:store` is specified, the number of elements in the stored result
#
- # source://redis//lib/redis/commands/keys.rb#407
+ # source://redis//lib/redis/commands/keys.rb#405
def sort(key, by: T.unsafe(nil), limit: T.unsafe(nil), get: T.unsafe(nil), order: T.unsafe(nil), store: T.unsafe(nil)); end
# Get the time to live (in seconds) for a key.
@@ -1818,7 +1078,7 @@ module Redis::Commands::Keys
# @param key [String]
# @return [Integer] remaining time to live in seconds.
#
- # source://redis//lib/redis/commands/keys.rb#120
+ # source://redis//lib/redis/commands/keys.rb#128
def ttl(key); end
# Determine the type stored at key.
@@ -1826,7 +1086,7 @@ module Redis::Commands::Keys
# @param key [String]
# @return [String] `string`, `list`, `set`, `zset`, `hash` or `none`
#
- # source://redis//lib/redis/commands/keys.rb#437
+ # source://redis//lib/redis/commands/keys.rb#435
def type(key); end
# Unlink one or more keys.
@@ -1834,12 +1094,12 @@ module Redis::Commands::Keys
# @param keys [String, Array]
# @return [Integer] number of keys that were unlinked
#
- # source://redis//lib/redis/commands/keys.rb#243
+ # source://redis//lib/redis/commands/keys.rb#259
def unlink(*keys); end
private
- # source://redis//lib/redis/commands/keys.rb#443
+ # source://redis//lib/redis/commands/keys.rb#441
def _scan(command, cursor, args, match: T.unsafe(nil), count: T.unsafe(nil), type: T.unsafe(nil), &block); end
end
@@ -1861,12 +1121,27 @@ module Redis::Commands::Lists
# e.g. 'LEFT' - from head, 'RIGHT' - from tail
# @param where_destination [String, Symbol] where to push the element to the source list
# e.g. 'LEFT' - to head, 'RIGHT' - to tail
- # @param options [Hash] - `:timeout => Numeric`: timeout in seconds, defaults to no timeout
+ # @param options [Hash] - `:timeout => [Float, Integer]`: timeout in seconds, defaults to no timeout
# @return [nil, String] the element, or nil when the source key does not exist or the timeout expired
#
# source://redis//lib/redis/commands/lists.rb#55
def blmove(source, destination, where_source, where_destination, timeout: T.unsafe(nil)); end
+ # Pops one or more elements from the first non-empty list key from the list
+ # of provided key names. If lists are empty, blocks until timeout has passed.
+ #
+ # @example Popping a element
+ # redis.blmpop(1.0, 'list')
+ # #=> ['list', ['a']]
+ # @example With count option
+ # redis.blmpop(1.0, 'list', count: 2)
+ # #=> ['list', ['a', 'b']]
+ # @raise [ArgumentError]
+ # @return [Array>] list of popped elements or nil
+ #
+ # source://redis//lib/redis/commands/lists.rb#205
+ def blmpop(timeout, *keys, modifier: T.unsafe(nil), count: T.unsafe(nil)); end
+
# Remove and get the first element in a list, or block until one is available.
#
# @example With timeout
@@ -1881,7 +1156,7 @@ module Redis::Commands::Lists
# # => ["list", "element"]
# @param keys [String, Array] one or more keys to perform the
# blocking pop on
- # @param options [Hash] - `:timeout => Integer`: timeout in seconds, defaults to no timeout
+ # @param options [Hash] - `:timeout => [Float, Integer]`: timeout in seconds, defaults to no timeout
# @return [nil, [String, String]] - `nil` when the operation timed out
# - tuple of the list that was popped from and element was popped otherwise
#
@@ -1892,7 +1167,7 @@ module Redis::Commands::Lists
#
# @param keys [String, Array] one or more keys to perform the
# blocking pop on
- # @param options [Hash] - `:timeout => Integer`: timeout in seconds, defaults to no timeout
+ # @param options [Hash] - `:timeout => [Float, Integer]`: timeout in seconds, defaults to no timeout
# @return [nil, [String, String]] - `nil` when the operation timed out
# - tuple of the list that was popped from and element was popped otherwise
# @see #blpop
@@ -1905,12 +1180,12 @@ module Redis::Commands::Lists
#
# @param source [String] source key
# @param destination [String] destination key
- # @param options [Hash] - `:timeout => Integer`: timeout in seconds, defaults to no timeout
+ # @param options [Hash] - `:timeout => [Float, Integer]`: timeout in seconds, defaults to no timeout
# @return [nil, String] - `nil` when the operation timed out
# - the element was popped and pushed otherwise
#
# source://redis//lib/redis/commands/lists.rb#181
- def brpoplpush(source, destination, deprecated_timeout = T.unsafe(nil), timeout: T.unsafe(nil)); end
+ def brpoplpush(source, destination, timeout: T.unsafe(nil)); end
# Get an element from a list by its index.
#
@@ -1918,7 +1193,7 @@ module Redis::Commands::Lists
# @param index [Integer]
# @return [String]
#
- # source://redis//lib/redis/commands/lists.rb#191
+ # source://redis//lib/redis/commands/lists.rb#245
def lindex(key, index); end
# Insert an element before or after another element in a list.
@@ -1930,7 +1205,7 @@ module Redis::Commands::Lists
# @return [Integer] length of the list after the insert operation, or `-1`
# when the element `pivot` was not found
#
- # source://redis//lib/redis/commands/lists.rb#203
+ # source://redis//lib/redis/commands/lists.rb#257
def linsert(key, where, pivot, value); end
# Get the length of a list.
@@ -1956,11 +1231,26 @@ module Redis::Commands::Lists
# source://redis//lib/redis/commands/lists.rb#27
def lmove(source, destination, where_source, where_destination); end
+ # Pops one or more elements from the first non-empty list key from the list
+ # of provided key names.
+ #
+ # @example Popping a element
+ # redis.lmpop('list')
+ # #=> ['list', ['a']]
+ # @example With count option
+ # redis.lmpop('list', count: 2)
+ # #=> ['list', ['a', 'b']]
+ # @raise [ArgumentError]
+ # @return [Array>] list of popped elements or nil
+ #
+ # source://redis//lib/redis/commands/lists.rb#231
+ def lmpop(*keys, modifier: T.unsafe(nil), count: T.unsafe(nil)); end
+
# Remove and get the first elements in a list.
#
# @param key [String]
# @param count [Integer] number of elements to remove
- # @return [String, Array] the values of the first elements
+ # @return [nil, String, Array] the values of the first elements
#
# source://redis//lib/redis/commands/lists.rb#103
def lpop(key, count = T.unsafe(nil)); end
@@ -1990,7 +1280,7 @@ module Redis::Commands::Lists
# @param stop [Integer] stop index
# @return [Array]
#
- # source://redis//lib/redis/commands/lists.rb#213
+ # source://redis//lib/redis/commands/lists.rb#267
def lrange(key, start, stop); end
# Remove elements from a list.
@@ -2003,7 +1293,7 @@ module Redis::Commands::Lists
# @param value [String]
# @return [Integer] the number of removed elements
#
- # source://redis//lib/redis/commands/lists.rb#226
+ # source://redis//lib/redis/commands/lists.rb#280
def lrem(key, count, value); end
# Set the value of an element in a list by its index.
@@ -2013,7 +1303,7 @@ module Redis::Commands::Lists
# @param value [String]
# @return [String] `OK`
#
- # source://redis//lib/redis/commands/lists.rb#236
+ # source://redis//lib/redis/commands/lists.rb#290
def lset(key, index, value); end
# Trim a list to the specified range.
@@ -2023,14 +1313,14 @@ module Redis::Commands::Lists
# @param stop [Integer] stop index
# @return [String] `OK`
#
- # source://redis//lib/redis/commands/lists.rb#246
+ # source://redis//lib/redis/commands/lists.rb#300
def ltrim(key, start, stop); end
# Remove and get the last elements in a list.
#
# @param key [String]
# @param count [Integer] number of elements to remove
- # @return [String, Array] the values of the last elements
+ # @return [nil, String, Array] the values of the last elements
#
# source://redis//lib/redis/commands/lists.rb#114
def rpop(key, count = T.unsafe(nil)); end
@@ -2064,30 +1354,30 @@ module Redis::Commands::Lists
private
- # source://redis//lib/redis/commands/lists.rb#252
+ # source://redis//lib/redis/commands/lists.rb#306
def _bpop(cmd, args, &blk); end
- # source://redis//lib/redis/commands/lists.rb#274
+ # source://redis//lib/redis/commands/lists.rb#323
def _normalize_move_wheres(where_source, where_destination); end
end
-# source://redis//lib/redis/commands.rb#195
+# source://redis//lib/redis/commands.rb#192
Redis::Commands::Noop = T.let(T.unsafe(nil), Proc)
-# source://redis//lib/redis/commands.rb#70
+# source://redis//lib/redis/commands.rb#65
Redis::Commands::Pairify = T.let(T.unsafe(nil), Proc)
# source://redis//lib/redis/commands/pubsub.rb#5
module Redis::Commands::Pubsub
# Listen for messages published to channels matching the given patterns.
#
- # source://redis//lib/redis/commands/pubsub.rb#42
+ # source://redis//lib/redis/commands/pubsub.rb#32
def psubscribe(*channels, &block); end
# Listen for messages published to channels matching the given patterns.
# Throw a timeout error if there is no messages for a timeout period.
#
- # source://redis//lib/redis/commands/pubsub.rb#50
+ # source://redis//lib/redis/commands/pubsub.rb#38
def psubscribe_with_timeout(timeout, *channels, &block); end
# Post a message to a channel.
@@ -2098,23 +1388,39 @@ module Redis::Commands::Pubsub
# Inspect the state of the Pub/Sub subsystem.
# Possible subcommands: channels, numsub, numpat.
#
- # source://redis//lib/redis/commands/pubsub.rb#67
+ # source://redis//lib/redis/commands/pubsub.rb#49
def pubsub(subcommand, *args); end
# Stop listening for messages posted to channels matching the given patterns.
#
- # source://redis//lib/redis/commands/pubsub.rb#57
+ # source://redis//lib/redis/commands/pubsub.rb#43
def punsubscribe(*channels); end
+ # Post a message to a channel in a shard.
+ #
+ # source://redis//lib/redis/commands/pubsub.rb#54
+ def spublish(channel, message); end
+
+ # Listen for messages published to the given channels in a shard.
+ #
+ # source://redis//lib/redis/commands/pubsub.rb#59
+ def ssubscribe(*channels, &block); end
+
+ # Listen for messages published to the given channels in a shard.
+ # Throw a timeout error if there is no messages for a timeout period.
+ #
+ # source://redis//lib/redis/commands/pubsub.rb#65
+ def ssubscribe_with_timeout(timeout, *channels, &block); end
+
# Listen for messages published to the given channels.
#
- # source://redis//lib/redis/commands/pubsub.rb#18
+ # source://redis//lib/redis/commands/pubsub.rb#16
def subscribe(*channels, &block); end
# Listen for messages published to the given channels. Throw a timeout error
# if there is no messages for a timeout period.
#
- # source://redis//lib/redis/commands/pubsub.rb#26
+ # source://redis//lib/redis/commands/pubsub.rb#22
def subscribe_with_timeout(timeout, *channels, &block); end
# @return [Boolean]
@@ -2122,9 +1428,14 @@ module Redis::Commands::Pubsub
# source://redis//lib/redis/commands/pubsub.rb#11
def subscribed?; end
+ # Stop listening for messages posted to the given channels in a shard.
+ #
+ # source://redis//lib/redis/commands/pubsub.rb#70
+ def sunsubscribe(*channels); end
+
# Stop listening for messages posted to the given channels.
#
- # source://redis//lib/redis/commands/pubsub.rb#33
+ # source://redis//lib/redis/commands/pubsub.rb#27
def unsubscribe(*channels); end
end
@@ -2228,7 +1539,7 @@ module Redis::Commands::Server
# @return [String, Hash] depends on subcommand
#
# source://redis//lib/redis/commands/server.rb#39
- def client(subcommand = T.unsafe(nil), *args); end
+ def client(subcommand, *args); end
# Get or set server configuration parameters.
#
@@ -2288,23 +1599,23 @@ module Redis::Commands::Server
# @yieldparam line [String] timestamp and command that was executed
#
# source://redis//lib/redis/commands/server.rb#120
- def monitor(&block); end
+ def monitor; end
# Synchronously save the dataset to disk.
#
# @return [String]
#
- # source://redis//lib/redis/commands/server.rb#129
+ # source://redis//lib/redis/commands/server.rb#133
def save; end
# Synchronously save the dataset to disk and then shut down the server.
#
- # source://redis//lib/redis/commands/server.rb#134
+ # source://redis//lib/redis/commands/server.rb#138
def shutdown; end
# Make the server a slave of another instance, or promote it as master.
#
- # source://redis//lib/redis/commands/server.rb#148
+ # source://redis//lib/redis/commands/server.rb#150
def slaveof(host, port); end
# Interact with the slowlog (get, len, reset)
@@ -2313,7 +1624,7 @@ module Redis::Commands::Server
# @param length [Integer] maximum number of entries to return
# @return [Array, Integer, String] depends on subcommand
#
- # source://redis//lib/redis/commands/server.rb#157
+ # source://redis//lib/redis/commands/server.rb#159
def slowlog(subcommand, length = T.unsafe(nil)); end
# Internal command used for replication.
@@ -2338,22 +1649,19 @@ module Redis::Commands::Sets
#
# @param key [String]
# @param member [String, Array] one member, or array of members
- # @return [Boolean, Integer] `Boolean` when a single member is specified,
- # holding whether or not adding the member succeeded, or `Integer` when an
- # array of members is specified, holding the number of members that were
- # successfully added
+ # @return [Integer] The number of members that were successfully added
#
- # source://redis//lib/redis/commands/sets.rb#22
- def sadd(key, member); end
+ # source://redis//lib/redis/commands/sets.rb#19
+ def sadd(key, *members); end
# Add one or more members to a set.
#
# @param key [String]
# @param member [String, Array] one member, or array of members
- # @return [Boolean] Whether or not at least one member was added.
+ # @return [Boolean] Wether at least one member was successfully added.
#
- # source://redis//lib/redis/commands/sets.rb#38
- def sadd?(key, member); end
+ # source://redis//lib/redis/commands/sets.rb#29
+ def sadd?(key, *members); end
# Get the number of members in a set.
#
@@ -2368,7 +1676,7 @@ module Redis::Commands::Sets
# @param keys [String, Array] keys pointing to sets to subtract
# @return [Array] members in the difference
#
- # source://redis//lib/redis/commands/sets.rb#138
+ # source://redis//lib/redis/commands/sets.rb#123
def sdiff(*keys); end
# Subtract multiple sets and store the resulting set in a key.
@@ -2377,7 +1685,7 @@ module Redis::Commands::Sets
# @param keys [String, Array] keys pointing to sets to subtract
# @return [Integer] number of elements in the resulting set
#
- # source://redis//lib/redis/commands/sets.rb#147
+ # source://redis//lib/redis/commands/sets.rb#133
def sdiffstore(destination, *keys); end
# Intersect multiple sets.
@@ -2385,7 +1693,7 @@ module Redis::Commands::Sets
# @param keys [String, Array] keys pointing to sets to intersect
# @return [Array] members in the intersection
#
- # source://redis//lib/redis/commands/sets.rb#155
+ # source://redis//lib/redis/commands/sets.rb#142
def sinter(*keys); end
# Intersect multiple sets and store the resulting set in a key.
@@ -2394,7 +1702,7 @@ module Redis::Commands::Sets
# @param keys [String, Array] keys pointing to sets to intersect
# @return [Integer] number of elements in the resulting set
#
- # source://redis//lib/redis/commands/sets.rb#164
+ # source://redis//lib/redis/commands/sets.rb#152
def sinterstore(destination, *keys); end
# Determine if a given value is a member of a set.
@@ -2403,7 +1711,7 @@ module Redis::Commands::Sets
# @param member [String]
# @return [Boolean]
#
- # source://redis//lib/redis/commands/sets.rb#111
+ # source://redis//lib/redis/commands/sets.rb#95
def sismember(key, member); end
# Get all the members in a set.
@@ -2411,7 +1719,7 @@ module Redis::Commands::Sets
# @param key [String]
# @return [Array]
#
- # source://redis//lib/redis/commands/sets.rb#130
+ # source://redis//lib/redis/commands/sets.rb#115
def smembers(key); end
# Determine if multiple values are members of a set.
@@ -2420,7 +1728,7 @@ module Redis::Commands::Sets
# @param members [String, Array]
# @return [Array]
#
- # source://redis//lib/redis/commands/sets.rb#120
+ # source://redis//lib/redis/commands/sets.rb#104
def smismember(key, *members); end
# Move a member from one set to another.
@@ -2430,7 +1738,7 @@ module Redis::Commands::Sets
# @param member [String] member to move from `source` to `destination`
# @return [Boolean]
#
- # source://redis//lib/redis/commands/sets.rb#102
+ # source://redis//lib/redis/commands/sets.rb#86
def smove(source, destination, member); end
# Remove and return one or more random member from a set.
@@ -2439,7 +1747,7 @@ module Redis::Commands::Sets
# @param count [Integer]
# @return [String]
#
- # source://redis//lib/redis/commands/sets.rb#75
+ # source://redis//lib/redis/commands/sets.rb#59
def spop(key, count = T.unsafe(nil)); end
# Get one or more random members from a set.
@@ -2448,29 +1756,26 @@ module Redis::Commands::Sets
# @param count [Integer]
# @return [String]
#
- # source://redis//lib/redis/commands/sets.rb#88
+ # source://redis//lib/redis/commands/sets.rb#72
def srandmember(key, count = T.unsafe(nil)); end
# Remove one or more members from a set.
#
# @param key [String]
# @param member [String, Array] one member, or array of members
- # @return [Boolean, Integer] `Boolean` when a single member is specified,
- # holding whether or not removing the member succeeded, or `Integer` when an
- # array of members is specified, holding the number of members that were
- # successfully removed
+ # @return [Integer] The number of members that were successfully removed
#
- # source://redis//lib/redis/commands/sets.rb#50
- def srem(key, member); end
+ # source://redis//lib/redis/commands/sets.rb#39
+ def srem(key, *members); end
# Remove one or more members from a set.
#
# @param key [String]
# @param member [String, Array] one member, or array of members
- # @return [Boolean] `Boolean` Whether or not a member was removed.
+ # @return [Boolean] Wether at least one member was successfully removed.
#
- # source://redis//lib/redis/commands/sets.rb#66
- def srem?(key, member); end
+ # source://redis//lib/redis/commands/sets.rb#49
+ def srem?(key, *members); end
# Scan a set
#
@@ -2481,7 +1786,7 @@ module Redis::Commands::Sets
# - `:count => Integer`: return count keys at most per iteration
# @return [String, Array] the next cursor and all found members
#
- # source://redis//lib/redis/commands/sets.rb#196
+ # source://redis//lib/redis/commands/sets.rb#187
def sscan(key, cursor, **options); end
# Scan a set
@@ -2493,7 +1798,7 @@ module Redis::Commands::Sets
# - `:count => Integer`: return count keys at most per iteration
# @return [Enumerator] an enumerator for all keys in the set
#
- # source://redis//lib/redis/commands/sets.rb#211
+ # source://redis//lib/redis/commands/sets.rb#202
def sscan_each(key, **options, &block); end
# Add multiple sets.
@@ -2501,7 +1806,7 @@ module Redis::Commands::Sets
# @param keys [String, Array] keys pointing to sets to unify
# @return [Array] members in the union
#
- # source://redis//lib/redis/commands/sets.rb#172
+ # source://redis//lib/redis/commands/sets.rb#161
def sunion(*keys); end
# Add multiple sets and store the resulting set in a key.
@@ -2510,12 +1815,26 @@ module Redis::Commands::Sets
# @param keys [String, Array] keys pointing to sets to unify
# @return [Integer] number of elements in the resulting set
#
- # source://redis//lib/redis/commands/sets.rb#181
+ # source://redis//lib/redis/commands/sets.rb#171
def sunionstore(destination, *keys); end
end
# source://redis//lib/redis/commands/sorted_sets.rb#5
module Redis::Commands::SortedSets
+ # Removes and returns up to count members with scores in the sorted set stored at key.
+ #
+ # @example Popping a member
+ # redis.bzmpop('zset')
+ # #=> ['zset', ['a', 1.0]]
+ # @example With count option
+ # redis.bzmpop('zset', count: 2)
+ # #=> ['zset', [['a', 1.0], ['b', 2.0]]
+ # @raise [ArgumentError]
+ # @return [Array>] list of popped elements and scores
+ #
+ # source://redis//lib/redis/commands/sorted_sets.rb#188
+ def bzmpop(timeout, *keys, modifier: T.unsafe(nil), count: T.unsafe(nil)); end
+
# Removes and returns up to count members with the highest scores in the sorted set stored at keys,
# or block until one is available.
#
@@ -2528,7 +1847,7 @@ module Redis::Commands::SortedSets
# @return [Array] a touple of key, member and score
# @return [nil] when no element could be popped and the timeout expired
#
- # source://redis//lib/redis/commands/sorted_sets.rb#181
+ # source://redis//lib/redis/commands/sorted_sets.rb#251
def bzpopmax(*args); end
# Removes and returns up to count members with the lowest scores in the sorted set stored at keys,
@@ -2543,7 +1862,7 @@ module Redis::Commands::SortedSets
# @return [Array] a touple of key, member and score
# @return [nil] when no element could be popped and the timeout expired
#
- # source://redis//lib/redis/commands/sorted_sets.rb#202
+ # source://redis//lib/redis/commands/sorted_sets.rb#272
def bzpopmin(*args); end
# Add one or more members to a sorted set, or update the score for members
@@ -2606,7 +1925,7 @@ module Redis::Commands::SortedSets
# - exclusive maximum score is specified by prefixing `(`
# @return [Integer] number of members in within the specified range
#
- # source://redis//lib/redis/commands/sorted_sets.rb#608
+ # source://redis//lib/redis/commands/sorted_sets.rb#678
def zcount(key, min, max); end
# Return the difference between the first and all successive input sorted sets
@@ -2626,7 +1945,7 @@ module Redis::Commands::SortedSets
# @return [Array, Array<[String, Float]>] - when `:with_scores` is not specified, an array of members
# - when `:with_scores` is specified, an array with `[member, score]` pairs
#
- # source://redis//lib/redis/commands/sorted_sets.rb#717
+ # source://redis//lib/redis/commands/sorted_sets.rb#787
def zdiff(*keys, with_scores: T.unsafe(nil)); end
# Compute the difference between the first and all successive input sorted sets
@@ -2641,7 +1960,7 @@ module Redis::Commands::SortedSets
# @param keys [Array] source keys
# @return [Integer] number of elements in the resulting sorted set
#
- # source://redis//lib/redis/commands/sorted_sets.rb#733
+ # source://redis//lib/redis/commands/sorted_sets.rb#803
def zdiffstore(*args, **_arg1); end
# Increment the score of a member in a sorted set.
@@ -2673,7 +1992,7 @@ module Redis::Commands::SortedSets
# @return [Array, Array<[String, Float]>] - when `:with_scores` is not specified, an array of members
# - when `:with_scores` is specified, an array with `[member, score]` pairs
#
- # source://redis//lib/redis/commands/sorted_sets.rb#631
+ # source://redis//lib/redis/commands/sorted_sets.rb#701
def zinter(*args, **_arg1); end
# Intersect multiple sorted sets and store the resulting sorted set in a new
@@ -2689,7 +2008,7 @@ module Redis::Commands::SortedSets
# - `:aggregate => String`: aggregate function to use (sum, min, max)
# @return [Integer] number of elements in the resulting sorted set
#
- # source://redis//lib/redis/commands/sorted_sets.rb#650
+ # source://redis//lib/redis/commands/sorted_sets.rb#720
def zinterstore(*args, **_arg1); end
# Count the members, with the same score in a sorted set, within the given lexicographical range.
@@ -2707,8 +2026,22 @@ module Redis::Commands::SortedSets
# - exclusive maximum is specified by prefixing `[`
# @return [Integer] number of members within the specified lexicographical range
#
- # source://redis//lib/redis/commands/sorted_sets.rb#439
- def zlexcount(key, min, max); end
+ # source://redis//lib/redis/commands/sorted_sets.rb#509
+ def zlexcount(key, min, max); end
+
+ # Removes and returns up to count members with scores in the sorted set stored at key.
+ #
+ # @example Popping a member
+ # redis.zmpop('zset')
+ # #=> ['zset', ['a', 1.0]]
+ # @example With count option
+ # redis.zmpop('zset', count: 2)
+ # #=> ['zset', [['a', 1.0], ['b', 2.0]]
+ # @raise [ArgumentError]
+ # @return [Array>] list of popped elements and scores
+ #
+ # source://redis//lib/redis/commands/sorted_sets.rb#220
+ def zmpop(*keys, modifier: T.unsafe(nil), count: T.unsafe(nil)); end
# Get the scores associated with the given members in a sorted set.
#
@@ -2719,7 +2052,7 @@ module Redis::Commands::SortedSets
# @param members [String, Array]
# @return [Array] scores of the members
#
- # source://redis//lib/redis/commands/sorted_sets.rb#230
+ # source://redis//lib/redis/commands/sorted_sets.rb#300
def zmscore(key, *members); end
# Removes and returns up to count members with the highest scores in the sorted set stored at key.
@@ -2747,7 +2080,7 @@ module Redis::Commands::SortedSets
# @return [Array] element and score pair if count is not specified
# @return [Array>] list of popped elements and scores
#
- # source://redis//lib/redis/commands/sorted_sets.rb#159
+ # source://redis//lib/redis/commands/sorted_sets.rb#161
def zpopmin(key, count = T.unsafe(nil)); end
# Get one or more random members from a sorted set.
@@ -2769,7 +2102,7 @@ module Redis::Commands::SortedSets
# - when `count` is specified and `:with_scores` is not specified, an array of members
# - when `:with_scores` is specified, an array with `[member, score]` pairs
#
- # source://redis//lib/redis/commands/sorted_sets.rb#258
+ # source://redis//lib/redis/commands/sorted_sets.rb#328
def zrandmember(key, count = T.unsafe(nil), withscores: T.unsafe(nil), with_scores: T.unsafe(nil)); end
# Return a range of members in a sorted set, by index, score or lexicographical ordering.
@@ -2792,7 +2125,7 @@ module Redis::Commands::SortedSets
# @return [Array, Array<[String, Float]>] - when `:with_scores` is not specified, an array of members
# - when `:with_scores` is specified, an array with `[member, score]` pairs
#
- # source://redis//lib/redis/commands/sorted_sets.rb#297
+ # source://redis//lib/redis/commands/sorted_sets.rb#367
def zrange(key, start, stop, byscore: T.unsafe(nil), by_score: T.unsafe(nil), bylex: T.unsafe(nil), by_lex: T.unsafe(nil), rev: T.unsafe(nil), limit: T.unsafe(nil), withscores: T.unsafe(nil), with_scores: T.unsafe(nil)); end
# Return a range of members with the same score in a sorted set, by lexicographical ordering
@@ -2812,7 +2145,7 @@ module Redis::Commands::SortedSets
# `count` members
# @return [Array, Array<[String, Float]>]
#
- # source://redis//lib/redis/commands/sorted_sets.rb#464
+ # source://redis//lib/redis/commands/sorted_sets.rb#534
def zrangebylex(key, min, max, limit: T.unsafe(nil)); end
# Return a range of members in a sorted set, by score.
@@ -2837,7 +2170,7 @@ module Redis::Commands::SortedSets
# @return [Array, Array<[String, Float]>] - when `:with_scores` is not specified, an array of members
# - when `:with_scores` is specified, an array with `[member, score]` pairs
#
- # source://redis//lib/redis/commands/sorted_sets.rb#524
+ # source://redis//lib/redis/commands/sorted_sets.rb#594
def zrangebyscore(key, min, max, withscores: T.unsafe(nil), with_scores: T.unsafe(nil), limit: T.unsafe(nil)); end
# Select a range of members in a sorted set, by index, score or lexicographical ordering
@@ -2852,7 +2185,7 @@ module Redis::Commands::SortedSets
# @return [Integer] the number of elements in the resulting sorted set
# @see #zrange
#
- # source://redis//lib/redis/commands/sorted_sets.rb#339
+ # source://redis//lib/redis/commands/sorted_sets.rb#409
def zrangestore(dest_key, src_key, start, stop, byscore: T.unsafe(nil), by_score: T.unsafe(nil), bylex: T.unsafe(nil), by_lex: T.unsafe(nil), rev: T.unsafe(nil), limit: T.unsafe(nil)); end
# Determine the index of a member in a sorted set.
@@ -2861,7 +2194,7 @@ module Redis::Commands::SortedSets
# @param member [String]
# @return [Integer]
#
- # source://redis//lib/redis/commands/sorted_sets.rb#390
+ # source://redis//lib/redis/commands/sorted_sets.rb#460
def zrank(key, member); end
# Remove one or more members from a sorted set.
@@ -2894,7 +2227,7 @@ module Redis::Commands::SortedSets
# @param stop [Integer] stop index
# @return [Integer] number of members that were removed
#
- # source://redis//lib/redis/commands/sorted_sets.rb#417
+ # source://redis//lib/redis/commands/sorted_sets.rb#487
def zremrangebyrank(key, start, stop); end
# Remove all members in a sorted set within the given scores.
@@ -2912,7 +2245,7 @@ module Redis::Commands::SortedSets
# - exclusive maximum score is specified by prefixing `(`
# @return [Integer] number of members that were removed
#
- # source://redis//lib/redis/commands/sorted_sets.rb#587
+ # source://redis//lib/redis/commands/sorted_sets.rb#657
def zremrangebyscore(key, min, max); end
# Return a range of members in a sorted set, by index, with scores ordered
@@ -2926,7 +2259,7 @@ module Redis::Commands::SortedSets
# # => [["b", 64.0], ["a", 32.0]]
# @see #zrange
#
- # source://redis//lib/redis/commands/sorted_sets.rb#374
+ # source://redis//lib/redis/commands/sorted_sets.rb#444
def zrevrange(key, start, stop, withscores: T.unsafe(nil), with_scores: T.unsafe(nil)); end
# Return a range of members with the same score in a sorted set, by reversed lexicographical ordering.
@@ -2940,7 +2273,7 @@ module Redis::Commands::SortedSets
# # => ["abbygail", "abby"]
# @see #zrangebylex
#
- # source://redis//lib/redis/commands/sorted_sets.rb#486
+ # source://redis//lib/redis/commands/sorted_sets.rb#556
def zrevrangebylex(key, max, min, limit: T.unsafe(nil)); end
# Return a range of members in a sorted set, by score, with scores ordered
@@ -2957,7 +2290,7 @@ module Redis::Commands::SortedSets
# # => [["b", 64.0], ["a", 32.0]]
# @see #zrangebyscore
#
- # source://redis//lib/redis/commands/sorted_sets.rb#554
+ # source://redis//lib/redis/commands/sorted_sets.rb#624
def zrevrangebyscore(key, max, min, withscores: T.unsafe(nil), with_scores: T.unsafe(nil), limit: T.unsafe(nil)); end
# Determine the index of a member in a sorted set, with scores ordered from
@@ -2967,7 +2300,7 @@ module Redis::Commands::SortedSets
# @param member [String]
# @return [Integer]
#
- # source://redis//lib/redis/commands/sorted_sets.rb#400
+ # source://redis//lib/redis/commands/sorted_sets.rb#470
def zrevrank(key, member); end
# Scan a sorted set
@@ -2980,7 +2313,7 @@ module Redis::Commands::SortedSets
# @return [String, Array<[String, Float]>] the next cursor and all found
# members and scores
#
- # source://redis//lib/redis/commands/sorted_sets.rb#750
+ # source://redis//lib/redis/commands/sorted_sets.rb#820
def zscan(key, cursor, **options); end
# Scan a sorted set
@@ -2992,7 +2325,7 @@ module Redis::Commands::SortedSets
# - `:count => Integer`: return count keys at most per iteration
# @return [Enumerator] an enumerator for all found scores and members
#
- # source://redis//lib/redis/commands/sorted_sets.rb#767
+ # source://redis//lib/redis/commands/sorted_sets.rb#837
def zscan_each(key, **options, &block); end
# Get the score associated with the given member in a sorted set.
@@ -3004,7 +2337,7 @@ module Redis::Commands::SortedSets
# @param member [String]
# @return [Float] score of the member
#
- # source://redis//lib/redis/commands/sorted_sets.rb#217
+ # source://redis//lib/redis/commands/sorted_sets.rb#287
def zscore(key, member); end
# Return the union of multiple sorted sets
@@ -3023,7 +2356,7 @@ module Redis::Commands::SortedSets
# @return [Array, Array<[String, Float]>] - when `:with_scores` is not specified, an array of members
# - when `:with_scores` is specified, an array with `[member, score]` pairs
#
- # source://redis//lib/redis/commands/sorted_sets.rb#674
+ # source://redis//lib/redis/commands/sorted_sets.rb#744
def zunion(*args, **_arg1); end
# Add multiple sorted sets and store the resulting sorted set in a new key.
@@ -3038,15 +2371,15 @@ module Redis::Commands::SortedSets
# - `:aggregate => String`: aggregate function to use (sum, min, max, ...)
# @return [Integer] number of elements in the resulting sorted set
#
- # source://redis//lib/redis/commands/sorted_sets.rb#692
+ # source://redis//lib/redis/commands/sorted_sets.rb#762
def zunionstore(*args, **_arg1); end
private
- # source://redis//lib/redis/commands/sorted_sets.rb#780
+ # source://redis//lib/redis/commands/sorted_sets.rb#850
def _zsets_operation(cmd, *keys, weights: T.unsafe(nil), aggregate: T.unsafe(nil), with_scores: T.unsafe(nil)); end
- # source://redis//lib/redis/commands/sorted_sets.rb#798
+ # source://redis//lib/redis/commands/sorted_sets.rb#869
def _zsets_operation_store(cmd, destination, keys, weights: T.unsafe(nil), aggregate: T.unsafe(nil)); end
end
@@ -3065,7 +2398,7 @@ module Redis::Commands::Streams
# @param ids [Array] one or multiple entry ids
# @return [Integer] the number of entries successfully acknowledged
#
- # source://redis//lib/redis/commands/streams.rb#251
+ # source://redis//lib/redis/commands/streams.rb#266
def xack(key, group, *ids); end
# Add new entry to the stream.
@@ -3073,7 +2406,8 @@ module Redis::Commands::Streams
# @example Without options
# redis.xadd('mystream', f1: 'v1', f2: 'v2')
# @example With options
- # redis.xadd('mystream', { f1: 'v1', f2: 'v2' }, id: '0-0', maxlen: 1000, approximate: true)
+ # redis.xadd('mystream', { f1: 'v1', f2: 'v2' }, id: '0-0', maxlen: 1000, approximate: true, nomkstream: true)
+ # @option opts
# @option opts
# @option opts
# @option opts
@@ -3082,8 +2416,8 @@ module Redis::Commands::Streams
# @param opts [Hash] several options for `XADD` command
# @return [String] the entry id
#
- # source://redis//lib/redis/commands/streams.rb#51
- def xadd(key, entry, approximate: T.unsafe(nil), maxlen: T.unsafe(nil), id: T.unsafe(nil)); end
+ # source://redis//lib/redis/commands/streams.rb#49
+ def xadd(key, entry, approximate: T.unsafe(nil), maxlen: T.unsafe(nil), nomkstream: T.unsafe(nil), id: T.unsafe(nil)); end
# Transfers ownership of pending stream entries that match the specified criteria.
#
@@ -3106,7 +2440,7 @@ module Redis::Commands::Streams
# @return [Hash{String => Hash}] the entries successfully claimed
# @return [Array] the entry ids successfully claimed if justid option is `true`
#
- # source://redis//lib/redis/commands/streams.rb#321
+ # source://redis//lib/redis/commands/streams.rb#336
def xautoclaim(key, group, consumer, min_idle_time, start, count: T.unsafe(nil), justid: T.unsafe(nil)); end
# Changes the ownership of a pending entry
@@ -3139,7 +2473,7 @@ module Redis::Commands::Streams
# @return [Hash{String => Hash}] the entries successfully claimed
# @return [Array] the entry ids successfully claimed if justid option is `true`
#
- # source://redis//lib/redis/commands/streams.rb#288
+ # source://redis//lib/redis/commands/streams.rb#303
def xclaim(key, group, consumer, min_idle_time, *ids, **opts); end
# Delete entries by entry ids.
@@ -3152,7 +2486,7 @@ module Redis::Commands::Streams
# @param ids [Array] one or multiple entry ids
# @return [Integer] the number of entries actually deleted
#
- # source://redis//lib/redis/commands/streams.rb#91
+ # source://redis//lib/redis/commands/streams.rb#106
def xdel(key, *ids); end
# Manages the consumer group of the stream.
@@ -3174,7 +2508,7 @@ module Redis::Commands::Streams
# @return [String] `OK` if subcommand is `create` or `setid`
# @return [Integer] effected count if subcommand is `destroy` or `delconsumer`
#
- # source://redis//lib/redis/commands/streams.rb#199
+ # source://redis//lib/redis/commands/streams.rb#214
def xgroup(subcommand, key, group, id_or_consumer = T.unsafe(nil), mkstream: T.unsafe(nil)); end
# Returns the stream information each subcommand.
@@ -3202,7 +2536,7 @@ module Redis::Commands::Streams
# @param key [String] the stream key
# @return [Integer] the number of entries
#
- # source://redis//lib/redis/commands/streams.rb#150
+ # source://redis//lib/redis/commands/streams.rb#165
def xlen(key); end
# Fetches not acknowledging pending entries
@@ -3211,19 +2545,23 @@ module Redis::Commands::Streams
# redis.xpending('mystream', 'mygroup')
# @example With range options
# redis.xpending('mystream', 'mygroup', '-', '+', 10)
+ # @example With range and idle time options
+ # redis.xpending('mystream', 'mygroup', '-', '+', 10, idle: 9000)
# @example With range and consumer options
# redis.xpending('mystream', 'mygroup', '-', '+', 10, 'consumer1')
+ # @option opts
# @param key [String] the stream key
# @param group [String] the consumer group name
# @param start [String] start first entry id of range
# @param end [String] end last entry id of range
# @param count [Integer] count the number of entries as limit
# @param consumer [String] the consumer name
+ # @param opts [Hash] a customizable set of options
# @return [Hash] the summary of pending entries
# @return [Array] the pending entries details if options were specified
#
- # source://redis//lib/redis/commands/streams.rb#349
- def xpending(key, group, *args); end
+ # source://redis//lib/redis/commands/streams.rb#368
+ def xpending(key, group, *args, idle: T.unsafe(nil)); end
# Fetches entries of the stream in ascending order.
#
@@ -3241,7 +2579,7 @@ module Redis::Commands::Streams
# @param count [Integer] the number of entries as limit
# @return [Array>] the ids and entries pairs
#
- # source://redis//lib/redis/commands/streams.rb#113
+ # source://redis//lib/redis/commands/streams.rb#128
def xrange(key, start = T.unsafe(nil), range_end = T.unsafe(nil), count: T.unsafe(nil)); end
# Fetches entries from one or multiple streams. Optionally blocking.
@@ -3260,7 +2598,7 @@ module Redis::Commands::Streams
# @param block [Integer] the number of milliseconds as blocking timeout
# @return [Hash{String => Hash{String => Hash}}] the entries
#
- # source://redis//lib/redis/commands/streams.rb#171
+ # source://redis//lib/redis/commands/streams.rb#186
def xread(keys, ids, count: T.unsafe(nil), block: T.unsafe(nil)); end
# Fetches a subset of the entries from one or multiple streams related with the consumer group.
@@ -3286,7 +2624,7 @@ module Redis::Commands::Streams
# @param opts [Hash] several options for `XREADGROUP` command
# @return [Hash{String => Hash{String => Hash}}] the entries
#
- # source://redis//lib/redis/commands/streams.rb#229
+ # source://redis//lib/redis/commands/streams.rb#244
def xreadgroup(group, consumer, keys, ids, count: T.unsafe(nil), block: T.unsafe(nil), noack: T.unsafe(nil)); end
# Fetches entries of the stream in descending order.
@@ -3304,7 +2642,7 @@ module Redis::Commands::Streams
# @param start [String] last entry id of range, default value is `-`
# @return [Array>] the ids and entries pairs
#
- # source://redis//lib/redis/commands/streams.rb#136
+ # source://redis//lib/redis/commands/streams.rb#151
def xrevrange(key, range_end = T.unsafe(nil), start = T.unsafe(nil), count: T.unsafe(nil)); end
# Trims older entries of the stream if needed.
@@ -3313,17 +2651,18 @@ module Redis::Commands::Streams
# redis.xtrim('mystream', 1000)
# @example With options
# redis.xtrim('mystream', 1000, approximate: true)
- # @param key [String] the stream key
- # @param mexlen [Integer] max length of entries
- # @param approximate [Boolean] whether to add `~` modifier of maxlen or not
+ # @example With strategy
+ # redis.xtrim('mystream', '1-0', strategy: 'MINID')
+ # @overload xtrim
+ # @overload xtrim
# @return [Integer] the number of entries actually deleted
#
- # source://redis//lib/redis/commands/streams.rb#75
- def xtrim(key, maxlen, approximate: T.unsafe(nil)); end
+ # source://redis//lib/redis/commands/streams.rb#85
+ def xtrim(key, len_or_id, strategy: T.unsafe(nil), approximate: T.unsafe(nil), limit: T.unsafe(nil)); end
private
- # source://redis//lib/redis/commands/streams.rb#365
+ # source://redis//lib/redis/commands/streams.rb#385
def _xread(args, keys, ids, blocking_timeout_msec); end
end
@@ -3335,7 +2674,7 @@ module Redis::Commands::Strings
# @param value [String] value to append
# @return [Integer] length of the string after appending
#
- # source://redis//lib/redis/commands/strings.rb#254
+ # source://redis//lib/redis/commands/strings.rb#255
def append(key, value); end
# Decrement the integer value of a key by one.
@@ -3376,7 +2715,7 @@ module Redis::Commands::Strings
# @return [String] the old value stored in the key, or `nil` if the key
# did not exist
#
- # source://redis//lib/redis/commands/strings.rb#274
+ # source://redis//lib/redis/commands/strings.rb#275
def getdel(key); end
# Get the value of key and optionally set its expiration. GETEX is similar to
@@ -3393,7 +2732,7 @@ module Redis::Commands::Strings
# - `:persist => true`: Remove the time to live associated with the key.
# @return [String] The value of key, or nil when key does not exist.
#
- # source://redis//lib/redis/commands/strings.rb#292
+ # source://redis//lib/redis/commands/strings.rb#293
def getex(key, ex: T.unsafe(nil), px: T.unsafe(nil), exat: T.unsafe(nil), pxat: T.unsafe(nil), persist: T.unsafe(nil)); end
# Get a substring of the string stored at a key.
@@ -3404,7 +2743,7 @@ module Redis::Commands::Strings
# the end of the string
# @return [Integer] `0` or `1`
#
- # source://redis//lib/redis/commands/strings.rb#245
+ # source://redis//lib/redis/commands/strings.rb#246
def getrange(key, start, stop); end
# Set the string value of a key and return its old value.
@@ -3414,7 +2753,7 @@ module Redis::Commands::Strings
# @return [String] the old value stored in the key, or `nil` if the key
# did not exist
#
- # source://redis//lib/redis/commands/strings.rb#264
+ # source://redis//lib/redis/commands/strings.rb#265
def getset(key, value); end
# Increment the integer value of a key by one.
@@ -3461,7 +2800,7 @@ module Redis::Commands::Strings
# @return [Hash] a hash mapping the specified keys to their values
# @see #mget
#
- # source://redis//lib/redis/commands/strings.rb#218
+ # source://redis//lib/redis/commands/strings.rb#219
def mapped_mget(*keys); end
# Set one or more values.
@@ -3577,7 +2916,7 @@ module Redis::Commands::Strings
# @param value [String]
# @return [Integer] length of the string after it was modified
#
- # source://redis//lib/redis/commands/strings.rb#234
+ # source://redis//lib/redis/commands/strings.rb#235
def setrange(key, offset, value); end
# Get the length of the value stored in a key.
@@ -3586,7 +2925,7 @@ module Redis::Commands::Strings
# @return [Integer] the length of the value stored in the key, or 0
# if the key does not exist
#
- # source://redis//lib/redis/commands/strings.rb#308
+ # source://redis//lib/redis/commands/strings.rb#309
def strlen(key); end
end
@@ -3594,13 +2933,11 @@ end
module Redis::Commands::Transactions
# Discard all commands issued after MULTI.
#
- # Only call this method when `#multi` was called **without** a block.
- #
# @return [String] `"OK"`
# @see #multi
# @see #exec
#
- # source://redis//lib/redis/commands/transactions.rb#134
+ # source://redis//lib/redis/commands/transactions.rb#110
def discard; end
# Execute all commands issued after MULTI.
@@ -3612,37 +2949,25 @@ module Redis::Commands::Transactions
# @see #multi
# @see #discard
#
- # source://redis//lib/redis/commands/transactions.rb#122
+ # source://redis//lib/redis/commands/transactions.rb#100
def exec; end
# Mark the start of a transaction block.
#
- # Passing a block is optional.
- #
# @example With a block
# redis.multi do |multi|
# multi.set("key", "value")
# multi.incr("counter")
# end # => ["OK", 6]
- # @example Without a block
- # redis.multi
- # # => "OK"
- # redis.set("key", "value")
- # # => "QUEUED"
- # redis.incr("counter")
- # # => "QUEUED"
- # redis.exec
- # # => ["OK", 6]
- # @return [String, Array<...>] - when a block is not given, `OK`
- # - when a block is given, an array with replies
+ # @return [Array<...>] - an array with replies
# @see #watch
# @see #unwatch
# @yield [multi] the commands that are called inside this block are cached
# and written to the server upon returning from it
# @yieldparam multi [Redis] `self`
#
- # source://redis//lib/redis/commands/transactions.rb#36
- def multi(&block); end
+ # source://redis//lib/redis/commands/transactions.rb#23
+ def multi; end
# Forget about all watched keys.
#
@@ -3650,7 +2975,7 @@ module Redis::Commands::Transactions
# @see #watch
# @see #multi
#
- # source://redis//lib/redis/commands/transactions.rb#108
+ # source://redis//lib/redis/commands/transactions.rb#86
def unwatch; end
# Watch the given keys to determine execution of the MULTI/EXEC block.
@@ -3681,210 +3006,29 @@ module Redis::Commands::Transactions
# @see #unwatch
# @see #multi
#
- # source://redis//lib/redis/commands/transactions.rb#83
+ # source://redis//lib/redis/commands/transactions.rb#61
def watch(*keys); end
end
-# source://redis//lib/redis/connection/registry.rb#4
+# soft-deprecated
+# We added this back for older sidekiq releases
+#
+# source://redis//lib/redis.rb#27
module Redis::Connection
class << self
- # Store a list of loaded connection drivers in the Connection module.
- # Redis::Client uses the last required driver by default, and will be aware
- # of the loaded connection drivers if the user chooses to override the
- # default connection driver.
- #
- # source://redis//lib/redis/connection/registry.rb#9
+ # source://redis//lib/redis.rb#29
def drivers; end
end
end
-# source://redis//lib/redis/connection/command_helper.rb#5
-module Redis::Connection::CommandHelper
- # source://redis//lib/redis/connection/command_helper.rb#8
- def build_command(args); end
-
- protected
-
- # source://redis//lib/redis/connection/command_helper.rb#36
- def encode(string); end
-end
-
-# source://redis//lib/redis/connection/command_helper.rb#6
-Redis::Connection::CommandHelper::COMMAND_DELIMITER = T.let(T.unsafe(nil), String)
-
-# source://redis//lib/redis/connection/ruby.rb#291
-class Redis::Connection::Ruby
- include ::Redis::Connection::CommandHelper
-
- # @return [Ruby] a new instance of Ruby
- #
- # source://redis//lib/redis/connection/ruby.rb#354
- def initialize(sock); end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/connection/ruby.rb#358
- def connected?; end
-
- # source://redis//lib/redis/connection/ruby.rb#362
- def disconnect; end
-
- # source://redis//lib/redis/connection/ruby.rb#418
- def format_bulk_reply(line); end
-
- # source://redis//lib/redis/connection/ruby.rb#406
- def format_error_reply(line); end
-
- # source://redis//lib/redis/connection/ruby.rb#414
- def format_integer_reply(line); end
-
- # source://redis//lib/redis/connection/ruby.rb#427
- def format_multi_bulk_reply(line); end
-
- # source://redis//lib/redis/connection/ruby.rb#395
- def format_reply(reply_type, line); end
-
- # source://redis//lib/redis/connection/ruby.rb#410
- def format_status_reply(line); end
-
- # source://redis//lib/redis/connection/ruby.rb#329
- def get_tcp_keepalive; end
-
- # source://redis//lib/redis/connection/ruby.rb#381
- def read; end
-
- # source://redis//lib/redis/connection/ruby.rb#320
- def set_tcp_keepalive(keepalive); end
-
- # source://redis//lib/redis/connection/ruby.rb#347
- def set_tcp_nodelay; end
-
- # source://redis//lib/redis/connection/ruby.rb#369
- def timeout=(timeout); end
-
- # source://redis//lib/redis/connection/ruby.rb#377
- def write(command); end
-
- # source://redis//lib/redis/connection/ruby.rb#373
- def write_timeout=(timeout); end
-
- class << self
- # source://redis//lib/redis/connection/ruby.rb#300
- def connect(config); end
- end
-end
-
-# source://redis//lib/redis/connection/ruby.rb#298
-Redis::Connection::Ruby::ASTERISK = T.let(T.unsafe(nil), String)
-
-# source://redis//lib/redis/connection/ruby.rb#296
-Redis::Connection::Ruby::COLON = T.let(T.unsafe(nil), String)
-
-# source://redis//lib/redis/connection/ruby.rb#297
-Redis::Connection::Ruby::DOLLAR = T.let(T.unsafe(nil), String)
-
-# source://redis//lib/redis/connection/ruby.rb#294
-Redis::Connection::Ruby::MINUS = T.let(T.unsafe(nil), String)
-
-# source://redis//lib/redis/connection/ruby.rb#295
-Redis::Connection::Ruby::PLUS = T.let(T.unsafe(nil), String)
-
-# source://redis//lib/redis/connection/ruby.rb#230
-class Redis::Connection::SSLSocket < ::OpenSSL::SSL::SSLSocket
- include ::Redis::Connection::SocketMixin
-
- # source://redis//lib/redis/connection/ruby.rb#234
- def wait_readable(timeout = T.unsafe(nil)); end
-
- # source://redis//lib/redis/connection/ruby.rb#240
- def wait_writable(timeout = T.unsafe(nil)); end
-
- class << self
- # source://redis//lib/redis/connection/ruby.rb#245
- def connect(host, port, timeout, ssl_params); end
- end
-end
-
-# source://redis//lib/redis/connection/ruby.rb#18
-module Redis::Connection::SocketMixin
- # source://redis//lib/redis/connection/ruby.rb#21
- def initialize(*args); end
-
- # source://redis//lib/redis/connection/ruby.rb#53
- def _read_from_socket(nbytes, buffer = T.unsafe(nil)); end
-
- # source://redis//lib/redis/connection/ruby.rb#45
- def gets; end
-
- # source://redis//lib/redis/connection/ruby.rb#36
- def read(nbytes); end
-
- # source://redis//lib/redis/connection/ruby.rb#28
- def timeout=(timeout); end
-
- # source://redis//lib/redis/connection/ruby.rb#72
- def write(buffer); end
-
- # source://redis//lib/redis/connection/ruby.rb#32
- def write_timeout=(timeout); end
-end
-
-# source://redis//lib/redis/connection/ruby.rb#19
-Redis::Connection::SocketMixin::CRLF = T.let(T.unsafe(nil), String)
-
-# source://redis//lib/redis/connection/ruby.rb#150
-class Redis::Connection::TCPSocket < ::Socket
- include ::Redis::Connection::SocketMixin
-
- class << self
- # source://redis//lib/redis/connection/ruby.rb#171
- def connect(host, port, timeout); end
-
- # source://redis//lib/redis/connection/ruby.rb#153
- def connect_addrinfo(addrinfo, port, timeout); end
- end
-end
-
-# source://redis//lib/redis/connection/ruby.rb#205
-class Redis::Connection::UNIXSocket < ::Socket
- include ::Redis::Connection::SocketMixin
-
- class << self
- # source://redis//lib/redis/connection/ruby.rb#208
- def connect(path, timeout); end
- end
-end
-
# Raised when connection to a Redis server is lost.
#
-# source://redis//lib/redis/errors.rb#32
+# source://redis//lib/redis/errors.rb#41
class Redis::ConnectionError < ::Redis::BaseConnectionError; end
-# source://redis//lib/redis.rb#12
+# source://redis//lib/redis.rb#9
class Redis::Deprecated < ::StandardError; end
-# source://redis//lib/redis/pipeline.rb#223
-class Redis::DeprecatedMulti
- # @return [DeprecatedMulti] a new instance of DeprecatedMulti
- #
- # source://redis//lib/redis/pipeline.rb#224
- def initialize(pipeline); end
-
- # source://redis//lib/redis/pipeline.rb#229
- def __getobj__; end
-end
-
-# source://redis//lib/redis/pipeline.rb#208
-class Redis::DeprecatedPipeline
- # @return [DeprecatedPipeline] a new instance of DeprecatedPipeline
- #
- # source://redis//lib/redis/pipeline.rb#209
- def initialize(pipeline); end
-
- # source://redis//lib/redis/pipeline.rb#214
- def __getobj__; end
-end
-
# source://redis//lib/redis/distributed.rb#6
class Redis::Distributed
# @return [Distributed] a new instance of Distributed
@@ -3892,16 +3036,16 @@ class Redis::Distributed
# source://redis//lib/redis/distributed.rb#20
def initialize(node_configs, options = T.unsafe(nil)); end
- # source://redis//lib/redis/distributed.rb#396
+ # source://redis//lib/redis/distributed.rb#410
def [](key); end
- # source://redis//lib/redis/distributed.rb#400
+ # source://redis//lib/redis/distributed.rb#414
def []=(key, value); end
- # source://redis//lib/redis/distributed.rb#462
+ # source://redis//lib/redis/distributed.rb#476
def _bpop(cmd, args); end
- # source://redis//lib/redis/distributed.rb#979
+ # source://redis//lib/redis/distributed.rb#1038
def _eval(cmd, args); end
# source://redis//lib/redis/distributed.rb#41
@@ -3909,397 +3053,426 @@ class Redis::Distributed
# Append a value to a key.
#
- # source://redis//lib/redis/distributed.rb#365
+ # source://redis//lib/redis/distributed.rb#378
def append(key, value); end
# Asynchronously save the dataset to disk.
#
- # source://redis//lib/redis/distributed.rb#68
+ # source://redis//lib/redis/distributed.rb#74
def bgsave; end
# Count the number of set bits in a range of the string value stored at key.
#
- # source://redis//lib/redis/distributed.rb#370
- def bitcount(key, start = T.unsafe(nil), stop = T.unsafe(nil)); end
+ # source://redis//lib/redis/distributed.rb#383
+ def bitcount(key, start = T.unsafe(nil), stop = T.unsafe(nil), scale: T.unsafe(nil)); end
# Perform a bitwise operation between strings and store the resulting string in a key.
#
- # source://redis//lib/redis/distributed.rb#375
+ # source://redis//lib/redis/distributed.rb#388
def bitop(operation, destkey, *keys); end
# Return the position of the first bit set to 1 or 0 in a string.
#
- # source://redis//lib/redis/distributed.rb#382
- def bitpos(key, bit, start = T.unsafe(nil), stop = T.unsafe(nil)); end
+ # source://redis//lib/redis/distributed.rb#396
+ def bitpos(key, bit, start = T.unsafe(nil), stop = T.unsafe(nil), scale: T.unsafe(nil)); end
# Remove the first/last element in a list and append/prepend it
# to another list and return it, or block until one is available.
#
- # source://redis//lib/redis/distributed.rb#418
+ # source://redis//lib/redis/distributed.rb#432
def blmove(source, destination, where_source, where_destination, timeout: T.unsafe(nil)); end
+ # Iterate over keys, blocking and removing elements from the first non empty liist found.
+ #
+ # source://redis//lib/redis/distributed.rb#556
+ def blmpop(timeout, *keys, modifier: T.unsafe(nil), count: T.unsafe(nil)); end
+
# Remove and get the first element in a list, or block until one is
# available.
#
- # source://redis//lib/redis/distributed.rb#489
+ # source://redis//lib/redis/distributed.rb#495
def blpop(*args); end
# Remove and get the last element in a list, or block until one is
# available.
#
- # source://redis//lib/redis/distributed.rb#495
+ # source://redis//lib/redis/distributed.rb#513
def brpop(*args); end
# Pop a value from a list, push it to another list and return it; or block
# until one is available.
#
- # source://redis//lib/redis/distributed.rb#501
- def brpoplpush(source, destination, deprecated_timeout = T.unsafe(nil), **options); end
+ # source://redis//lib/redis/distributed.rb#519
+ def brpoplpush(source, destination, **options); end
+
+ # Iterate over keys, blocking and removing members from the first non empty sorted set found.
+ #
+ # source://redis//lib/redis/distributed.rb#722
+ def bzmpop(timeout, *keys, modifier: T.unsafe(nil), count: T.unsafe(nil)); end
+
+ # source://redis//lib/redis/distributed.rb#499
+ def bzpopmax(*args); end
+
+ # source://redis//lib/redis/distributed.rb#505
+ def bzpopmin(*args); end
+
+ # source://redis//lib/redis/distributed.rb#69
+ def close; end
# Copy a value from one key to another.
#
- # source://redis//lib/redis/distributed.rb#215
+ # source://redis//lib/redis/distributed.rb#226
def copy(source, destination, **options); end
# Return the number of keys in the selected database.
#
- # source://redis//lib/redis/distributed.rb#73
+ # source://redis//lib/redis/distributed.rb#79
def dbsize; end
# Decrement the integer value of a key by one.
#
- # source://redis//lib/redis/distributed.rb#255
+ # source://redis//lib/redis/distributed.rb#266
def decr(key); end
# Decrement the integer value of a key by the given number.
#
- # source://redis//lib/redis/distributed.rb#260
+ # source://redis//lib/redis/distributed.rb#271
def decrby(key, decrement); end
# Delete a key.
#
- # source://redis//lib/redis/distributed.rb#163
+ # source://redis//lib/redis/distributed.rb#179
def del(*args); end
# Discard all commands issued after MULTI.
#
# @raise [CannotDistribute]
#
- # source://redis//lib/redis/distributed.rb#946
+ # source://redis//lib/redis/distributed.rb#1005
def discard; end
# Return a serialized version of the value stored at a key.
#
- # source://redis//lib/redis/distributed.rb#148
+ # source://redis//lib/redis/distributed.rb#164
def dump(key); end
- # source://redis//lib/redis/distributed.rb#1006
+ # source://redis//lib/redis/distributed.rb#1065
def dup; end
# Echo the given string.
#
- # source://redis//lib/redis/distributed.rb#58
+ # source://redis//lib/redis/distributed.rb#60
def echo(value); end
# Evaluate Lua script.
#
- # source://redis//lib/redis/distributed.rb#993
+ # source://redis//lib/redis/distributed.rb#1052
def eval(*args); end
# Evaluate Lua script by its SHA.
#
- # source://redis//lib/redis/distributed.rb#998
+ # source://redis//lib/redis/distributed.rb#1057
def evalsha(*args); end
# Execute all commands issued after MULTI.
#
# @raise [CannotDistribute]
#
- # source://redis//lib/redis/distributed.rb#937
+ # source://redis//lib/redis/distributed.rb#996
def exec; end
# Determine if a key exists.
#
- # source://redis//lib/redis/distributed.rb#179
+ # source://redis//lib/redis/distributed.rb#197
def exists(*args); end
# Determine if any of the keys exists.
#
# @return [Boolean]
#
- # source://redis//lib/redis/distributed.rb#196
+ # source://redis//lib/redis/distributed.rb#206
def exists?(*args); end
# Set a key's time to live in seconds.
#
- # source://redis//lib/redis/distributed.rb#118
+ # source://redis//lib/redis/distributed.rb#124
def expire(key, seconds, **kwargs); end
# Set the expiration for a key as a UNIX timestamp.
#
- # source://redis//lib/redis/distributed.rb#123
+ # source://redis//lib/redis/distributed.rb#129
def expireat(key, unix_time, **kwargs); end
+ # Get the expiration for a key as a UNIX timestamp.
+ #
+ # source://redis//lib/redis/distributed.rb#134
+ def expiretime(key); end
+
# Remove all keys from all databases.
#
- # source://redis//lib/redis/distributed.rb#78
+ # source://redis//lib/redis/distributed.rb#84
def flushall; end
# Remove all keys from the current database.
#
- # source://redis//lib/redis/distributed.rb#83
+ # source://redis//lib/redis/distributed.rb#89
def flushdb; end
# Get the value of a key.
#
- # source://redis//lib/redis/distributed.rb#318
+ # source://redis//lib/redis/distributed.rb#329
def get(key); end
# Returns the bit value at offset in the string value stored at key.
#
- # source://redis//lib/redis/distributed.rb#360
+ # source://redis//lib/redis/distributed.rb#373
def getbit(key, offset); end
# Get the value of a key and delete it.
#
- # source://redis//lib/redis/distributed.rb#323
+ # source://redis//lib/redis/distributed.rb#334
def getdel(key); end
# Get the value of a key and sets its time to live based on options.
#
- # source://redis//lib/redis/distributed.rb#328
+ # source://redis//lib/redis/distributed.rb#339
def getex(key, **options); end
# Get a substring of the string stored at a key.
#
- # source://redis//lib/redis/distributed.rb#350
+ # source://redis//lib/redis/distributed.rb#363
def getrange(key, start, stop); end
# Set the string value of a key and return its old value.
#
- # source://redis//lib/redis/distributed.rb#387
+ # source://redis//lib/redis/distributed.rb#401
def getset(key, value); end
# Delete one or more hash fields.
#
- # source://redis//lib/redis/distributed.rb#826
+ # source://redis//lib/redis/distributed.rb#886
def hdel(key, *fields); end
# Determine if a hash field exists.
#
- # source://redis//lib/redis/distributed.rb#831
+ # source://redis//lib/redis/distributed.rb#892
def hexists(key, field); end
# Get the value of a hash field.
#
- # source://redis//lib/redis/distributed.rb#808
+ # source://redis//lib/redis/distributed.rb#866
def hget(key, field); end
# Get all the fields and values in a hash.
#
- # source://redis//lib/redis/distributed.rb#856
+ # source://redis//lib/redis/distributed.rb#917
def hgetall(key); end
# Increment the integer value of a hash field by the given integer number.
#
- # source://redis//lib/redis/distributed.rb#836
+ # source://redis//lib/redis/distributed.rb#897
def hincrby(key, field, increment); end
# Increment the numeric value of a hash field by the given float number.
#
- # source://redis//lib/redis/distributed.rb#841
+ # source://redis//lib/redis/distributed.rb#902
def hincrbyfloat(key, field, increment); end
# Get all the fields in a hash.
#
- # source://redis//lib/redis/distributed.rb#846
+ # source://redis//lib/redis/distributed.rb#907
def hkeys(key); end
# Get the number of fields in a hash.
#
- # source://redis//lib/redis/distributed.rb#784
+ # source://redis//lib/redis/distributed.rb#842
def hlen(key); end
# Get the values of all the given hash fields.
#
- # source://redis//lib/redis/distributed.rb#813
+ # source://redis//lib/redis/distributed.rb#871
def hmget(key, *fields); end
# Set multiple hash fields to multiple values.
#
- # source://redis//lib/redis/distributed.rb#799
+ # source://redis//lib/redis/distributed.rb#857
def hmset(key, *attrs); end
- # source://redis//lib/redis/distributed.rb#821
+ # source://redis//lib/redis/distributed.rb#881
def hrandfield(key, count = T.unsafe(nil), **options); end
# Set multiple hash fields to multiple values.
#
- # source://redis//lib/redis/distributed.rb#789
+ # source://redis//lib/redis/distributed.rb#847
def hset(key, *attrs); end
# Set the value of a hash field, only if the field does not exist.
#
- # source://redis//lib/redis/distributed.rb#794
+ # source://redis//lib/redis/distributed.rb#852
def hsetnx(key, field, value); end
# Get all the values in a hash.
#
- # source://redis//lib/redis/distributed.rb#851
+ # source://redis//lib/redis/distributed.rb#912
def hvals(key); end
# Increment the integer value of a key by one.
#
- # source://redis//lib/redis/distributed.rb#265
+ # source://redis//lib/redis/distributed.rb#276
def incr(key); end
# Increment the integer value of a key by the given integer number.
#
- # source://redis//lib/redis/distributed.rb#270
+ # source://redis//lib/redis/distributed.rb#281
def incrby(key, increment); end
# Increment the numeric value of a key by the given float number.
#
- # source://redis//lib/redis/distributed.rb#275
+ # source://redis//lib/redis/distributed.rb#286
def incrbyfloat(key, increment); end
# Get information and statistics about the server.
#
- # source://redis//lib/redis/distributed.rb#88
+ # source://redis//lib/redis/distributed.rb#94
def info(cmd = T.unsafe(nil)); end
- # source://redis//lib/redis/distributed.rb#1002
+ # source://redis//lib/redis/distributed.rb#1061
def inspect; end
# Find all keys matching the given pattern.
#
- # source://redis//lib/redis/distributed.rb#205
+ # source://redis//lib/redis/distributed.rb#216
def keys(glob = T.unsafe(nil)); end
# Get the UNIX time stamp of the last successful save to disk.
#
- # source://redis//lib/redis/distributed.rb#93
+ # source://redis//lib/redis/distributed.rb#99
def lastsave; end
# Get an element from a list by its index.
#
- # source://redis//lib/redis/distributed.rb#508
+ # source://redis//lib/redis/distributed.rb#526
def lindex(key, index); end
# Insert an element before or after another element in a list.
#
- # source://redis//lib/redis/distributed.rb#513
+ # source://redis//lib/redis/distributed.rb#531
def linsert(key, where, pivot, value); end
# Get the length of a list.
#
- # source://redis//lib/redis/distributed.rb#405
+ # source://redis//lib/redis/distributed.rb#419
def llen(key); end
# Remove the first/last element in a list, append/prepend it to another list and return it.
#
- # source://redis//lib/redis/distributed.rb#410
+ # source://redis//lib/redis/distributed.rb#424
def lmove(source, destination, where_source, where_destination); end
+ # Iterate over keys, removing elements from the first non list found.
+ #
+ # source://redis//lib/redis/distributed.rb#563
+ def lmpop(*keys, modifier: T.unsafe(nil), count: T.unsafe(nil)); end
+
# Remove and get the first elements in a list.
#
- # source://redis//lib/redis/distributed.rb#445
+ # source://redis//lib/redis/distributed.rb#459
def lpop(key, count = T.unsafe(nil)); end
# Prepend one or more values to a list.
#
- # source://redis//lib/redis/distributed.rb#425
+ # source://redis//lib/redis/distributed.rb#439
def lpush(key, value); end
# Prepend a value to a list, only if the list exists.
#
- # source://redis//lib/redis/distributed.rb#430
+ # source://redis//lib/redis/distributed.rb#444
def lpushx(key, value); end
# Get a range of elements from a list.
#
- # source://redis//lib/redis/distributed.rb#518
+ # source://redis//lib/redis/distributed.rb#536
def lrange(key, start, stop); end
# Remove elements from a list.
#
- # source://redis//lib/redis/distributed.rb#523
+ # source://redis//lib/redis/distributed.rb#541
def lrem(key, count, value); end
# Set the value of an element in a list by its index.
#
- # source://redis//lib/redis/distributed.rb#528
+ # source://redis//lib/redis/distributed.rb#546
def lset(key, index, value); end
# Trim a list to the specified range.
#
- # source://redis//lib/redis/distributed.rb#533
+ # source://redis//lib/redis/distributed.rb#551
def ltrim(key, start, stop); end
- # source://redis//lib/redis/distributed.rb#817
+ # source://redis//lib/redis/distributed.rb#876
def mapped_hmget(key, *fields); end
- # source://redis//lib/redis/distributed.rb#803
+ # source://redis//lib/redis/distributed.rb#861
def mapped_hmset(key, hash); end
# Get the values of all the given keys as a Hash.
#
- # source://redis//lib/redis/distributed.rb#338
+ # source://redis//lib/redis/distributed.rb#350
def mapped_mget(*keys); end
# @raise [CannotDistribute]
#
- # source://redis//lib/redis/distributed.rb#304
+ # source://redis//lib/redis/distributed.rb#315
def mapped_mset(_hash); end
# @raise [CannotDistribute]
#
- # source://redis//lib/redis/distributed.rb#313
+ # source://redis//lib/redis/distributed.rb#324
def mapped_msetnx(_hash); end
# Get the values of all the given keys as an Array.
#
- # source://redis//lib/redis/distributed.rb#333
+ # source://redis//lib/redis/distributed.rb#344
def mget(*keys); end
# Transfer a key from the connected instance to another instance.
#
# @raise [CannotDistribute]
#
- # source://redis//lib/redis/distributed.rb#158
+ # source://redis//lib/redis/distributed.rb#174
def migrate(_key, _options); end
# Listen for all requests received by the server in real time.
#
# @raise [NotImplementedError]
#
- # source://redis//lib/redis/distributed.rb#98
+ # source://redis//lib/redis/distributed.rb#104
def monitor; end
# Move a key to another database.
#
- # source://redis//lib/redis/distributed.rb#210
+ # source://redis//lib/redis/distributed.rb#221
def move(key, db); end
# Set multiple keys to multiple values.
#
# @raise [CannotDistribute]
#
- # source://redis//lib/redis/distributed.rb#300
- def mset(*_args); end
+ # source://redis//lib/redis/distributed.rb#311
+ def mset(*_arg0); end
# Set multiple keys to multiple values, only if none of the keys exist.
#
# @raise [CannotDistribute]
#
- # source://redis//lib/redis/distributed.rb#309
- def msetnx(*_args); end
+ # source://redis//lib/redis/distributed.rb#320
+ def msetnx(*_arg0); end
# Mark the start of a transaction block.
#
# @raise [CannotDistribute]
#
- # source://redis//lib/redis/distributed.rb#928
+ # source://redis//lib/redis/distributed.rb#989
def multi(&block); end
# @raise [CannotDistribute]
@@ -4312,65 +3485,70 @@ class Redis::Distributed
# Remove the expiration from a key.
#
- # source://redis//lib/redis/distributed.rb#113
+ # source://redis//lib/redis/distributed.rb#119
def persist(key); end
# Set a key's time to live in milliseconds.
#
- # source://redis//lib/redis/distributed.rb#133
+ # source://redis//lib/redis/distributed.rb#144
def pexpire(key, milliseconds, **kwarg); end
# Set the expiration for a key as number of milliseconds from UNIX Epoch.
#
- # source://redis//lib/redis/distributed.rb#138
+ # source://redis//lib/redis/distributed.rb#149
def pexpireat(key, ms_unix_time, **kwarg); end
+ # Get the expiration for a key as number of milliseconds from UNIX Epoch.
+ #
+ # source://redis//lib/redis/distributed.rb#154
+ def pexpiretime(key); end
+
# Add one or more members to a HyperLogLog structure.
#
- # source://redis//lib/redis/distributed.rb#960
+ # source://redis//lib/redis/distributed.rb#1019
def pfadd(key, member); end
# Get the approximate cardinality of members added to HyperLogLog structure.
#
- # source://redis//lib/redis/distributed.rb#965
+ # source://redis//lib/redis/distributed.rb#1024
def pfcount(*keys); end
# Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of
# the observed Sets of the source HyperLogLog structures.
#
- # source://redis//lib/redis/distributed.rb#973
+ # source://redis//lib/redis/distributed.rb#1032
def pfmerge(dest_key, *source_key); end
# Ping the server.
#
- # source://redis//lib/redis/distributed.rb#53
+ # source://redis//lib/redis/distributed.rb#55
def ping; end
# @raise [CannotDistribute]
#
- # source://redis//lib/redis/distributed.rb#923
+ # source://redis//lib/redis/distributed.rb#984
def pipelined; end
# Set the time to live in milliseconds of a key.
#
- # source://redis//lib/redis/distributed.rb#290
+ # source://redis//lib/redis/distributed.rb#301
def psetex(key, ttl, value); end
# Listen for messages published to channels matching the given patterns.
#
# @raise [NotImplementedError]
#
- # source://redis//lib/redis/distributed.rb#890
+ # source://redis//lib/redis/distributed.rb#951
def psubscribe(*channels, &block); end
# Get the time to live (in milliseconds) for a key.
#
- # source://redis//lib/redis/distributed.rb#143
+ # source://redis//lib/redis/distributed.rb#159
def pttl(key); end
# Post a message to a channel.
#
- # source://redis//lib/redis/distributed.rb#861
+ # source://redis//lib/redis/distributed.rb#922
def publish(channel, message); end
# Stop listening for messages posted to channels matching the given
@@ -4378,34 +3556,34 @@ class Redis::Distributed
#
# @raise [NotImplementedError]
#
- # source://redis//lib/redis/distributed.rb#896
+ # source://redis//lib/redis/distributed.rb#957
def punsubscribe(*channels); end
# Close the connection.
#
- # source://redis//lib/redis/distributed.rb#63
+ # source://redis//lib/redis/distributed.rb#65
def quit; end
# Return a random key from the keyspace.
#
# @raise [CannotDistribute]
#
- # source://redis//lib/redis/distributed.rb#222
+ # source://redis//lib/redis/distributed.rb#233
def randomkey; end
# Rename a key.
#
- # source://redis//lib/redis/distributed.rb#227
+ # source://redis//lib/redis/distributed.rb#238
def rename(old_name, new_name); end
# Rename a key, only if the new key does not exist.
#
- # source://redis//lib/redis/distributed.rb#234
+ # source://redis//lib/redis/distributed.rb#245
def renamenx(old_name, new_name); end
# Create a key using the serialized value, previously obtained using DUMP.
#
- # source://redis//lib/redis/distributed.rb#153
+ # source://redis//lib/redis/distributed.rb#169
def restore(key, ttl, serialized_value, **options); end
# Returns the value of attribute ring.
@@ -4415,357 +3593,364 @@ class Redis::Distributed
# Remove and get the last elements in a list.
#
- # source://redis//lib/redis/distributed.rb#450
+ # source://redis//lib/redis/distributed.rb#464
def rpop(key, count = T.unsafe(nil)); end
# Remove the last element in a list, append it to another list and return
# it.
#
- # source://redis//lib/redis/distributed.rb#456
+ # source://redis//lib/redis/distributed.rb#470
def rpoplpush(source, destination); end
# Append one or more values to a list.
#
- # source://redis//lib/redis/distributed.rb#435
+ # source://redis//lib/redis/distributed.rb#449
def rpush(key, value); end
# Append a value to a list, only if the list exists.
#
- # source://redis//lib/redis/distributed.rb#440
+ # source://redis//lib/redis/distributed.rb#454
def rpushx(key, value); end
# Add one or more members to a set.
#
- # source://redis//lib/redis/distributed.rb#543
- def sadd(key, member); end
+ # source://redis//lib/redis/distributed.rb#575
+ def sadd(key, *members); end
# Add one or more members to a set.
#
# @return [Boolean]
#
- # source://redis//lib/redis/distributed.rb#548
- def sadd?(key, member); end
+ # source://redis//lib/redis/distributed.rb#580
+ def sadd?(key, *members); end
# Synchronously save the dataset to disk.
#
- # source://redis//lib/redis/distributed.rb#103
+ # source://redis//lib/redis/distributed.rb#109
def save; end
# Get the number of members in a set.
#
- # source://redis//lib/redis/distributed.rb#538
+ # source://redis//lib/redis/distributed.rb#570
def scard(key); end
# Control remote script registry.
#
- # source://redis//lib/redis/distributed.rb#955
+ # source://redis//lib/redis/distributed.rb#1014
def script(subcommand, *args); end
# Subtract multiple sets.
#
- # source://redis//lib/redis/distributed.rb#605
+ # source://redis//lib/redis/distributed.rb#637
def sdiff(*keys); end
# Subtract multiple sets and store the resulting set in a key.
#
- # source://redis//lib/redis/distributed.rb#612
+ # source://redis//lib/redis/distributed.rb#645
def sdiffstore(destination, *keys); end
# Change the selected database for the current connection.
#
- # source://redis//lib/redis/distributed.rb#48
+ # source://redis//lib/redis/distributed.rb#50
def select(db); end
# Set the string value of a key.
#
- # source://redis//lib/redis/distributed.rb#280
+ # source://redis//lib/redis/distributed.rb#291
def set(key, value, **options); end
# Sets or clears the bit at offset in the string value stored at key.
#
- # source://redis//lib/redis/distributed.rb#355
+ # source://redis//lib/redis/distributed.rb#368
def setbit(key, offset, value); end
# Set the time to live in seconds of a key.
#
- # source://redis//lib/redis/distributed.rb#285
+ # source://redis//lib/redis/distributed.rb#296
def setex(key, ttl, value); end
# Set the value of a key, only if the key does not exist.
#
- # source://redis//lib/redis/distributed.rb#295
+ # source://redis//lib/redis/distributed.rb#306
def setnx(key, value); end
# Overwrite part of a string at key starting at the specified offset.
#
- # source://redis//lib/redis/distributed.rb#345
+ # source://redis//lib/redis/distributed.rb#358
def setrange(key, offset, value); end
# Intersect multiple sets.
#
- # source://redis//lib/redis/distributed.rb#619
+ # source://redis//lib/redis/distributed.rb#653
def sinter(*keys); end
# Intersect multiple sets and store the resulting set in a key.
#
- # source://redis//lib/redis/distributed.rb#626
+ # source://redis//lib/redis/distributed.rb#661
def sinterstore(destination, *keys); end
# Determine if a given value is a member of a set.
#
- # source://redis//lib/redis/distributed.rb#580
+ # source://redis//lib/redis/distributed.rb#612
def sismember(key, member); end
# Get all the members in a set.
#
- # source://redis//lib/redis/distributed.rb#590
+ # source://redis//lib/redis/distributed.rb#622
def smembers(key); end
# Determine if multiple values are members of a set.
#
- # source://redis//lib/redis/distributed.rb#585
+ # source://redis//lib/redis/distributed.rb#617
def smismember(key, *members); end
# Move a member from one set to another.
#
- # source://redis//lib/redis/distributed.rb#573
+ # source://redis//lib/redis/distributed.rb#605
def smove(source, destination, member); end
# Sort the elements in a list, set or sorted set.
#
- # source://redis//lib/redis/distributed.rb#241
+ # source://redis//lib/redis/distributed.rb#252
def sort(key, **options); end
# Remove and return a random member from a set.
#
- # source://redis//lib/redis/distributed.rb#563
+ # source://redis//lib/redis/distributed.rb#595
def spop(key, count = T.unsafe(nil)); end
# Get a random member from a set.
#
- # source://redis//lib/redis/distributed.rb#568
+ # source://redis//lib/redis/distributed.rb#600
def srandmember(key, count = T.unsafe(nil)); end
# Remove one or more members from a set.
#
- # source://redis//lib/redis/distributed.rb#553
- def srem(key, member); end
+ # source://redis//lib/redis/distributed.rb#585
+ def srem(key, *members); end
# Remove one or more members from a set.
#
# @return [Boolean]
#
- # source://redis//lib/redis/distributed.rb#558
- def srem?(key, member); end
+ # source://redis//lib/redis/distributed.rb#590
+ def srem?(key, *members); end
# Scan a set
#
- # source://redis//lib/redis/distributed.rb#595
+ # source://redis//lib/redis/distributed.rb#627
def sscan(key, cursor, **options); end
# Scan a set and return an enumerator
#
- # source://redis//lib/redis/distributed.rb#600
+ # source://redis//lib/redis/distributed.rb#632
def sscan_each(key, **options, &block); end
# Get the length of the value stored in a key.
#
- # source://redis//lib/redis/distributed.rb#392
+ # source://redis//lib/redis/distributed.rb#406
def strlen(key); end
# Listen for messages published to the given channels.
#
- # source://redis//lib/redis/distributed.rb#870
+ # source://redis//lib/redis/distributed.rb#931
def subscribe(channel, *channels, &block); end
# @return [Boolean]
#
- # source://redis//lib/redis/distributed.rb#865
+ # source://redis//lib/redis/distributed.rb#926
def subscribed?; end
# Add multiple sets.
#
- # source://redis//lib/redis/distributed.rb#633
+ # source://redis//lib/redis/distributed.rb#669
def sunion(*keys); end
# Add multiple sets and store the resulting set in a key.
#
- # source://redis//lib/redis/distributed.rb#640
+ # source://redis//lib/redis/distributed.rb#677
def sunionstore(destination, *keys); end
# Get server time: an UNIX timestamp and the elapsed microseconds in the current second.
#
- # source://redis//lib/redis/distributed.rb#108
+ # source://redis//lib/redis/distributed.rb#114
def time; end
# Get the time to live (in seconds) for a key.
#
- # source://redis//lib/redis/distributed.rb#128
+ # source://redis//lib/redis/distributed.rb#139
def ttl(key); end
# Determine the type stored at key.
#
- # source://redis//lib/redis/distributed.rb#250
+ # source://redis//lib/redis/distributed.rb#261
def type(key); end
# Unlink keys.
#
- # source://redis//lib/redis/distributed.rb#171
+ # source://redis//lib/redis/distributed.rb#188
def unlink(*args); end
# Stop listening for messages posted to the given channels.
#
- # source://redis//lib/redis/distributed.rb#883
+ # @raise [SubscriptionError]
+ #
+ # source://redis//lib/redis/distributed.rb#944
def unsubscribe(*channels); end
# Forget about all watched keys.
#
# @raise [CannotDistribute]
#
- # source://redis//lib/redis/distributed.rb#915
+ # source://redis//lib/redis/distributed.rb#976
def unwatch; end
# Watch the given keys to determine execution of the MULTI/EXEC block.
#
- # source://redis//lib/redis/distributed.rb#901
+ # source://redis//lib/redis/distributed.rb#962
def watch(*keys, &block); end
# Add one or more members to a sorted set, or update the score for members
# that already exist.
#
- # source://redis//lib/redis/distributed.rb#653
+ # source://redis//lib/redis/distributed.rb#691
def zadd(key, *args, **_arg2); end
# Get the number of members in a sorted set.
#
- # source://redis//lib/redis/distributed.rb#647
+ # source://redis//lib/redis/distributed.rb#685
def zcard(key); end
# Get the number of members in a particular score range.
#
- # source://redis//lib/redis/distributed.rb#735
+ # source://redis//lib/redis/distributed.rb#787
def zcount(key, min, max); end
# Return the difference between the first and all successive input sorted sets.
#
- # source://redis//lib/redis/distributed.rb#769
+ # source://redis//lib/redis/distributed.rb#825
def zdiff(*keys, **options); end
# Compute the difference between the first and all successive input sorted sets
# and store the resulting sorted set in a new key.
#
- # source://redis//lib/redis/distributed.rb#777
- def zdiffstore(destination, keys, **options); end
+ # source://redis//lib/redis/distributed.rb#834
+ def zdiffstore(destination, *keys, **options); end
# Increment the score of a member in a sorted set.
#
- # source://redis//lib/redis/distributed.rb#659
+ # source://redis//lib/redis/distributed.rb#697
def zincrby(key, increment, member); end
# Get the intersection of multiple sorted sets
#
- # source://redis//lib/redis/distributed.rb#740
+ # source://redis//lib/redis/distributed.rb#792
def zinter(*keys, **options); end
# Intersect multiple sorted sets and store the resulting sorted set in a new
# key.
#
- # source://redis//lib/redis/distributed.rb#748
- def zinterstore(destination, keys, **options); end
+ # source://redis//lib/redis/distributed.rb#801
+ def zinterstore(destination, *keys, **options); end
+
+ # Iterate over keys, removing members from the first non empty sorted set found.
+ #
+ # source://redis//lib/redis/distributed.rb#729
+ def zmpop(*keys, modifier: T.unsafe(nil), count: T.unsafe(nil)); end
# Get the scores associated with the given members in a sorted set.
#
- # source://redis//lib/redis/distributed.rb#679
+ # source://redis//lib/redis/distributed.rb#717
def zmscore(key, *members); end
# Get one or more random members from a sorted set.
#
- # source://redis//lib/redis/distributed.rb#674
+ # source://redis//lib/redis/distributed.rb#712
def zrandmember(key, count = T.unsafe(nil), **options); end
# Return a range of members in a sorted set, by index, score or lexicographical ordering.
#
- # source://redis//lib/redis/distributed.rb#684
+ # source://redis//lib/redis/distributed.rb#736
def zrange(key, start, stop, **options); end
# Return a range of members in a sorted set, by score.
#
- # source://redis//lib/redis/distributed.rb#719
+ # source://redis//lib/redis/distributed.rb#771
def zrangebyscore(key, min, max, **options); end
# Select a range of members in a sorted set, by index, score or lexicographical ordering
# and store the resulting sorted set in a new key.
#
- # source://redis//lib/redis/distributed.rb#690
+ # source://redis//lib/redis/distributed.rb#742
def zrangestore(dest_key, src_key, start, stop, **options); end
# Determine the index of a member in a sorted set.
#
- # source://redis//lib/redis/distributed.rb#703
+ # source://redis//lib/redis/distributed.rb#755
def zrank(key, member); end
# Remove one or more members from a sorted set.
#
- # source://redis//lib/redis/distributed.rb#664
+ # source://redis//lib/redis/distributed.rb#702
def zrem(key, member); end
# Remove all members in a sorted set within the given indexes.
#
- # source://redis//lib/redis/distributed.rb#714
+ # source://redis//lib/redis/distributed.rb#766
def zremrangebyrank(key, start, stop); end
# Remove all members in a sorted set within the given scores.
#
- # source://redis//lib/redis/distributed.rb#730
+ # source://redis//lib/redis/distributed.rb#782
def zremrangebyscore(key, min, max); end
# Return a range of members in a sorted set, by index, with scores ordered
# from high to low.
#
- # source://redis//lib/redis/distributed.rb#698
+ # source://redis//lib/redis/distributed.rb#750
def zrevrange(key, start, stop, **options); end
# Return a range of members in a sorted set, by score, with scores ordered
# from high to low.
#
- # source://redis//lib/redis/distributed.rb#725
+ # source://redis//lib/redis/distributed.rb#777
def zrevrangebyscore(key, max, min, **options); end
# Determine the index of a member in a sorted set, with scores ordered from
# high to low.
#
- # source://redis//lib/redis/distributed.rb#709
+ # source://redis//lib/redis/distributed.rb#761
def zrevrank(key, member); end
# Get the score associated with the given member in a sorted set.
#
- # source://redis//lib/redis/distributed.rb#669
+ # source://redis//lib/redis/distributed.rb#707
def zscore(key, member); end
# Return the union of multiple sorted sets.
#
- # source://redis//lib/redis/distributed.rb#755
+ # source://redis//lib/redis/distributed.rb#809
def zunion(*keys, **options); end
# Add multiple sorted sets and store the resulting sorted set in a new key.
#
- # source://redis//lib/redis/distributed.rb#762
- def zunionstore(destination, keys, **options); end
+ # source://redis//lib/redis/distributed.rb#817
+ def zunionstore(destination, *keys, **options); end
protected
# @yield [node_for(keys.first)]
#
- # source://redis//lib/redis/distributed.rb#1026
+ # source://redis//lib/redis/distributed.rb#1086
def ensure_same_node(command, keys); end
- # source://redis//lib/redis/distributed.rb#1022
+ # source://redis//lib/redis/distributed.rb#1081
def key_tag(key); end
- # source://redis//lib/redis/distributed.rb#1018
+ # source://redis//lib/redis/distributed.rb#1077
def node_index_for(key); end
- # source://redis//lib/redis/distributed.rb#1012
+ # source://redis//lib/redis/distributed.rb#1071
def on_each_node(command, *args); end
end
@@ -4780,54 +3965,43 @@ class Redis::Distributed::CannotDistribute < ::RuntimeError
def message; end
end
-# source://redis//lib/redis/pipeline.rb#244
+# source://redis//lib/redis/pipeline.rb#80
class Redis::Future < ::BasicObject
# @return [Future] a new instance of Future
#
- # source://redis//lib/redis/pipeline.rb#249
- def initialize(command, transformation, timeout); end
+ # source://redis//lib/redis/pipeline.rb#83
+ def initialize(command, coerce, exception); end
- # source://redis//lib/redis/pipeline.rb#256
- def ==(_other); end
-
- # source://redis//lib/redis/pipeline.rb#275
- def _command; end
-
- # source://redis//lib/redis/pipeline.rb#270
+ # source://redis//lib/redis/pipeline.rb#94
def _set(object); end
- # source://redis//lib/redis/pipeline.rb#288
+ # source://redis//lib/redis/pipeline.rb#108
def class; end
- # source://redis//lib/redis/pipeline.rb#266
+ # source://redis//lib/redis/pipeline.rb#90
def inspect; end
# @return [Boolean]
#
- # source://redis//lib/redis/pipeline.rb#284
+ # source://redis//lib/redis/pipeline.rb#104
def is_a?(other); end
- # Returns the value of attribute timeout.
- #
- # source://redis//lib/redis/pipeline.rb#247
- def timeout; end
-
- # source://redis//lib/redis/pipeline.rb#279
+ # source://redis//lib/redis/pipeline.rb#99
def value; end
end
-# source://redis//lib/redis/pipeline.rb#245
+# source://redis//lib/redis/pipeline.rb#81
Redis::Future::FutureNotReady = T.let(T.unsafe(nil), Redis::FutureNotReady)
-# source://redis//lib/redis/pipeline.rb#238
+# source://redis//lib/redis/pipeline.rb#74
class Redis::FutureNotReady < ::RuntimeError
# @return [FutureNotReady] a new instance of FutureNotReady
#
- # source://redis//lib/redis/pipeline.rb#239
+ # source://redis//lib/redis/pipeline.rb#75
def initialize; end
end
-# source://redis//lib/redis/hash_ring.rb#6
+# source://redis//lib/redis/hash_ring.rb#7
class Redis::HashRing
# nodes is a list of objects that have a proper to_s representation.
# replicas indicates how many virtual points should be used pr. node,
@@ -4835,192 +4009,107 @@ class Redis::HashRing
#
# @return [HashRing] a new instance of HashRing
#
- # source://redis//lib/redis/hash_ring.rb#14
+ # source://redis//lib/redis/hash_ring.rb#15
def initialize(nodes = T.unsafe(nil), replicas = T.unsafe(nil)); end
# Adds a `node` to the hash ring (including a number of replicas).
#
- # source://redis//lib/redis/hash_ring.rb#25
+ # source://redis//lib/redis/hash_ring.rb#26
def add_node(node); end
# get the node in the hash ring for this key
#
- # source://redis//lib/redis/hash_ring.rb#45
+ # source://redis//lib/redis/hash_ring.rb#46
def get_node(key); end
- # source://redis//lib/redis/hash_ring.rb#49
- def get_node_pos(key); end
-
- # source://redis//lib/redis/hash_ring.rb#57
+ # source://redis//lib/redis/hash_ring.rb#52
def iter_nodes(key); end
# Returns the value of attribute nodes.
#
- # source://redis//lib/redis/hash_ring.rb#9
+ # source://redis//lib/redis/hash_ring.rb#10
def nodes; end
- # source://redis//lib/redis/hash_ring.rb#35
+ # source://redis//lib/redis/hash_ring.rb#36
def remove_node(node); end
# Returns the value of attribute replicas.
#
- # source://redis//lib/redis/hash_ring.rb#9
+ # source://redis//lib/redis/hash_ring.rb#10
def replicas; end
# Returns the value of attribute ring.
#
- # source://redis//lib/redis/hash_ring.rb#9
+ # source://redis//lib/redis/hash_ring.rb#10
def ring; end
# Returns the value of attribute sorted_keys.
#
- # source://redis//lib/redis/hash_ring.rb#9
+ # source://redis//lib/redis/hash_ring.rb#10
def sorted_keys; end
- class << self
- # Find the closest index in HashRing with value <= the given value
- #
- # source://redis//lib/redis/hash_ring.rb#67
- def binary_search(ary, value); end
- end
+ private
+
+ # Find the closest index in HashRing with value <= the given value
+ #
+ # source://redis//lib/redis/hash_ring.rb#73
+ def binary_search(ary, value); end
+
+ # source://redis//lib/redis/hash_ring.rb#64
+ def hash_for(key); end
+
+ # source://redis//lib/redis/hash_ring.rb#68
+ def server_hash_for(key); end
end
# this is the default in libmemcached
#
-# source://redis//lib/redis/hash_ring.rb#7
+# source://redis//lib/redis/hash_ring.rb#8
Redis::HashRing::POINTS_PER_SERVER = T.let(T.unsafe(nil), Integer)
# Raised when the connection was inherited by a child process.
#
-# source://redis//lib/redis/errors.rb#40
+# source://redis//lib/redis/errors.rb#49
class Redis::InheritedError < ::Redis::BaseConnectionError; end
# Raised when client options are invalid.
#
-# source://redis//lib/redis/errors.rb#44
+# source://redis//lib/redis/errors.rb#57
class Redis::InvalidClientOptionError < ::Redis::BaseError; end
-# source://redis//lib/redis/pipeline.rb#293
-class Redis::MultiFuture < ::Redis::Future
- # @return [MultiFuture] a new instance of MultiFuture
- #
- # source://redis//lib/redis/pipeline.rb#294
- def initialize(futures); end
-
- # source://redis//lib/redis/pipeline.rb#299
- def _set(replies); end
-end
-
-# source://redis//lib/redis/pipeline.rb#45
-class Redis::Pipeline
- # @return [Pipeline] a new instance of Pipeline
- #
- # source://redis//lib/redis/pipeline.rb#79
- def initialize(client); end
-
- # source://redis//lib/redis/pipeline.rb#106
- def call(command, timeout: T.unsafe(nil), &block); end
-
- # source://redis//lib/redis/pipeline.rb#119
- def call_pipeline(pipeline); end
-
- # source://redis//lib/redis/pipeline.rb#115
- def call_with_timeout(command, timeout, &block); end
-
- # Returns the value of attribute client.
- #
- # source://redis//lib/redis/pipeline.rb#74
- def client; end
-
- # source://redis//lib/redis/pipeline.rb#126
- def commands; end
-
- # Returns the value of attribute db.
- #
- # source://redis//lib/redis/pipeline.rb#73
- def db; end
-
- # Sets the attribute db
- #
- # @param value the value to set the attribute db to.
- #
- # source://redis//lib/redis/pipeline.rb#73
- def db=(_arg0); end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/pipeline.rb#102
- def empty?; end
-
- # source://redis//lib/redis/pipeline.rb#143
- def finish(replies, &blk); end
-
- # Returns the value of attribute futures.
- #
- # source://redis//lib/redis/pipeline.rb#76
- def futures; end
-
- # Returns the value of attribute futures.
- #
- # source://redis//lib/redis/pipeline.rb#76
- def materialized_futures; end
-
- # @return [Boolean]
- #
- # source://redis//lib/redis/pipeline.rb#98
- def shutdown?; end
-
- # source://redis//lib/redis/pipeline.rb#86
- def timeout; end
-
- # source://redis//lib/redis/pipeline.rb#130
- def timeouts; end
-
- # source://redis//lib/redis/pipeline.rb#134
- def with_reconnect(val = T.unsafe(nil)); end
-
- # @return [Boolean]
+# source://redis//lib/redis/pipeline.rb#59
+class Redis::MultiConnection < ::Redis::PipelinedConnection
+ # @raise [Redis::Error]
#
- # source://redis//lib/redis/pipeline.rb#90
- def with_reconnect?; end
+ # source://redis//lib/redis/pipeline.rb#60
+ def multi; end
- # source://redis//lib/redis/pipeline.rb#139
- def without_reconnect(&blk); end
+ private
- # @return [Boolean]
+ # Blocking commands inside transaction behave like non-blocking.
+ # It shouldn't be done though.
+ # https://redis.io/commands/blpop/#blpop-inside-a-multi--exec-transaction
#
- # source://redis//lib/redis/pipeline.rb#94
- def without_reconnect?; end
-
- class << self
- # source://redis//lib/redis/pipeline.rb#52
- def deprecation_warning(method, caller_locations); end
- end
+ # source://redis//lib/redis/pipeline.rb#69
+ def send_blocking_command(command, _timeout, &block); end
end
-# source://redis//lib/redis/pipeline.rb#155
-class Redis::Pipeline::Multi < ::Redis::Pipeline
- # source://redis//lib/redis/pipeline.rb#198
- def commands; end
-
- # source://redis//lib/redis/pipeline.rb#156
- def finish(replies); end
-
- # source://redis//lib/redis/pipeline.rb#178
- def materialized_futures; end
+# source://redis//lib/redis/pipeline.rb#113
+class Redis::MultiFuture < ::Redis::Future
+ # @return [MultiFuture] a new instance of MultiFuture
+ #
+ # source://redis//lib/redis/pipeline.rb#114
+ def initialize(futures); end
- # source://redis//lib/redis/pipeline.rb#190
- def timeouts; end
+ # source://redis//lib/redis/pipeline.rb#120
+ def _set(replies); end
end
-# source://redis//lib/redis/pipeline.rb#46
-Redis::Pipeline::REDIS_INTERNAL_PATH = T.let(T.unsafe(nil), String)
+# source://redis//lib/redis/errors.rb#29
+class Redis::OutOfMemoryError < ::Redis::CommandError; end
-# Redis use MonitorMixin#synchronize and this class use DelegateClass which we want to filter out.
-# Both are in the stdlib so we can simply filter the entire stdlib out.
-#
-# source://redis//lib/redis/pipeline.rb#49
-Redis::Pipeline::STDLIB_PATH = T.let(T.unsafe(nil), String)
+# source://redis//lib/redis/errors.rb#23
+class Redis::PermissionError < ::Redis::CommandError; end
# source://redis//lib/redis/pipeline.rb#6
class Redis::PipelinedConnection
@@ -5044,36 +4133,44 @@ class Redis::PipelinedConnection
# @return [PipelinedConnection] a new instance of PipelinedConnection
#
- # source://redis//lib/redis/pipeline.rb#7
- def initialize(pipeline); end
-
- # source://redis//lib/redis/pipeline.rb#25
- def call_pipeline(pipeline); end
+ # source://redis//lib/redis/pipeline.rb#9
+ def initialize(pipeline, futures = T.unsafe(nil), exception: T.unsafe(nil)); end
- # source://redis//lib/redis/pipeline.rb#13
+ # Returns the value of attribute db.
+ #
+ # source://redis//lib/redis/pipeline.rb#7
def db; end
- # source://redis//lib/redis/pipeline.rb#17
- def db=(db); end
+ # Sets the attribute db
+ #
+ # @param value the value to set the attribute db to.
+ #
+ # source://redis//lib/redis/pipeline.rb#7
+ def db=(_arg0); end
+
+ # @yield [transaction]
+ #
+ # source://redis//lib/redis/pipeline.rb#21
+ def multi; end
# @yield [_self]
# @yieldparam _self [Redis::PipelinedConnection] the object that the method was called on
#
- # source://redis//lib/redis/pipeline.rb#21
+ # source://redis//lib/redis/pipeline.rb#17
def pipelined; end
private
- # source://redis//lib/redis/pipeline.rb#40
+ # source://redis//lib/redis/pipeline.rb#49
def send_blocking_command(command, timeout, &block); end
- # source://redis//lib/redis/pipeline.rb#36
+ # source://redis//lib/redis/pipeline.rb#40
def send_command(command, &block); end
# @yield [_self]
# @yieldparam _self [Redis::PipelinedConnection] the object that the method was called on
#
- # source://redis//lib/redis/pipeline.rb#32
+ # source://redis//lib/redis/pipeline.rb#36
def synchronize; end
end
@@ -5087,6 +4184,14 @@ class Redis::ProtocolError < ::Redis::BaseError
def initialize(reply_type); end
end
+# Generally raised during Redis failover scenarios
+#
+# source://redis//lib/redis/errors.rb#53
+class Redis::ReadOnlyError < ::Redis::BaseConnectionError; end
+
+# source://redis//lib/redis.rb#37
+Redis::SERVER_URL_OPTIONS = T.let(T.unsafe(nil), Array)
+
# source://redis//lib/redis/subscribe.rb#4
class Redis::SubscribedClient
# @return [SubscribedClient] a new instance of SubscribedClient
@@ -5094,70 +4199,97 @@ class Redis::SubscribedClient
# source://redis//lib/redis/subscribe.rb#5
def initialize(client); end
- # source://redis//lib/redis/subscribe.rb#9
- def call(command); end
+ # source://redis//lib/redis/subscribe.rb#10
+ def call_v(command); end
- # source://redis//lib/redis/subscribe.rb#21
+ # source://redis//lib/redis/subscribe.rb#52
+ def close; end
+
+ # source://redis//lib/redis/subscribe.rb#24
def psubscribe(*channels, &block); end
- # source://redis//lib/redis/subscribe.rb#25
+ # source://redis//lib/redis/subscribe.rb#28
def psubscribe_with_timeout(timeout, *channels, &block); end
- # source://redis//lib/redis/subscribe.rb#33
+ # source://redis//lib/redis/subscribe.rb#44
def punsubscribe(*channels); end
- # source://redis//lib/redis/subscribe.rb#13
+ # source://redis//lib/redis/subscribe.rb#32
+ def ssubscribe(*channels, &block); end
+
+ # source://redis//lib/redis/subscribe.rb#36
+ def ssubscribe_with_timeout(timeout, *channels, &block); end
+
+ # source://redis//lib/redis/subscribe.rb#16
def subscribe(*channels, &block); end
- # source://redis//lib/redis/subscribe.rb#17
+ # source://redis//lib/redis/subscribe.rb#20
def subscribe_with_timeout(timeout, *channels, &block); end
- # source://redis//lib/redis/subscribe.rb#29
+ # source://redis//lib/redis/subscribe.rb#48
+ def sunsubscribe(*channels); end
+
+ # source://redis//lib/redis/subscribe.rb#40
def unsubscribe(*channels); end
protected
- # source://redis//lib/redis/subscribe.rb#39
+ # source://redis//lib/redis/subscribe.rb#58
def subscription(start, stop, channels, block, timeout = T.unsafe(nil)); end
end
-# source://redis//lib/redis/subscribe.rb#55
+# source://redis//lib/redis/subscribe.rb#82
class Redis::Subscription
# @return [Subscription] a new instance of Subscription
# @yield [_self]
# @yieldparam _self [Redis::Subscription] the object that the method was called on
#
- # source://redis//lib/redis/subscribe.rb#58
+ # source://redis//lib/redis/subscribe.rb#85
def initialize; end
# Returns the value of attribute callbacks.
#
- # source://redis//lib/redis/subscribe.rb#56
+ # source://redis//lib/redis/subscribe.rb#83
def callbacks; end
- # source://redis//lib/redis/subscribe.rb#74
+ # source://redis//lib/redis/subscribe.rb#98
def message(&block); end
- # source://redis//lib/redis/subscribe.rb#86
+ # source://redis//lib/redis/subscribe.rb#110
def pmessage(&block); end
- # source://redis//lib/redis/subscribe.rb#78
+ # source://redis//lib/redis/subscribe.rb#102
def psubscribe(&block); end
- # source://redis//lib/redis/subscribe.rb#82
+ # source://redis//lib/redis/subscribe.rb#106
def punsubscribe(&block); end
- # source://redis//lib/redis/subscribe.rb#66
+ # source://redis//lib/redis/subscribe.rb#122
+ def smessage(&block); end
+
+ # source://redis//lib/redis/subscribe.rb#114
+ def ssubscribe(&block); end
+
+ # source://redis//lib/redis/subscribe.rb#90
def subscribe(&block); end
- # source://redis//lib/redis/subscribe.rb#70
+ # source://redis//lib/redis/subscribe.rb#118
+ def sunsubscribe(&block); end
+
+ # source://redis//lib/redis/subscribe.rb#94
def unsubscribe(&block); end
end
+# source://redis//lib/redis/errors.rb#60
+class Redis::SubscriptionError < ::Redis::BaseError; end
+
# Raised when performing I/O times out.
#
-# source://redis//lib/redis/errors.rb#36
+# source://redis//lib/redis/errors.rb#45
class Redis::TimeoutError < ::Redis::BaseConnectionError; end
# source://redis//lib/redis/version.rb#4
Redis::VERSION = T.let(T.unsafe(nil), String)
+
+# source://redis//lib/redis/errors.rb#26
+class Redis::WrongTypeError < ::Redis::CommandError; end
diff --git a/sorbet/rbi/gems/sidekiq@6.5.12.rbi b/sorbet/rbi/gems/sidekiq@6.5.12.rbi
deleted file mode 100644
index acaed38c0..000000000
--- a/sorbet/rbi/gems/sidekiq@6.5.12.rbi
+++ /dev/null
@@ -1,2669 +0,0 @@
-# typed: true
-
-# DO NOT EDIT MANUALLY
-# This is an autogenerated file for types exported from the `sidekiq` gem.
-# Please instead update this file by running `bin/tapioca gem sidekiq`.
-
-
-# Use `Sidekiq.transactional_push!` in your sidekiq.rb initializer
-#
-# source://sidekiq//lib/sidekiq/version.rb#3
-module Sidekiq
- class << self
- # source://sidekiq//lib/sidekiq.rb#106
- def [](key); end
-
- # source://sidekiq//lib/sidekiq.rb#110
- def []=(key, val); end
-
- # How frequently Redis should be checked by a random Sidekiq process for
- # scheduled and retriable jobs. Each individual process will take turns by
- # waiting some multiple of this value.
- #
- # See sidekiq/scheduled.rb for an in-depth explanation of this value
- #
- # source://sidekiq//lib/sidekiq.rb#303
- def average_scheduled_poll_interval=(interval); end
-
- # @yield [@client_chain]
- #
- # source://sidekiq//lib/sidekiq.rb#209
- def client_middleware; end
-
- # config.concurrency = 5
- #
- # source://sidekiq//lib/sidekiq.rb#60
- def concurrency=(val); end
-
- # Configuration for Sidekiq client, use like:
- #
- # Sidekiq.configure_client do |config|
- # config.redis = { size: 1, url: 'redis://myhost:8877/0' }
- # end
- #
- # @yield [_self]
- # @yieldparam _self [Sidekiq] the object that the method was called on
- #
- # source://sidekiq//lib/sidekiq.rb#151
- def configure_client; end
-
- # Configuration for Sidekiq server, use like:
- #
- # Sidekiq.configure_server do |config|
- # config.server_middleware do |chain|
- # chain.add MyServerHook
- # end
- # end
- #
- # @yield [_self]
- # @yieldparam _self [Sidekiq] the object that the method was called on
- #
- # source://sidekiq//lib/sidekiq.rb#141
- def configure_server; end
-
- # Death handlers are called when all retries for a job have been exhausted and
- # the job dies. It's the notification to your application
- # that this job will not succeed without manual intervention.
- #
- # Sidekiq.configure_server do |config|
- # config.death_handlers << ->(job, ex) do
- # end
- # end
- #
- # source://sidekiq//lib/sidekiq.rb#250
- def death_handlers; end
-
- # Private APIs
- #
- # source://sidekiq//lib/sidekiq.rb#84
- def default_error_handler(ex, ctx); end
-
- # source://sidekiq//lib/sidekiq.rb#237
- def default_job_options; end
-
- # source://sidekiq//lib/sidekiq.rb#229
- def default_job_options=(hash); end
-
- # source://sidekiq//lib/sidekiq.rb#221
- def default_server_middleware; end
-
- # deprecated
- #
- # source://activesupport/7.0.8.4/lib/active_support/deprecation/method_wrappers.rb#63
- def default_worker_options(*args, **_arg1, &block); end
-
- # deprecated
- #
- # source://activesupport/7.0.8.4/lib/active_support/deprecation/method_wrappers.rb#63
- def default_worker_options=(*args, **_arg1, &block); end
-
- # source://sidekiq//lib/sidekiq.rb#258
- def dump_json(object); end
-
- # @return [Boolean]
- #
- # source://sidekiq//lib/sidekiq.rb#294
- def ent?; end
-
- # Register a proc to handle any error which occurs within the Sidekiq process.
- #
- # Sidekiq.configure_server do |config|
- # config.error_handlers << proc {|ex,ctx_hash| MyErrorService.notify(ex, ctx_hash) }
- # end
- #
- # The default error handler logs errors to Sidekiq.logger.
- #
- # source://sidekiq//lib/sidekiq.rb#314
- def error_handlers; end
-
- # source://sidekiq//lib/sidekiq.rb#118
- def fetch(*args, &block); end
-
- # source://sidekiq//lib/sidekiq.rb#122
- def handle_exception(ex, ctx = T.unsafe(nil)); end
-
- # source://sidekiq//lib/sidekiq.rb#254
- def load_json(string); end
-
- # source://sidekiq//lib/sidekiq.rb#262
- def log_formatter; end
-
- # source://sidekiq//lib/sidekiq.rb#270
- def log_formatter=(log_formatter); end
-
- # source://sidekiq//lib/sidekiq.rb#275
- def logger; end
-
- # source://sidekiq//lib/sidekiq.rb#279
- def logger=(logger); end
-
- # source://sidekiq//lib/sidekiq.rb#114
- def merge!(hash); end
-
- # Register a block to run at a point in the Sidekiq lifecycle.
- # :startup, :quiet or :shutdown are valid events.
- #
- # Sidekiq.configure_server do |config|
- # config.on(:shutdown) do
- # puts "Goodbye cruel world!"
- # end
- # end
- #
- # @raise [ArgumentError]
- #
- # source://sidekiq//lib/sidekiq.rb#326
- def on(event, &block); end
-
- # source://sidekiq//lib/sidekiq.rb#96
- def options; end
-
- # source://sidekiq//lib/sidekiq.rb#101
- def options=(opts); end
-
- # @return [Boolean]
- #
- # source://sidekiq//lib/sidekiq.rb#290
- def pro?; end
-
- # config.queues = %w( high default low ) # strict
- # config.queues = %w( high,3 default,2 low,1 ) # weighted
- # config.queues = %w( feature1,1 feature2,1 feature3,1 ) # random
- #
- # With weighted priority, queue will be checked first (weight / total) of the time.
- # high will be checked first (3/6) or 50% of the time.
- # I'd recommend setting weights between 1-10. Weights in the hundreds or thousands
- # are ridiculous and unnecessarily expensive. You can get random queue ordering
- # by explicitly setting all weights to 1.
- #
- # source://sidekiq//lib/sidekiq.rb#73
- def queues=(val); end
-
- # @raise [ArgumentError]
- #
- # source://sidekiq//lib/sidekiq.rb#159
- def redis; end
-
- # source://sidekiq//lib/sidekiq.rb#201
- def redis=(hash); end
-
- # source://sidekiq//lib/sidekiq.rb#181
- def redis_info; end
-
- # source://sidekiq//lib/sidekiq.rb#197
- def redis_pool; end
-
- # @return [Boolean]
- #
- # source://sidekiq//lib/sidekiq.rb#155
- def server?; end
-
- # @yield [@server_chain]
- #
- # source://sidekiq//lib/sidekiq.rb#215
- def server_middleware; end
-
- # source://sidekiq//lib/sidekiq.rb#332
- def strict_args!(mode = T.unsafe(nil)); end
-
- # source://sidekiq//lib/sidekiq/transaction_aware_client.rb#33
- def transactional_push!; end
-
- # source://sidekiq//lib/sidekiq.rb#55
- def ❨╯°□°❩╯︵┻━┻; end
- end
-end
-
-# source://sidekiq//lib/sidekiq/client.rb#8
-class Sidekiq::Client
- include ::Sidekiq::JobUtil
-
- # Sidekiq::Client normally uses the default Redis pool but you may
- # pass a custom ConnectionPool if you want to shard your
- # Sidekiq jobs across several Redis instances (for scalability
- # reasons, e.g.)
- #
- # Sidekiq::Client.new(ConnectionPool.new { Redis.new })
- #
- # Generally this is only needed for very large Sidekiq installs processing
- # thousands of jobs per second. I don't recommend sharding unless you
- # cannot scale any other way (e.g. splitting your app into smaller apps).
- #
- # @return [Client] a new instance of Client
- #
- # source://sidekiq//lib/sidekiq/client.rb#44
- def initialize(redis_pool = T.unsafe(nil)); end
-
- # Define client-side middleware:
- #
- # client = Sidekiq::Client.new
- # client.middleware do |chain|
- # chain.use MyClientMiddleware
- # end
- # client.push('class' => 'SomeJob', 'args' => [1,2,3])
- #
- # All client instances default to the globally-defined
- # Sidekiq.client_middleware but you can change as necessary.
- #
- # source://sidekiq//lib/sidekiq/client.rb#23
- def middleware(&block); end
-
- # The main method used to push a job to Redis. Accepts a number of options:
- #
- # queue - the named queue to use, default 'default'
- # class - the job class to call, required
- # args - an array of simple arguments to the perform method, must be JSON-serializable
- # at - timestamp to schedule the job (optional), must be Numeric (e.g. Time.now.to_f)
- # retry - whether to retry this job if it fails, default true or an integer number of retries
- # backtrace - whether to save any error backtrace, default false
- #
- # If class is set to the class name, the jobs' options will be based on Sidekiq's default
- # job options. Otherwise, they will be based on the job class's options.
- #
- # Any options valid for a job class's sidekiq_options are also available here.
- #
- # All options must be strings, not symbols. NB: because we are serializing to JSON, all
- # symbols in 'args' will be converted to strings. Note that +backtrace: true+ can take quite a bit of
- # space in Redis; a large volume of failing jobs can start Redis swapping if you aren't careful.
- #
- # Returns a unique Job ID. If middleware stops the job, nil will be returned instead.
- #
- # Example:
- # push('queue' => 'my_queue', 'class' => MyJob, 'args' => ['foo', 1, :bat => 'bar'])
- #
- # source://sidekiq//lib/sidekiq/client.rb#72
- def push(item); end
-
- # Push a large number of jobs to Redis. This method cuts out the redis
- # network round trip latency. I wouldn't recommend pushing more than
- # 1000 per call but YMMV based on network quality, size of job args, etc.
- # A large number of jobs can cause a bit of Redis command processing latency.
- #
- # Takes the same arguments as #push except that args is expected to be
- # an Array of Arrays. All other keys are duplicated for each job. Each job
- # is run through the client middleware pipeline and each job gets its own Job ID
- # as normal.
- #
- # Returns an array of the of pushed jobs' jids. The number of jobs pushed can be less
- # than the number given if the middleware stopped processing for one or more jobs.
- #
- # @raise [ArgumentError]
- #
- # source://sidekiq//lib/sidekiq/client.rb#97
- def push_bulk(items); end
-
- # Returns the value of attribute redis_pool.
- #
- # source://sidekiq//lib/sidekiq/client.rb#32
- def redis_pool; end
-
- # Sets the attribute redis_pool
- #
- # @param value the value to set the attribute redis_pool to.
- #
- # source://sidekiq//lib/sidekiq/client.rb#32
- def redis_pool=(_arg0); end
-
- private
-
- # source://sidekiq//lib/sidekiq/client.rb#221
- def atomic_push(conn, payloads); end
-
- # source://sidekiq//lib/sidekiq/client.rb#197
- def raw_push(payloads); end
-
- class << self
- # Resque compatibility helpers. Note all helpers
- # should go through Sidekiq::Job#client_push.
- #
- # Example usage:
- # Sidekiq::Client.enqueue(MyJob, 'foo', 1, :bat => 'bar')
- #
- # Messages are enqueued to the 'default' queue.
- #
- # source://sidekiq//lib/sidekiq/client.rb#162
- def enqueue(klass, *args); end
-
- # Example usage:
- # Sidekiq::Client.enqueue_in(3.minutes, MyJob, 'foo', 1, :bat => 'bar')
- #
- # source://sidekiq//lib/sidekiq/client.rb#190
- def enqueue_in(interval, klass, *args); end
-
- # Example usage:
- # Sidekiq::Client.enqueue_to(:queue_name, MyJob, 'foo', 1, :bat => 'bar')
- #
- # source://sidekiq//lib/sidekiq/client.rb#169
- def enqueue_to(queue, klass, *args); end
-
- # Example usage:
- # Sidekiq::Client.enqueue_to_in(:queue_name, 3.minutes, MyJob, 'foo', 1, :bat => 'bar')
- #
- # source://sidekiq//lib/sidekiq/client.rb#176
- def enqueue_to_in(queue, interval, klass, *args); end
-
- # source://sidekiq//lib/sidekiq/client.rb#146
- def push(item); end
-
- # source://sidekiq//lib/sidekiq/client.rb#150
- def push_bulk(items); end
-
- # Allows sharding of jobs across any number of Redis instances. All jobs
- # defined within the block will use the given Redis connection pool.
- #
- # pool = ConnectionPool.new { Redis.new }
- # Sidekiq::Client.via(pool) do
- # SomeJob.perform_async(1,2,3)
- # SomeOtherJob.perform_async(1,2,3)
- # end
- #
- # Generally this is only needed for very large Sidekiq installs processing
- # thousands of jobs per second. I do not recommend sharding unless
- # you cannot scale any other way (e.g. splitting your app into smaller apps).
- #
- # source://sidekiq//lib/sidekiq/client.rb#136
- def via(pool); end
- end
-end
-
-# no difference for now
-#
-# source://sidekiq//lib/sidekiq/middleware/modules.rb#20
-Sidekiq::ClientMiddleware = Sidekiq::ServerMiddleware
-
-# Sidekiq::Component assumes a config instance is available at @config
-#
-# source://sidekiq//lib/sidekiq/component.rb#4
-module Sidekiq::Component
- # source://sidekiq//lib/sidekiq/component.rb#5
- def config; end
-
- # source://sidekiq//lib/sidekiq/component.rb#49
- def fire_event(event, options = T.unsafe(nil)); end
-
- # source://sidekiq//lib/sidekiq/component.rb#45
- def handle_exception(ex, ctx = T.unsafe(nil)); end
-
- # source://sidekiq//lib/sidekiq/component.rb#33
- def hostname; end
-
- # source://sidekiq//lib/sidekiq/component.rb#41
- def identity; end
-
- # source://sidekiq//lib/sidekiq/component.rb#21
- def logger; end
-
- # source://sidekiq//lib/sidekiq/component.rb#37
- def process_nonce; end
-
- # source://sidekiq//lib/sidekiq/component.rb#25
- def redis(&block); end
-
- # source://sidekiq//lib/sidekiq/component.rb#14
- def safe_thread(name, &block); end
-
- # source://sidekiq//lib/sidekiq/component.rb#29
- def tid; end
-
- # source://sidekiq//lib/sidekiq/component.rb#7
- def watchdog(last_words); end
-end
-
-# source://sidekiq//lib/sidekiq/logger.rb#7
-module Sidekiq::Context
- class << self
- # source://sidekiq//lib/sidekiq/logger.rb#20
- def add(k, v); end
-
- # source://sidekiq//lib/sidekiq/logger.rb#16
- def current; end
-
- # source://sidekiq//lib/sidekiq/logger.rb#8
- def with(hash); end
- end
-end
-
-# source://sidekiq//lib/sidekiq.rb#20
-Sidekiq::DEFAULTS = T.let(T.unsafe(nil), Hash)
-
-# DEFAULT_ERROR_HANDLER is a constant that allows the default error handler to
-# be referenced. It must be defined here, after the default_error_handler
-# method is defined.
-#
-# source://sidekiq//lib/sidekiq.rb#93
-Sidekiq::DEFAULT_ERROR_HANDLER = T.let(T.unsafe(nil), Method)
-
-# The set of dead jobs within Sidekiq. Dead jobs have failed all of
-# their retries and are helding in this set pending some sort of manual
-# fix. They will be removed after 6 months (dead_timeout) if not.
-#
-# source://sidekiq//lib/sidekiq/api.rb#840
-class Sidekiq::DeadSet < ::Sidekiq::JobSet
- # @return [DeadSet] a new instance of DeadSet
- #
- # source://sidekiq//lib/sidekiq/api.rb#841
- def initialize; end
-
- # Add the given job to the Dead set.
- #
- # @param message [String] the job data as JSON
- #
- # source://sidekiq//lib/sidekiq/api.rb#847
- def kill(message, opts = T.unsafe(nil)); end
-
- # Enqueue all dead jobs
- #
- # source://sidekiq//lib/sidekiq/api.rb#869
- def retry_all; end
-
- class << self
- # The maximum size of the Dead set. Older entries will be trimmed
- # to stay within this limit. Default value is 10,000.
- #
- # source://sidekiq//lib/sidekiq/api.rb#875
- def max_jobs; end
-
- # The time limit for entries within the Dead set. Older entries will be thrown away.
- # Default value is six months.
- #
- # source://sidekiq//lib/sidekiq/api.rb#881
- def timeout; end
- end
-end
-
-# source://sidekiq//lib/sidekiq/delay.rb#4
-module Sidekiq::Extensions
- class << self
- # source://sidekiq//lib/sidekiq/delay.rb#5
- def enable_delay!; end
- end
-end
-
-# source://sidekiq//lib/sidekiq/delay.rb#28
-module Sidekiq::Extensions::PsychAutoload
- # source://sidekiq//lib/sidekiq/delay.rb#29
- def resolve_class(klass_name); end
-end
-
-# source://sidekiq//lib/sidekiq.rb#47
-Sidekiq::FAKE_INFO = T.let(T.unsafe(nil), Hash)
-
-# source://sidekiq//lib/sidekiq/job.rb#12
-Sidekiq::Job = Sidekiq::Worker
-
-# Represents a pending job within a Sidekiq queue.
-#
-# The job should be considered immutable but may be
-# removed from the queue via JobRecord#delete.
-#
-# source://sidekiq//lib/sidekiq/api.rb#349
-class Sidekiq::JobRecord
- # @api private
- # @return [JobRecord] a new instance of JobRecord
- #
- # source://sidekiq//lib/sidekiq/api.rb#362
- def initialize(item, queue_name = T.unsafe(nil)); end
-
- # Access arbitrary attributes within the job hash
- #
- # source://sidekiq//lib/sidekiq/api.rb#485
- def [](name); end
-
- # source://sidekiq//lib/sidekiq/api.rb#441
- def args; end
-
- # source://sidekiq//lib/sidekiq/api.rb#453
- def created_at; end
-
- # Remove this job from the queue
- #
- # source://sidekiq//lib/sidekiq/api.rb#477
- def delete; end
-
- # source://sidekiq//lib/sidekiq/api.rb#410
- def display_args; end
-
- # source://sidekiq//lib/sidekiq/api.rb#388
- def display_class; end
-
- # source://sidekiq//lib/sidekiq/api.rb#449
- def enqueued_at; end
-
- # source://sidekiq//lib/sidekiq/api.rb#461
- def error_backtrace; end
-
- # the parsed Hash of job data
- #
- # source://sidekiq//lib/sidekiq/api.rb#352
- def item; end
-
- # source://sidekiq//lib/sidekiq/api.rb#445
- def jid; end
-
- # This is the job class which Sidekiq will execute. If using ActiveJob,
- # this class will be the ActiveJob adapter class rather than a specific job.
- #
- # source://sidekiq//lib/sidekiq/api.rb#384
- def klass; end
-
- # source://sidekiq//lib/sidekiq/api.rb#471
- def latency; end
-
- # @api private
- #
- # source://sidekiq//lib/sidekiq/api.rb#371
- def parse(item); end
-
- # the queue associated with this job
- #
- # source://sidekiq//lib/sidekiq/api.rb#358
- def queue; end
-
- # source://sidekiq//lib/sidekiq/api.rb#457
- def tags; end
-
- # the underlying String in Redis
- #
- # source://sidekiq//lib/sidekiq/api.rb#355
- def value; end
-
- private
-
- # source://sidekiq//lib/sidekiq/api.rb#494
- def safe_load(content, default); end
-
- # source://sidekiq//lib/sidekiq/api.rb#504
- def uncompress_backtrace(backtrace); end
-end
-
-# Base class for all sorted sets which contain jobs, e.g. scheduled, retry and dead.
-# Sidekiq Pro and Enterprise add additional sorted sets which do not contain job data,
-# e.g. Batches.
-#
-# source://sidekiq//lib/sidekiq/api.rb#684
-class Sidekiq::JobSet < ::Sidekiq::SortedSet
- # @api private
- #
- # source://sidekiq//lib/sidekiq/api.rb#770
- def delete(score, jid); end
-
- # @api private
- #
- # source://sidekiq//lib/sidekiq/api.rb#770
- def delete_by_jid(score, jid); end
-
- # @api private
- #
- # source://sidekiq//lib/sidekiq/api.rb#760
- def delete_by_value(name, value); end
-
- # source://sidekiq//lib/sidekiq/api.rb#694
- def each; end
-
- # Fetch jobs that match a given time or Range. Job ID is an
- # optional second argument.
- #
- # @param score [Time, Range] a specific timestamp or range
- # @param jid [String, optional] find a specific JID within the score
- # @return [Array] any results found, can be empty
- #
- # source://sidekiq//lib/sidekiq/api.rb#722
- def fetch(score, jid = T.unsafe(nil)); end
-
- # Find the job with the given JID within this sorted set.
- # *This is a slow O(n) operation*. Do not use for app logic.
- #
- # @param jid [String] the job identifier
- # @return [SortedEntry] the record or nil
- #
- # source://sidekiq//lib/sidekiq/api.rb#747
- def find_job(jid); end
-
- # Add a job with the associated timestamp to this set.
- #
- # @param timestamp [Time] the score for the job
- # @param job [Hash] the job data
- #
- # source://sidekiq//lib/sidekiq/api.rb#688
- def schedule(timestamp, job); end
-end
-
-# source://sidekiq//lib/sidekiq/job_util.rb#5
-module Sidekiq::JobUtil
- # @raise [ArgumentError]
- #
- # source://sidekiq//lib/sidekiq/job_util.rb#35
- def normalize_item(item); end
-
- # source://sidekiq//lib/sidekiq/job_util.rb#56
- def normalized_hash(item_class); end
-
- # @raise [ArgumentError]
- #
- # source://sidekiq//lib/sidekiq/job_util.rb#10
- def validate(item); end
-
- # source://sidekiq//lib/sidekiq/job_util.rb#18
- def verify_json(item); end
-
- private
-
- # @return [Boolean]
- #
- # source://sidekiq//lib/sidekiq/job_util.rb#67
- def json_safe?(item); end
-end
-
-# These functions encapsulate various job utilities.
-#
-# source://sidekiq//lib/sidekiq/job_util.rb#8
-Sidekiq::JobUtil::TRANSIENT_ATTRIBUTES = T.let(T.unsafe(nil), Array)
-
-# source://sidekiq//lib/sidekiq.rb#18
-Sidekiq::LICENSE = T.let(T.unsafe(nil), String)
-
-# source://sidekiq//lib/sidekiq/logger.rb#95
-class Sidekiq::Logger < ::Logger
- include ::Sidekiq::LoggingUtils
-
- # @return [Logger] a new instance of Logger
- #
- # source://sidekiq//lib/sidekiq/logger.rb#98
- def initialize(*args, **kwargs); end
-end
-
-# source://sidekiq//lib/sidekiq/logger.rb#103
-module Sidekiq::Logger::Formatters; end
-
-# source://sidekiq//lib/sidekiq/logger.rb#104
-class Sidekiq::Logger::Formatters::Base < ::Logger::Formatter
- # source://sidekiq//lib/sidekiq/logger.rb#109
- def ctx; end
-
- # source://sidekiq//lib/sidekiq/logger.rb#113
- def format_context; end
-
- # source://sidekiq//lib/sidekiq/logger.rb#105
- def tid; end
-end
-
-# source://sidekiq//lib/sidekiq/logger.rb#139
-class Sidekiq::Logger::Formatters::JSON < ::Sidekiq::Logger::Formatters::Base
- # source://sidekiq//lib/sidekiq/logger.rb#140
- def call(severity, time, program_name, message); end
-end
-
-# source://sidekiq//lib/sidekiq/logger.rb#127
-class Sidekiq::Logger::Formatters::Pretty < ::Sidekiq::Logger::Formatters::Base
- # source://sidekiq//lib/sidekiq/logger.rb#128
- def call(severity, time, program_name, message); end
-end
-
-# source://sidekiq//lib/sidekiq/logger.rb#133
-class Sidekiq::Logger::Formatters::WithoutTimestamp < ::Sidekiq::Logger::Formatters::Pretty
- # source://sidekiq//lib/sidekiq/logger.rb#134
- def call(severity, time, program_name, message); end
-end
-
-# source://sidekiq//lib/sidekiq/logger.rb#25
-module Sidekiq::LoggingUtils
- # Redefined to check severity against #level, and thus the thread-local level, rather than +@level+.
- # FIXME: Remove when the minimum Ruby version supports overriding Logger#level.
- #
- # source://sidekiq//lib/sidekiq/logger.rb#76
- def add(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end
-
- # source://sidekiq//lib/sidekiq/logger.rb#39
- def debug?; end
-
- # source://sidekiq//lib/sidekiq/logger.rb#39
- def error?; end
-
- # source://sidekiq//lib/sidekiq/logger.rb#39
- def fatal?; end
-
- # source://sidekiq//lib/sidekiq/logger.rb#39
- def info?; end
-
- # source://sidekiq//lib/sidekiq/logger.rb#61
- def level; end
-
- # source://sidekiq//lib/sidekiq/logger.rb#44
- def local_level; end
-
- # source://sidekiq//lib/sidekiq/logger.rb#48
- def local_level=(level); end
-
- # Change the thread-local level for the duration of the given block.
- #
- # source://sidekiq//lib/sidekiq/logger.rb#66
- def log_at(level); end
-
- # source://sidekiq//lib/sidekiq/logger.rb#39
- def warn?; end
-end
-
-# source://sidekiq//lib/sidekiq/logger.rb#26
-Sidekiq::LoggingUtils::LEVELS = T.let(T.unsafe(nil), Hash)
-
-# Middleware is code configured to run before/after
-# a job is processed. It is patterned after Rack
-# middleware. Middleware exists for the client side
-# (pushing jobs onto the queue) as well as the server
-# side (when jobs are actually processed).
-#
-# Callers will register middleware Classes and Sidekiq will
-# create new instances of the middleware for every job. This
-# is important so that instance state is not shared accidentally
-# between job executions.
-#
-# To add middleware for the client:
-#
-# Sidekiq.configure_client do |config|
-# config.client_middleware do |chain|
-# chain.add MyClientHook
-# end
-# end
-#
-# To modify middleware for the server, just call
-# with another block:
-#
-# Sidekiq.configure_server do |config|
-# config.server_middleware do |chain|
-# chain.add MyServerHook
-# chain.remove ActiveRecord
-# end
-# end
-#
-# To insert immediately preceding another entry:
-#
-# Sidekiq.configure_client do |config|
-# config.client_middleware do |chain|
-# chain.insert_before ActiveRecord, MyClientHook
-# end
-# end
-#
-# To insert immediately after another entry:
-#
-# Sidekiq.configure_client do |config|
-# config.client_middleware do |chain|
-# chain.insert_after ActiveRecord, MyClientHook
-# end
-# end
-#
-# This is an example of a minimal server middleware:
-#
-# class MyServerHook
-# include Sidekiq::ServerMiddleware
-#
-# def call(job_instance, msg, queue)
-# logger.info "Before job"
-# redis {|conn| conn.get("foo") } # do something in Redis
-# yield
-# logger.info "After job"
-# end
-# end
-#
-# This is an example of a minimal client middleware, note
-# the method must return the result or the job will not push
-# to Redis:
-#
-# class MyClientHook
-# include Sidekiq::ClientMiddleware
-#
-# def call(job_class, msg, queue, redis_pool)
-# logger.info "Before push"
-# result = yield
-# logger.info "After push"
-# result
-# end
-# end
-#
-# source://sidekiq//lib/sidekiq/middleware/chain.rb#79
-module Sidekiq::Middleware; end
-
-# source://sidekiq//lib/sidekiq/middleware/chain.rb#80
-class Sidekiq::Middleware::Chain
- include ::Enumerable
-
- # @api private
- # @return [Chain] a new instance of Chain
- # @yield [_self]
- # @yieldparam _self [Sidekiq::Middleware::Chain] the object that the method was called on
- #
- # source://sidekiq//lib/sidekiq/middleware/chain.rb#98
- def initialize(config = T.unsafe(nil)); end
-
- # Add the given middleware to the end of the chain.
- # Sidekiq will call `klass.new(*args)` to create a clean
- # copy of your middleware for every job executed.
- #
- # chain.add(Statsd::Metrics, { collector: "localhost:8125" })
- #
- # @param klass [Class] Your middleware class
- # @param *args [Array