stdlib/cgi/0/core.rbs in rbs-2.0.0 vs stdlib/cgi/0/core.rbs in rbs-2.1.0
- old
+ new
@@ -1,5 +1,6 @@
+# <!-- rdoc-file=lib/cgi.rb -->
# ## Overview
#
# The Common Gateway Interface (CGI) is a simple protocol for passing an HTTP
# request from a web server to a standalone program, and returning the output to
# the web browser. Basically, a CGI program is called with the parameters of
@@ -264,11 +265,17 @@
#
# require 'cgi/util'
# include CGI::Util
# escapeHTML('Usage: foo "bar" <baz>')
# h('Usage: foo "bar" <baz>') # alias
+#
class CGI
+ # <!--
+ # rdoc-file=lib/cgi/core.rb
+ # - CGI.new(tag_maker) { block }
+ # - CGI.new(options_hash = {}) { block }
+ # -->
# Create a new CGI instance.
#
# `tag_maker`
# : This is the same as using the `options_hash` form with the value `{
# :tag_maker => tag_maker }` Note that it is recommended to use the
@@ -341,39 +348,60 @@
# varies according to the REQUEST_METHOD.
#
def initialize: (?String tag_maker) ?{ (String name, String value) -> void } -> void
| (Hash[Symbol, untyped] options_hash) ?{ (String name, String value) -> void } -> void
+ # <!-- rdoc-file=lib/cgi/core.rb -->
+ # Return the accept character set for this CGI instance.
+ #
attr_reader accept_charset: String
+ # <!--
+ # rdoc-file=lib/cgi/core.rb
+ # - accept_charset()
+ # -->
# Return the accept character set for all new CGI instances.
#
def self.accept_charset: () -> String
+ # <!--
+ # rdoc-file=lib/cgi/core.rb
+ # - accept_charset=(accept_charset)
+ # -->
# Set the accept character set for all new CGI instances.
#
def self.accept_charset=: (String accept_charset) -> String
+ # <!--
+ # rdoc-file=lib/cgi/core.rb
+ # - parse(query)
+ # -->
# Parse an HTTP query string into a hash of key=>value pairs.
#
# params = CGI.parse("query_string")
# # {"name1" => ["value1", "value2", ...],
# # "name2" => ["value1", "value2", ...], ... }
#
def self.parse: (String query) -> Hash[String, String | Array[String]]
public
+ # <!-- rdoc-file=lib/cgi/core.rb -->
# This method is an alias for #http_header, when HTML5 tag maker is inactive.
#
# NOTE: use #http_header to create HTTP header blocks, this alias is only
# provided for backwards compatibility.
#
# Using #header with the HTML5 tag maker will create a <header> element.
#
alias header http_header
+ # <!--
+ # rdoc-file=lib/cgi/core.rb
+ # - http_header(content_type_string="text/html")
+ # - http_header(headers_hash)
+ # -->
# Create an HTTP header block as a string.
#
# Includes the empty line that ends the header block.
#
# `content_type_string`
@@ -485,10 +513,15 @@
def http_header: (?String options) -> String
| (?Hash[String | Symbol, untyped] header_hash) -> String
def nph?: () -> boolish
+ # <!--
+ # rdoc-file=lib/cgi/core.rb
+ # - cgi.out(content_type_string='text/html')
+ # - cgi.out(headers_hash)
+ # -->
# Print an HTTP header and body to $DEFAULT_OUTPUT ($>)
#
# `content_type_string`
# : If a string is passed, it is assumed to be the content type.
# `headers_hash`
@@ -549,46 +582,72 @@
# # string
#
def out: (?String content_type_string) { () -> String } -> void
| (Hash[String | Symbol, untyped] headers_hash) { () -> String } -> void
+ # <!--
+ # rdoc-file=lib/cgi/core.rb
+ # - print(*options)
+ # -->
# Print an argument or list of arguments to the default output stream
#
# cgi = CGI.new
# cgi.print # default: cgi.print == $DEFAULT_OUTPUT.print
#
def print: (*String options) -> void
private
+ # <!--
+ # rdoc-file=lib/cgi/core.rb
+ # - stdinput()
+ # -->
# Synonym for $stdin.
#
def stdinput: () -> ::IO
+ # <!--
+ # rdoc-file=lib/cgi/core.rb
+ # - stdoutput()
+ # -->
# Synonym for $stdout.
#
def stdoutput: () -> ::IO
end
+# <!-- rdoc-file=lib/cgi/core.rb -->
# String for carriage return
+#
CGI::CR: String
+# <!-- rdoc-file=lib/cgi/core.rb -->
# Standard internet newline sequence
+#
CGI::EOL: String
+# <!-- rdoc-file=lib/cgi/core.rb -->
# HTTP status codes.
+#
CGI::HTTP_STATUS: Hash[String, String]
+# <!-- rdoc-file=lib/cgi/core.rb -->
# String for linefeed
+#
CGI::LF: String
+# <!-- rdoc-file=lib/cgi/core.rb -->
# Maximum number of request parameters when multipart
+#
CGI::MAX_MULTIPART_COUNT: Integer
+# <!-- rdoc-file=lib/cgi/core.rb -->
# Whether processing will be required in binary vs text
+#
CGI::NEEDS_BINMODE: bool
+# <!-- rdoc-file=lib/cgi/core.rb -->
# Path separators in different environments.
+#
CGI::PATH_SEPARATOR: Hash[String, String]
CGI::REVISION: String
CGI::VERSION: String