Ruby/Asp

Ruby-ASP provides an Active Server Pages port to the Apache Web Server with Ruby scripting only, and enables developing of dynamic web applications with session management and embedded Ruby code.

Ruby-Asp Class Reference Manual

[top]

$Session

$Session[key]
$Session[key] = value
$Session.timeout( minutes )
Timeout property, if minutes is being assigned, sets this default timeout for the user session.
$Session.sessionID
SessionID property, returns the id for the current session, which is exchanged between the client and the server as a cookie.
$Session.abandon
The abandon method times out the session immediately.
[top]

$Request

$Request.form( data )
Returns the value of the input of name used in a form with POST method.
$Request.queryString( data )
Returns the value of the input of name used in a form with GET method.
$Request.cookies( name, [key] )
Returns the value of the Cookie with name. If a key is specified, then a lookup will be done on the cookie as if it were a query string.
$Request.serverVariables( name )
Returns the value of the server variable / environment variable with name name. If name is not specified, returns a ref to a hash of all the server / environment variables data. The following would be a common use of this method:
env = $Request.serverVariables();
# env here would be equivalent to the ENV.
$Request.method
API extension. Returns the client HTTP request method, as in GET or POST.
$Request.totalBytes
The amount of data sent by the client in the body of the request, usually the length of the form data. This is the same value as
$Request.serverVariables('CONTENT_LENGTH')
[top]

$Response

$Response.write( string )
Write output to the HTML page.
$Response.addHeader( key, value )
Adds a custom header to a web page.
$Response.appendToLog( message )
Adds message to the server log.
$Response.end
Sends result to client, and immediately exits script.
$Response.include( filename, *args )
This API extension calls the routine compiled from asp script in filename with the args *args.
$Response.trapInclude( filename, *args )
Calls $Response.include() with same arguments as passed to it, but instead traps the include output buffer and returns it.
$Response.redirect( url )
Sends the client a command to go to a different url.
$Response.cookies( name, [key], value )
Sets the key or attribute of cookie with name name to the value value.
$Response.charset = value
This member when set appends itself to the value of the Content-Type HTTP header.
$Response.contentType = value
Sets the MIME type for the current response being sent to the client.
$Response.expires = time
Sends a response header to the client indicating the time in SECONDS in which the document should expire.
$Response.expiresAbsolute. = date
Sends a response header to the client with date being an absolute time to expire.
[top]

$Server

$Server.file( )
Returns the absolute file path to current executing script.
$Server.html_encode( string )
Returns an HTML escapes version of string. &, ", >, <, are each escapes with their HTML equivalents.
$Server.mapPath( url )
Given the url, absolute, or relative to the current executing script, this method returns the equivalent filename that the server would translate the request to, regardless or whether the request would be valid.
$Server.mail( hMailOps, hSMTPOps )
API extension to send email.
$Server.url_encode( string )
Returns the URL-escaped version of the string.
$Server.url( url, hParams )
Will return a URL with hParams serialized into a query string.
$Server.xslt( xsl_data, xml_data )
This method takes string for XSL and XML data and returns the XSLT output as a string.
$Server.execute( filename, *args )
Same as $Response.include( filename, *args ).
$Server.transfer( filename, *args )
Transfers control to another script. Same as $Response.include( filename, *args ); $Response.end.
[top]

$Application

$Application
Like the $Session object, you may use the $Application object to store data across the entire life of the application.
[top]

Asp::Common

Asp::Common::version
Asp::Common::sessionID
Asp::Common::url_decode( value )
Asp::Common::url_encode( s )
Asp::Common::html_escape( s )
Asp::Common::time2str( time )
Asp::Common::str2time( time ) (TODO)
Asp::Common::require( file ) (DEPRECATED)
Asp::Common::stateDir
Asp::Common::globalASA
[top]

Style : [ mozilla | blue | print | basic ]

Valid HTML 4.01! Valid CSS! mod_ruby

Copyright © 2003, Grégoire Lejeune.