Bug #4775 ยป 0001-Completed-CGI-documentation.patch
| lib/cgi/cookie.rb | ||
|---|---|---|
| ## | ||
| # Cookie methods in the CGI module | ||
| # | ||
| class CGI | ||
|   @@accept_charset="UTF-8" unless defined?(@@accept_charset) | ||
|   # Class representing an HTTP cookie. | ||
| lib/cgi/core.rb | ||
|---|---|---|
| #-- | ||
| ## | ||
| # Methods for generating HTML, parsing CGI-related parameters, and | ||
| # generating HTTP responses. | ||
| #++ | ||
| # | ||
| class CGI | ||
|   $CGI_ENV = ENV    # for FCGI support | ||
| ... | ... | |
|   REVISION = '$Id$' #:nodoc: | ||
|   # Whether processing will be required in binary vs text | ||
|   NEEDS_BINMODE = File::BINARY != 0 | ||
|   # Path separators in different environments. | ||
| ... | ... | |
|       @params.update(hash) | ||
|     end | ||
|     ## | ||
|     # Parses multipart form elements according to  | ||
|     #   http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2 | ||
|     # | ||
|     # Returns a hash of multipart form parameters with bodies of type StringIO or  | ||
|     # Tempfile depending on whether the multipart form element exceeds 10 KB | ||
|     # | ||
|     #   params[name => body] | ||
|     # | ||
|     def read_multipart(boundary, content_length) | ||
|       ## read first boundary | ||
|       stdin = $stdin | ||
| ... | ... | |
|     end | ||
|     private :initialize_query | ||
|     # Returns whether the form contained multipart/form-data | ||
|     def multipart? | ||
|       @multipart | ||
|     end | ||
| ... | ... | |
|   # | ||
|   #   CGI.accept_charset = "EUC-JP" | ||
|   # | ||
|   @@accept_charset="UTF-8" | ||
|   # Return the accept character set for all new CGI instances. | ||
| lib/cgi/html.rb | ||
|---|---|---|
| ## | ||
| # HTML element generating methods | ||
| # | ||
| class CGI | ||
|   # Base module for HTML-generation mixins. | ||
|   # | ||
| lib/cgi/session.rb | ||
|---|---|---|
| require 'cgi' | ||
| require 'tmpdir' | ||
| class CGI | ||
| class CGI #:nodoc: | ||
|   # == Overview | ||
|   # | ||
| lib/cgi/session/pstore.rb | ||
|---|---|---|
| require 'cgi/session' | ||
| require 'pstore' | ||
| class CGI | ||
|   class Session | ||
| class CGI #:nodoc: | ||
|   class Session #:nodoc: | ||
|     # PStore-based session storage class. | ||
|     # | ||
|     # This builds upon the top-level PStore class provided by the | ||
| lib/cgi/util.rb | ||
|---|---|---|
| ## | ||
| # Utility methods for escaping and prettifying HTML, and for date formatting. | ||
| # | ||
| class CGI | ||
|   @@accept_charset="UTF-8" unless defined?(@@accept_charset) | ||
|   # URL-encode a string. | ||
| ... | ... | |
|     str.valid_encoding? ? str : str.force_encoding(string.encoding) | ||
|   end | ||
|   # The set of special characters and their escaped values | ||
|   TABLE_FOR_ESCAPE_HTML__ = { | ||
|     '&' => '&', | ||
|     '"' => '"', | ||
| ... | ... | |
|     end | ||
|   end | ||
|   # Synonym for CGI.escapeHTML. | ||
|   # Synonym for CGI::escapeHTML(str) | ||
|   def CGI::escape_html(str) | ||
|     escapeHTML(str) | ||
|   end | ||
|   # Synonym for CGI.unescapeHTML. | ||
|  | ||
|   # Synonym for CGI::unescapeHTML(str) | ||
|   def CGI::unescape_html(str) | ||
|     unescapeHTML(str) | ||
|   end | ||
| ... | ... | |
|     end | ||
|   end | ||
|   # Synonym for CGI.escapeElement. | ||
|   # Synonym for CGI::escapeElement(str) | ||
|   def CGI::escape_element(str) | ||
|     escapeElement(str) | ||
|   end | ||
|   # Synonym for CGI.unescapeElement. | ||
|  | ||
|   # Synonym for CGI::unescapeElement(str) | ||
|   def CGI::unescape_element(str) | ||
|     unescapeElement(str) | ||
|   end | ||