Skip to content

Commit

Permalink
* lib/cgi/util.rb: Improve documentation. Patch by Clinton Nixon.
Browse files Browse the repository at this point in the history
	  [Ruby 1.9 - Bug ruby#4733]
	* lib/cgi/core.rb:  ditto
	* lib/cgi/cookie.rb:  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
drbrain committed May 18, 2011
1 parent ebce1b4 commit 3427614
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Thu May 19 06:06:07 2011 Eric Hodel <[email protected]>

* lib/cgi/util.rb: Improve documentation. Patch by Clinton Nixon.
[Ruby 1.9 - Bug #4733]
* lib/cgi/core.rb: ditto
* lib/cgi/cookie.rb: ditto

Thu May 19 06:02:21 2011 Eric Hodel <[email protected]>

* lib/tempfile.rb: Document Dir.mkdir and Dir.rmdir. Patch by Clinton
Expand Down
2 changes: 2 additions & 0 deletions lib/cgi/cookie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ def initialize(name = "", *value)
# True if this cookie is secure; false otherwise
attr_reader("secure")

# Returns the value or list of values for this cookie.
def value
self
end

# Replaces the value of this cookie with a new value or list of values.
def value=(val)
replace(Array(val))
end
Expand Down
6 changes: 6 additions & 0 deletions lib/cgi/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,17 @@ class CGI

# :startdoc:

# Synonym for ENV.
def env_table
ENV
end

# Synonym for $stdin.
def stdinput
$stdin
end

# Synonym for $stdout.
def stdoutput
$stdout
end
Expand Down Expand Up @@ -705,14 +708,17 @@ class InvalidEncoding < Exception; end

@@accept_charset="UTF-8"

# Return the accept character set for all new CGI instances.
def self.accept_charset
@@accept_charset
end

# Set the accept character set for all new CGI instances.
def self.accept_charset=(accept_charset)
@@accept_charset=accept_charset
end

# Return the accept character set for this CGI instance.
attr_reader :accept_charset

# Create a new CGI instance.
Expand Down
8 changes: 8 additions & 0 deletions lib/cgi/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@ def CGI::unescapeHTML(string)
end
end
end

# Synonym for CGI.escapeHTML.
def CGI::escape_html(str)
escapeHTML(str)
end

# Synonym for CGI.unescapeHTML.
def CGI::unescape_html(str)
unescapeHTML(str)
end
Expand Down Expand Up @@ -134,9 +138,13 @@ def CGI::unescapeElement(string, *elements)
string
end
end

# Synonym for CGI.escapeElement.
def CGI::escape_element(str)
escapeElement(str)
end

# Synonym for CGI.unescapeElement.
def CGI::unescape_element(str)
unescapeElement(str)
end
Expand Down

0 comments on commit 3427614

Please sign in to comment.