mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
removed the rdoc since rake likes to remove it
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@18 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
parent
38f325e222
commit
644d78fc01
42 changed files with 87 additions and 4529 deletions
107
README
107
README
|
@ -1,4 +1,4 @@
|
|||
== Mongrel: Simple Fast Mostly Ruby Web Server
|
||||
= Mongrel: Simple Fast Mostly Ruby Web Server
|
||||
|
||||
Mongrel is a small library that provides a very fast HTTP 1.1 server for Ruby
|
||||
web applications. It is not particular to any framework, and is intended to
|
||||
|
@ -7,45 +7,110 @@ web server.
|
|||
|
||||
What makes Mongrel so fast is the careful use of a C extension to provide fast
|
||||
HTTP 1.1 protocol parsing and fast URI lookup. This combination makes the server
|
||||
very fast without too many portability issues.
|
||||
scream without too many portability issues.
|
||||
|
||||
== Status
|
||||
|
||||
Mongrel is still very ALPHA work, but you can see how it's used with the
|
||||
Camping framework (version 1.2) and take a look at how you might use it.
|
||||
Right now it handles HTTP requests well and process the responses fast, but
|
||||
you have to "roll your own" response code.
|
||||
The 0.2.0 release of Mongrel features an HTTP core server that is the fastest possible
|
||||
thing I could get without using something other than Ruby. It features a few bug fixes,
|
||||
but mostly just a change to the Mongrel::HttpResponse class to make it more feature
|
||||
complete. The remaining development will be spent getting Mongrel to work with
|
||||
other frameworks, adding additional needed features, and improving the concurrency
|
||||
and speed.
|
||||
|
||||
The current release has samples from "why the lucky stiff" for his Camping
|
||||
framework in the examples directory. Camping is a small micro framework
|
||||
(http://rubyforge.org/projects/camping) which should work with Mongrel if
|
||||
you use the subversion source for Camping.
|
||||
|
||||
This is also the first release onto the new Mongrel RubyForge project
|
||||
page found at http://rubyforge.org/projects/mongrel/ thanks to Tom Copland.
|
||||
I'll be looking to automate management of this, but feel free to use
|
||||
rubyforge to post feature requests, bugs, and join the mailing list.
|
||||
|
||||
The next release of Mongrel will have improved IO handling, much more stability,
|
||||
and should have a better Mongrel::HttpResponse object with more useful features.
|
||||
|
||||
== Install
|
||||
|
||||
You can install it via source from http://www.zedshaw.com/downloads/mongrel/
|
||||
or you can gram a RubyGem at http://www.zedshaw.com/downloads/mongrel/
|
||||
and install that manually. I'm working on setting up a RubyForge project.
|
||||
|
||||
It doesn't explicitly require Camping, but if you want to run the examples/tepee.rb
|
||||
example then you'll need to install Camping 1.2 at least (and redcloth I think).
|
||||
It doesn't explicitly require Camping, but if you want to run the examples/camping/
|
||||
examples then you'll need to install Camping 1.2 at least (and redcloth I think).
|
||||
These are all available from RubyGems.
|
||||
|
||||
The library consists of a C extension so you'll need a C compiler or at least a friend
|
||||
who can build it for you.
|
||||
|
||||
Finally, the source includes a setup.rb for those who hate RubyGems.
|
||||
|
||||
Finally, the source include a setup.rb for those who hate RubyGems.
|
||||
|
||||
== Usage
|
||||
|
||||
Best place to look for usage examples right now is the examples/ directory.
|
||||
The examples/simpletest.rb file has the following code as the simplest
|
||||
example:
|
||||
|
||||
require 'mongrel'
|
||||
|
||||
class SimpleHandler < Mongrel::HttpHandler
|
||||
def process(request, response)
|
||||
response.start(200) do |head,out|
|
||||
head["Content-Type"] = "text/plain"
|
||||
out.write("hello!\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
h = Mongrel::HttpServer.new("0.0.0.0", "3000")
|
||||
h.register("/test", SimpleHandler.new)
|
||||
h.run.join
|
||||
|
||||
If you run this and access port 3000 with a browser it will say
|
||||
"hello!". If you access it with any url other than "/test" it will
|
||||
give a simple 404. Check out the Mongrel::Error404Handler for a
|
||||
basic way to give a more complex 404 message.
|
||||
|
||||
== Speed
|
||||
|
||||
This 0.1.2 release will not be as fast as the 0.1.1 release since I've temporarily
|
||||
removed threads as a test. There were many stability issues related to handling
|
||||
each request in a thread, especially on OSX. I've taken them out for now to
|
||||
make things stable. Even with this removed Mongrel is still pretty fast compared
|
||||
to WEBrick.
|
||||
The 0.2.0 release probably consists of the most effort I've ever put into
|
||||
tuning a Ruby library for speed. It consists of nearly everything I could think
|
||||
of to make Mongrel the fastest Ruby HTTP library possible. I've tried about
|
||||
seven different architectures and IO processing methods and none of them
|
||||
make it any faster. In short: Mongrel is amazingly fast considering Ruby's speed
|
||||
limitations.
|
||||
|
||||
This release also brings in controllable threads that you can scale to meet your
|
||||
needs to do your processing. Simple pass in the HttpServer.new third optional
|
||||
parameter:
|
||||
|
||||
h = Mongrel::HttpServer.new("0.0.0.0", "3000", 40)
|
||||
|
||||
Which will make 40 thread processors. Right now the optimal setting is up in
|
||||
the air, but 20 seemed to be about the sweet spot on my systems. The
|
||||
limited processors also means that you can use ActiveRecord as-is and it will
|
||||
create a matching database connection for each processor thread. More on
|
||||
this in future releases.
|
||||
|
||||
With this release I'm hoping that I've created a nice solid fast as hell core
|
||||
upon which I can build the remaining features I want in Mongrel.
|
||||
|
||||
== The Future
|
||||
|
||||
With the core of Mongrel completed I'm now turning to the next set of features
|
||||
to make Mongrel useful for hosting web applications in a heavily utilized
|
||||
production environment. Right now I'm looking at:
|
||||
|
||||
* Fast static file handling with directory listings.
|
||||
* More testing on more platforms.
|
||||
* An idea I've had for an insane caching handler which could speed up quite a
|
||||
few deployments.
|
||||
* General little things most web servers need.
|
||||
* A nice management system or interface for controlling mongrel servers.
|
||||
|
||||
Overall though the goal of Mongrel is to be just enough HTTP to serve a Ruby
|
||||
web application that sits behind a more complete web server. Everything
|
||||
in the next will focus on actually hosting the major web frameworks for Ruby:
|
||||
|
||||
* Camping -- because it's already done (thanks Why).
|
||||
* Ruby on Rails -- that's where my bread is buttered right now.
|
||||
* Nitro -- George is a nice guy, and Nitro is thread safe. Might be fun.
|
||||
* ????? -- Others people might be interested in.
|
||||
|
||||
== Contact
|
||||
|
||||
|
|
2
Rakefile
2
Rakefile
|
@ -27,4 +27,4 @@ setup_extension("http11", "http11")
|
|||
|
||||
summary = "An experimental fast simple web server for Ruby."
|
||||
test_file = "test/test_ws.rb"
|
||||
setup_gem("mongrel", "0.1.2", "Zed A. Shaw", summary, [], test_file)
|
||||
setup_gem("mongrel", "0.2.0", "Zed A. Shaw", summary, [], test_file)
|
||||
|
|
|
@ -1,130 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Module: Mongrel</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
||||
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
||||
function popupCode( url ) {
|
||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
||||
}
|
||||
|
||||
function toggleCode( id ) {
|
||||
if ( document.getElementById )
|
||||
elem = document.getElementById( id );
|
||||
else if ( document.all )
|
||||
elem = eval( "document.all." + id );
|
||||
else
|
||||
return false;
|
||||
|
||||
elemStyle = elem.style;
|
||||
|
||||
if ( elemStyle.display != "block" ) {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make codeblocks hidden by default
|
||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
||||
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="classHeader">
|
||||
<table class="header-table">
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Module</strong></td>
|
||||
<td class="class-name-in-header">Mongrel</td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>In:</strong></td>
|
||||
<td>
|
||||
<a href="../files/lib/mongrel_rb.html">
|
||||
lib/mongrel.rb
|
||||
</a>
|
||||
<br />
|
||||
<a href="../files/ext/http11/http11_c.html">
|
||||
ext/http11/http11.c
|
||||
</a>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<!-- banner header -->
|
||||
|
||||
<div id="bodyContent">
|
||||
|
||||
|
||||
|
||||
<div id="contextContent">
|
||||
|
||||
<div id="description">
|
||||
<p>
|
||||
<a href="Mongrel.html">Mongrel</a> module containing all of the classes
|
||||
(include C extensions) for running a <a href="Mongrel.html">Mongrel</a> web
|
||||
server. It contains a minimalist HTTP server with just enough functionality
|
||||
to service web application requests fast as possible.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- if includes -->
|
||||
|
||||
<div id="section">
|
||||
|
||||
<div id="class-list">
|
||||
<h3 class="section-bar">Classes and Modules</h3>
|
||||
|
||||
Class <a href="Mongrel/Error404Handler.html" class="link">Mongrel::Error404Handler</a><br />
|
||||
Class <a href="Mongrel/HttpHandler.html" class="link">Mongrel::HttpHandler</a><br />
|
||||
Class <a href="Mongrel/HttpParser.html" class="link">Mongrel::HttpParser</a><br />
|
||||
Class <a href="Mongrel/HttpRequest.html" class="link">Mongrel::HttpRequest</a><br />
|
||||
Class <a href="Mongrel/HttpResponse.html" class="link">Mongrel::HttpResponse</a><br />
|
||||
Class <a href="Mongrel/HttpServer.html" class="link">Mongrel::HttpServer</a><br />
|
||||
Class <a href="Mongrel/URIClassifier.html" class="link">Mongrel::URIClassifier</a><br />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- if method_list -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="validator-badges">
|
||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,171 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Class: Mongrel::Error404Handler</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
||||
function popupCode( url ) {
|
||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
||||
}
|
||||
|
||||
function toggleCode( id ) {
|
||||
if ( document.getElementById )
|
||||
elem = document.getElementById( id );
|
||||
else if ( document.all )
|
||||
elem = eval( "document.all." + id );
|
||||
else
|
||||
return false;
|
||||
|
||||
elemStyle = elem.style;
|
||||
|
||||
if ( elemStyle.display != "block" ) {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make codeblocks hidden by default
|
||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
||||
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="classHeader">
|
||||
<table class="header-table">
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Class</strong></td>
|
||||
<td class="class-name-in-header">Mongrel::Error404Handler</td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>In:</strong></td>
|
||||
<td>
|
||||
<a href="../../files/lib/mongrel_rb.html">
|
||||
lib/mongrel.rb
|
||||
</a>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Parent:</strong></td>
|
||||
<td>
|
||||
<a href="HttpHandler.html">
|
||||
HttpHandler
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- banner header -->
|
||||
|
||||
<div id="bodyContent">
|
||||
|
||||
|
||||
|
||||
<div id="contextContent">
|
||||
|
||||
<div id="description">
|
||||
<p>
|
||||
The server normally returns a 404 response if a URI is requested, but it
|
||||
also returns a lame empty message. This lets you do a 404 response with a
|
||||
custom message for special URIs.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="method-list">
|
||||
<h3 class="section-bar">Methods</h3>
|
||||
|
||||
<div class="name-list">
|
||||
<a href="#M000019">new</a>
|
||||
<a href="#M000020">process</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- if includes -->
|
||||
|
||||
<div id="section">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- if method_list -->
|
||||
<div id="methods">
|
||||
<h3 class="section-bar">Public Class methods</h3>
|
||||
|
||||
<div id="method-M000019" class="method-detail">
|
||||
<a name="M000019"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="Error404Handler.src/M000019.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('Error404Handler.src/M000019.html');return false;">
|
||||
<span class="method-name">new</span><span class="method-args">(msg)</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Sets the message to return. This is constructed once for the handler so
|
||||
it’s pretty efficient.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 class="section-bar">Public Instance methods</h3>
|
||||
|
||||
<div id="method-M000020" class="method-detail">
|
||||
<a name="M000020"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="Error404Handler.src/M000020.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('Error404Handler.src/M000020.html');return false;">
|
||||
<span class="method-name">process</span><span class="method-args">(request, response)</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Just kicks back the standard 404 response with your special message.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="validator-badges">
|
||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>new (Mongrel::Error404Handler)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 75</span>
|
||||
75: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">msg</span>)
|
||||
76: <span class="ruby-ivar">@response</span> = <span class="ruby-constant">HttpServer</span><span class="ruby-operator">::</span><span class="ruby-constant">ERROR_404_RESPONSE</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">msg</span>
|
||||
77: <span class="ruby-keyword kw">end</span></pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>process (Mongrel::Error404Handler)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 80</span>
|
||||
80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
|
||||
81: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-ivar">@response</span>)
|
||||
82: <span class="ruby-keyword kw">end</span></pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,159 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Class: Mongrel::HttpHandler</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
||||
function popupCode( url ) {
|
||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
||||
}
|
||||
|
||||
function toggleCode( id ) {
|
||||
if ( document.getElementById )
|
||||
elem = document.getElementById( id );
|
||||
else if ( document.all )
|
||||
elem = eval( "document.all." + id );
|
||||
else
|
||||
return false;
|
||||
|
||||
elemStyle = elem.style;
|
||||
|
||||
if ( elemStyle.display != "block" ) {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make codeblocks hidden by default
|
||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
||||
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="classHeader">
|
||||
<table class="header-table">
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Class</strong></td>
|
||||
<td class="class-name-in-header">Mongrel::HttpHandler</td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>In:</strong></td>
|
||||
<td>
|
||||
<a href="../../files/lib/mongrel_rb.html">
|
||||
lib/mongrel.rb
|
||||
</a>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Parent:</strong></td>
|
||||
<td>
|
||||
Object
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- banner header -->
|
||||
|
||||
<div id="bodyContent">
|
||||
|
||||
|
||||
|
||||
<div id="contextContent">
|
||||
|
||||
<div id="description">
|
||||
<p>
|
||||
You implement your application handler with this. It’s very light
|
||||
giving just the minimum necessary for you to handle a request and shoot
|
||||
back a response. Look at the <a href="HttpRequest.html">HttpRequest</a> and
|
||||
<a href="HttpResponse.html">HttpResponse</a> objects for how to use them.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="method-list">
|
||||
<h3 class="section-bar">Methods</h3>
|
||||
|
||||
<div class="name-list">
|
||||
<a href="#M000017">process</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- if includes -->
|
||||
|
||||
<div id="section">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="attribute-list">
|
||||
<h3 class="section-bar">Attributes</h3>
|
||||
|
||||
<div class="name-list">
|
||||
<table>
|
||||
<tr class="top-aligned-row context-row">
|
||||
<td class="context-item-name">script_name</td>
|
||||
<td class="context-item-value"> [RW] </td>
|
||||
<td class="context-item-desc"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- if method_list -->
|
||||
<div id="methods">
|
||||
<h3 class="section-bar">Public Instance methods</h3>
|
||||
|
||||
<div id="method-M000017" class="method-detail">
|
||||
<a name="M000017"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpHandler.src/M000017.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpHandler.src/M000017.html');return false;">
|
||||
<span class="method-name">process</span><span class="method-args">(request, response)</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="validator-badges">
|
||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>process (Mongrel::HttpHandler)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 64</span>
|
||||
64: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
|
||||
65: <span class="ruby-keyword kw">end</span></pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,265 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Class: Mongrel::HttpParser</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
||||
function popupCode( url ) {
|
||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
||||
}
|
||||
|
||||
function toggleCode( id ) {
|
||||
if ( document.getElementById )
|
||||
elem = document.getElementById( id );
|
||||
else if ( document.all )
|
||||
elem = eval( "document.all." + id );
|
||||
else
|
||||
return false;
|
||||
|
||||
elemStyle = elem.style;
|
||||
|
||||
if ( elemStyle.display != "block" ) {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make codeblocks hidden by default
|
||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
||||
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="classHeader">
|
||||
<table class="header-table">
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Class</strong></td>
|
||||
<td class="class-name-in-header">Mongrel::HttpParser</td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>In:</strong></td>
|
||||
<td>
|
||||
<a href="../../files/ext/http11/http11_c.html">
|
||||
ext/http11/http11.c
|
||||
</a>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Parent:</strong></td>
|
||||
<td>
|
||||
Object
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- banner header -->
|
||||
|
||||
<div id="bodyContent">
|
||||
|
||||
|
||||
|
||||
<div id="contextContent">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="method-list">
|
||||
<h3 class="section-bar">Methods</h3>
|
||||
|
||||
<div class="name-list">
|
||||
<a href="#M000005">error?</a>
|
||||
<a href="#M000004">execute</a>
|
||||
<a href="#M000003">finish</a>
|
||||
<a href="#M000006">finished?</a>
|
||||
<a href="#M000001">new</a>
|
||||
<a href="#M000007">nread</a>
|
||||
<a href="#M000002">reset</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- if includes -->
|
||||
|
||||
<div id="section">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- if method_list -->
|
||||
<div id="methods">
|
||||
<h3 class="section-bar">Public Class methods</h3>
|
||||
|
||||
<div id="method-M000001" class="method-detail">
|
||||
<a name="M000001"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpParser.src/M000001.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpParser.src/M000001.html');return false;">
|
||||
<span class="method-name">parser.new → parser<br />
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Creates a new parser.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 class="section-bar">Public Instance methods</h3>
|
||||
|
||||
<div id="method-M000005" class="method-detail">
|
||||
<a name="M000005"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpParser.src/M000005.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpParser.src/M000005.html');return false;">
|
||||
<span class="method-name">parser.error? → true/false<br />
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Tells you whether the parser is in an error state.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="method-M000004" class="method-detail">
|
||||
<a name="M000004"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpParser.src/M000004.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpParser.src/M000004.html');return false;">
|
||||
<span class="method-name">parser.execute(req_hash, data) → Integer<br />
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Takes a Hash and a String of data, parses the String of data filling in the
|
||||
Hash returning an Integer to indicate how much of the data has been read.
|
||||
No matter what the return value, you should call HttpParser#finished? and
|
||||
HttpParser#error? to figure out if it’s done parsing or there was an
|
||||
error.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="method-M000003" class="method-detail">
|
||||
<a name="M000003"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpParser.src/M000003.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpParser.src/M000003.html');return false;">
|
||||
<span class="method-name">parser.finish → true/false<br />
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Finishes a parser early which could put in a "good" or bad state.
|
||||
You should call reset after finish it or bad things will happen.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="method-M000006" class="method-detail">
|
||||
<a name="M000006"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpParser.src/M000006.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpParser.src/M000006.html');return false;">
|
||||
<span class="method-name">parser.finished? → true/false<br />
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Tells you whether the parser is finished or not and in a good state.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="method-M000007" class="method-detail">
|
||||
<a name="M000007"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpParser.src/M000007.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpParser.src/M000007.html');return false;">
|
||||
<span class="method-name">parser.nread → Integer<br />
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Returns the amount of data processed so far during this processing cycle.
|
||||
It is set to 0 on initialize or reset calls and is incremented each time
|
||||
execute is called.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="method-M000002" class="method-detail">
|
||||
<a name="M000002"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpParser.src/M000002.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpParser.src/M000002.html');return false;">
|
||||
<span class="method-name">parser.reset → nil<br />
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Resets the parser to it’s initial state so that you can reuse it
|
||||
rather than making new ones.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="validator-badges">
|
||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>new (Mongrel::HttpParser)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre>/**
|
||||
* call-seq:
|
||||
* parser.new -> parser
|
||||
*
|
||||
* Creates a new parser.
|
||||
*/
|
||||
VALUE HttpParser_init(VALUE self)
|
||||
{
|
||||
http_parser *http = NULL;
|
||||
DATA_GET(self, http_parser, http);
|
||||
http_parser_init(http);
|
||||
|
||||
return self;
|
||||
}</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,29 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>reset (Mongrel::HttpParser)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre>/**
|
||||
* call-seq:
|
||||
* parser.reset -> nil
|
||||
*
|
||||
* Resets the parser to it's initial state so that you can reuse it
|
||||
* rather than making new ones.
|
||||
*/
|
||||
VALUE HttpParser_reset(VALUE self)
|
||||
{
|
||||
http_parser *http = NULL;
|
||||
DATA_GET(self, http_parser, http);
|
||||
http_parser_init(http);
|
||||
|
||||
return Qnil;
|
||||
}</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,29 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>finish (Mongrel::HttpParser)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre>/**
|
||||
* call-seq:
|
||||
* parser.finish -> true/false
|
||||
*
|
||||
* Finishes a parser early which could put in a "good" or bad state.
|
||||
* You should call reset after finish it or bad things will happen.
|
||||
*/
|
||||
VALUE HttpParser_finish(VALUE self)
|
||||
{
|
||||
http_parser *http = NULL;
|
||||
DATA_GET(self, http_parser, http);
|
||||
http_parser_finish(http);
|
||||
|
||||
return http_parser_is_finished(http) ? Qtrue : Qfalse;
|
||||
}</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,33 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>execute (Mongrel::HttpParser)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre>/**
|
||||
* call-seq:
|
||||
* parser.execute(req_hash, data) -> Integer
|
||||
*
|
||||
* Takes a Hash and a String of data, parses the String of data filling in the Hash
|
||||
* returning an Integer to indicate how much of the data has been read. No matter
|
||||
* what the return value, you should call HttpParser#finished? and HttpParser#error?
|
||||
* to figure out if it's done parsing or there was an error.
|
||||
*/
|
||||
VALUE HttpParser_execute(VALUE self, VALUE req_hash, VALUE data)
|
||||
{
|
||||
http_parser *http = NULL;
|
||||
DATA_GET(self, http_parser, http);
|
||||
|
||||
http->data = (void *)req_hash;
|
||||
http_parser_execute(http, RSTRING(data)->ptr, RSTRING(data)->len);
|
||||
|
||||
return INT2FIX(http_parser_nread(http));
|
||||
}</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>error? (Mongrel::HttpParser)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre>/**
|
||||
* call-seq:
|
||||
* parser.error? -> true/false
|
||||
*
|
||||
* Tells you whether the parser is in an error state.
|
||||
*/
|
||||
VALUE HttpParser_has_error(VALUE self)
|
||||
{
|
||||
http_parser *http = NULL;
|
||||
DATA_GET(self, http_parser, http);
|
||||
|
||||
return http_parser_has_error(http) ? Qtrue : Qfalse;
|
||||
}</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>finished? (Mongrel::HttpParser)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre>/**
|
||||
* call-seq:
|
||||
* parser.finished? -> true/false
|
||||
*
|
||||
* Tells you whether the parser is finished or not and in a good state.
|
||||
*/
|
||||
VALUE HttpParser_is_finished(VALUE self)
|
||||
{
|
||||
http_parser *http = NULL;
|
||||
DATA_GET(self, http_parser, http);
|
||||
|
||||
return http_parser_is_finished(http) ? Qtrue : Qfalse;
|
||||
}</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>nread (Mongrel::HttpParser)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre>/**
|
||||
* call-seq:
|
||||
* parser.nread -> Integer
|
||||
*
|
||||
* Returns the amount of data processed so far during this processing cycle. It is
|
||||
* set to 0 on initialize or reset calls and is incremented each time execute is called.
|
||||
*/
|
||||
VALUE HttpParser_nread(VALUE self)
|
||||
{
|
||||
http_parser *http = NULL;
|
||||
DATA_GET(self, http_parser, http);
|
||||
|
||||
return INT2FIX(http->nread);
|
||||
}</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,177 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Class: Mongrel::HttpRequest</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
||||
function popupCode( url ) {
|
||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
||||
}
|
||||
|
||||
function toggleCode( id ) {
|
||||
if ( document.getElementById )
|
||||
elem = document.getElementById( id );
|
||||
else if ( document.all )
|
||||
elem = eval( "document.all." + id );
|
||||
else
|
||||
return false;
|
||||
|
||||
elemStyle = elem.style;
|
||||
|
||||
if ( elemStyle.display != "block" ) {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make codeblocks hidden by default
|
||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
||||
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="classHeader">
|
||||
<table class="header-table">
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Class</strong></td>
|
||||
<td class="class-name-in-header">Mongrel::HttpRequest</td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>In:</strong></td>
|
||||
<td>
|
||||
<a href="../../files/lib/mongrel_rb.html">
|
||||
lib/mongrel.rb
|
||||
</a>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Parent:</strong></td>
|
||||
<td>
|
||||
Object
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- banner header -->
|
||||
|
||||
<div id="bodyContent">
|
||||
|
||||
|
||||
|
||||
<div id="contextContent">
|
||||
|
||||
<div id="description">
|
||||
<p>
|
||||
When a handler is found for a registered URI then this class is constructed
|
||||
and passed to your HttpHandler::process method. You should assume that
|
||||
<b>one</b> handler processes all requests. Included in the HttpReqeust is a
|
||||
HttpRequest.params Hash that matches common CGI params, and a
|
||||
HttpRequest.body which is a string containing the request body (raw for
|
||||
now).
|
||||
</p>
|
||||
<p>
|
||||
<a href="../Mongrel.html">Mongrel</a> really only support small-ish request
|
||||
bodies right now since really huge ones have to be completely read off the
|
||||
wire and put into a string. Later there will be several options for
|
||||
efficiently handling large file uploads.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="method-list">
|
||||
<h3 class="section-bar">Methods</h3>
|
||||
|
||||
<div class="name-list">
|
||||
<a href="#M000021">new</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- if includes -->
|
||||
|
||||
<div id="section">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="attribute-list">
|
||||
<h3 class="section-bar">Attributes</h3>
|
||||
|
||||
<div class="name-list">
|
||||
<table>
|
||||
<tr class="top-aligned-row context-row">
|
||||
<td class="context-item-name">body</td>
|
||||
<td class="context-item-value"> [R] </td>
|
||||
<td class="context-item-desc"></td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row context-row">
|
||||
<td class="context-item-name">params</td>
|
||||
<td class="context-item-value"> [R] </td>
|
||||
<td class="context-item-desc"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- if method_list -->
|
||||
<div id="methods">
|
||||
<h3 class="section-bar">Public Class methods</h3>
|
||||
|
||||
<div id="method-M000021" class="method-detail">
|
||||
<a name="M000021"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpRequest.src/M000021.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpRequest.src/M000021.html');return false;">
|
||||
<span class="method-name">new</span><span class="method-args">(params, initial_body, socket)</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
You don’t really call this. It’s made for you. Main thing it
|
||||
does is hook up the params, and store any remaining body data into the
|
||||
HttpRequest.body attribute.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="validator-badges">
|
||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,30 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>new (Mongrel::HttpRequest)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 27</span>
|
||||
27: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">initial_body</span>, <span class="ruby-identifier">socket</span>)
|
||||
28: <span class="ruby-ivar">@body</span> = <span class="ruby-identifier">initial_body</span> <span class="ruby-operator">||</span> <span class="ruby-value str">""</span>
|
||||
29: <span class="ruby-ivar">@params</span> = <span class="ruby-identifier">params</span>
|
||||
30: <span class="ruby-ivar">@socket</span> = <span class="ruby-identifier">socket</span>
|
||||
31:
|
||||
32: <span class="ruby-comment cmt"># fix up the CGI requirements</span>
|
||||
33: <span class="ruby-identifier">params</span>[<span class="ruby-value str">'CONTENT_LENGTH'</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-value str">'HTTP_CONTENT_LENGTH'</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
|
||||
34:
|
||||
35: <span class="ruby-comment cmt"># now, if the initial_body isn't long enough for the content length we have to fill it</span>
|
||||
36: <span class="ruby-comment cmt"># TODO: adapt for big ass stuff by writing to a temp file</span>
|
||||
37: <span class="ruby-identifier">clen</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value str">'HTTP_CONTENT_LENGTH'</span>].<span class="ruby-identifier">to_i</span>
|
||||
38: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">clen</span>
|
||||
39: <span class="ruby-ivar">@body</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">clen</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">length</span>)
|
||||
40: <span class="ruby-keyword kw">end</span>
|
||||
41: <span class="ruby-keyword kw">end</span></pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,159 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Class: Mongrel::HttpResponse</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
||||
function popupCode( url ) {
|
||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
||||
}
|
||||
|
||||
function toggleCode( id ) {
|
||||
if ( document.getElementById )
|
||||
elem = document.getElementById( id );
|
||||
else if ( document.all )
|
||||
elem = eval( "document.all." + id );
|
||||
else
|
||||
return false;
|
||||
|
||||
elemStyle = elem.style;
|
||||
|
||||
if ( elemStyle.display != "block" ) {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make codeblocks hidden by default
|
||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
||||
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="classHeader">
|
||||
<table class="header-table">
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Class</strong></td>
|
||||
<td class="class-name-in-header">Mongrel::HttpResponse</td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>In:</strong></td>
|
||||
<td>
|
||||
<a href="../../files/lib/mongrel_rb.html">
|
||||
lib/mongrel.rb
|
||||
</a>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Parent:</strong></td>
|
||||
<td>
|
||||
Object
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- banner header -->
|
||||
|
||||
<div id="bodyContent">
|
||||
|
||||
|
||||
|
||||
<div id="contextContent">
|
||||
|
||||
<div id="description">
|
||||
<p>
|
||||
Very very simple response object. You basically write your stuff raw to the
|
||||
HttpResponse.socket variable. This will be made <b>much</b> easier in
|
||||
future releases allowing you to set status and request headers prior to
|
||||
sending the response.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="method-list">
|
||||
<h3 class="section-bar">Methods</h3>
|
||||
|
||||
<div class="name-list">
|
||||
<a href="#M000018">new</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- if includes -->
|
||||
|
||||
<div id="section">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="attribute-list">
|
||||
<h3 class="section-bar">Attributes</h3>
|
||||
|
||||
<div class="name-list">
|
||||
<table>
|
||||
<tr class="top-aligned-row context-row">
|
||||
<td class="context-item-name">socket</td>
|
||||
<td class="context-item-value"> [R] </td>
|
||||
<td class="context-item-desc"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- if method_list -->
|
||||
<div id="methods">
|
||||
<h3 class="section-bar">Public Class methods</h3>
|
||||
|
||||
<div id="method-M000018" class="method-detail">
|
||||
<a name="M000018"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpResponse.src/M000018.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpResponse.src/M000018.html');return false;">
|
||||
<span class="method-name">new</span><span class="method-args">(socket)</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="validator-badges">
|
||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>new (Mongrel::HttpResponse)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 51</span>
|
||||
51: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">socket</span>)
|
||||
52: <span class="ruby-ivar">@socket</span> = <span class="ruby-identifier">socket</span>
|
||||
53: <span class="ruby-keyword kw">end</span></pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,300 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Class: Mongrel::HttpServer</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
||||
function popupCode( url ) {
|
||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
||||
}
|
||||
|
||||
function toggleCode( id ) {
|
||||
if ( document.getElementById )
|
||||
elem = document.getElementById( id );
|
||||
else if ( document.all )
|
||||
elem = eval( "document.all." + id );
|
||||
else
|
||||
return false;
|
||||
|
||||
elemStyle = elem.style;
|
||||
|
||||
if ( elemStyle.display != "block" ) {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make codeblocks hidden by default
|
||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
||||
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="classHeader">
|
||||
<table class="header-table">
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Class</strong></td>
|
||||
<td class="class-name-in-header">Mongrel::HttpServer</td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>In:</strong></td>
|
||||
<td>
|
||||
<a href="../../files/lib/mongrel_rb.html">
|
||||
lib/mongrel.rb
|
||||
</a>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Parent:</strong></td>
|
||||
<td>
|
||||
Object
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- banner header -->
|
||||
|
||||
<div id="bodyContent">
|
||||
|
||||
|
||||
|
||||
<div id="contextContent">
|
||||
|
||||
<div id="description">
|
||||
<p>
|
||||
This is the main driver of <a href="../Mongrel.html">Mongrel</a>, while the
|
||||
Mognrel::HttpParser and <a
|
||||
href="URIClassifier.html">Mongrel::URIClassifier</a> make up the majority
|
||||
of how the server functions. It’s a very simple class that just has a
|
||||
thread accepting connections and a simple <a
|
||||
href="HttpServer.html#M000009">HttpServer.process_client</a> function to do
|
||||
the heavy lifting with the IO and Ruby.
|
||||
</p>
|
||||
<p>
|
||||
*NOTE:* The <a href="HttpServer.html#M000009">process_client</a> function
|
||||
used threads at one time but that proved to have stability issues on Mac
|
||||
OSX. Actually, Ruby in general has stability issues on Mac OSX.
|
||||
</p>
|
||||
<p>
|
||||
You use it by doing the following:
|
||||
</p>
|
||||
<pre>
|
||||
server = HttpServer.new("0.0.0.0", 3000)
|
||||
server.register("/stuff", MyNifterHandler.new)
|
||||
server.run.join
|
||||
</pre>
|
||||
<p>
|
||||
The last line can be just server.run if you don’t want to join the
|
||||
thread used. If you don’t though Ruby will mysteriously just exit on
|
||||
you.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="method-list">
|
||||
<h3 class="section-bar">Methods</h3>
|
||||
|
||||
<div class="name-list">
|
||||
<a href="#M000008">new</a>
|
||||
<a href="#M000009">process_client</a>
|
||||
<a href="#M000011">register</a>
|
||||
<a href="#M000010">run</a>
|
||||
<a href="#M000012">unregister</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- if includes -->
|
||||
|
||||
<div id="section">
|
||||
|
||||
|
||||
<div id="constants-list">
|
||||
<h3 class="section-bar">Constants</h3>
|
||||
|
||||
<div class="name-list">
|
||||
<table summary="Constants">
|
||||
<tr class="top-aligned-row context-row">
|
||||
<td class="context-item-name">ERROR_404_RESPONSE</td>
|
||||
<td>=</td>
|
||||
<td class="context-item-value">"HTTP/1.1 404 Not Found\r\nConnection: close\r\nContent-Type: text/plain\r\nServer: Mongrel/0.1\r\n\r\n"</td>
|
||||
<td width="3em"> </td>
|
||||
<td class="context-item-desc">
|
||||
The standard empty 404 response for bad requests. Use Error4040Handler for
|
||||
custom stuff.
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row context-row">
|
||||
<td class="context-item-name">CHUNK_SIZE</td>
|
||||
<td>=</td>
|
||||
<td class="context-item-value">2048</td>
|
||||
<td width="3em"> </td>
|
||||
<td class="context-item-desc">
|
||||
For now we just read 2k chunks. Not optimal at all.
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="attribute-list">
|
||||
<h3 class="section-bar">Attributes</h3>
|
||||
|
||||
<div class="name-list">
|
||||
<table>
|
||||
<tr class="top-aligned-row context-row">
|
||||
<td class="context-item-name">acceptor</td>
|
||||
<td class="context-item-value"> [R] </td>
|
||||
<td class="context-item-desc"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- if method_list -->
|
||||
<div id="methods">
|
||||
<h3 class="section-bar">Public Class methods</h3>
|
||||
|
||||
<div id="method-M000008" class="method-detail">
|
||||
<a name="M000008"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpServer.src/M000008.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpServer.src/M000008.html');return false;">
|
||||
<span class="method-name">new</span><span class="method-args">(host, port)</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Creates a working server on host:port (strange things happen if port
|
||||
isn’t a Number). Use HttpServer::run to start the server.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 class="section-bar">Public Instance methods</h3>
|
||||
|
||||
<div id="method-M000009" class="method-detail">
|
||||
<a name="M000009"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpServer.src/M000009.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpServer.src/M000009.html');return false;">
|
||||
<span class="method-name">process_client</span><span class="method-args">(client)</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Used internally to process an accepted client. It uses <a
|
||||
href="HttpParser.html">HttpParser</a> and <a
|
||||
href="URIClassifier.html">URIClassifier</a> (in ext/http11/http11.c) to do
|
||||
the heavy work, and mostly just does a hack job at some simple IO. Future
|
||||
releases will target this area mostly.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="method-M000011" class="method-detail">
|
||||
<a name="M000011"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpServer.src/M000011.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpServer.src/M000011.html');return false;">
|
||||
<span class="method-name">register</span><span class="method-args">(uri, handler)</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Simply registers a handler with the internal <a
|
||||
href="URIClassifier.html">URIClassifier</a>. When the URI is found in the
|
||||
prefix of a request then your handler’s HttpHandler::process method
|
||||
is called. See <a
|
||||
href="URIClassifier.html#M000014">Mongrel::URIClassifier#register</a> for
|
||||
more information.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="method-M000010" class="method-detail">
|
||||
<a name="M000010"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpServer.src/M000010.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpServer.src/M000010.html');return false;">
|
||||
<span class="method-name">run</span><span class="method-args">()</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Runs the thing. It returns the thread used so you can "join" it.
|
||||
You can also access the HttpServer::acceptor attribute to get the thread
|
||||
later.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="method-M000012" class="method-detail">
|
||||
<a name="M000012"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="HttpServer.src/M000012.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('HttpServer.src/M000012.html');return false;">
|
||||
<span class="method-name">unregister</span><span class="method-args">(uri)</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Removes any handler registered at the given URI. See <a
|
||||
href="URIClassifier.html#M000015">Mongrel::URIClassifier#unregister</a> for
|
||||
more information.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="validator-badges">
|
||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>new (Mongrel::HttpServer)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 114</span>
|
||||
114: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>)
|
||||
115: <span class="ruby-ivar">@socket</span> = <span class="ruby-constant">TCPServer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>)
|
||||
116: <span class="ruby-ivar">@classifier</span> = <span class="ruby-constant">URIClassifier</span>.<span class="ruby-identifier">new</span>
|
||||
117: <span class="ruby-keyword kw">end</span></pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,59 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>process_client (Mongrel::HttpServer)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 122</span>
|
||||
122: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_client</span>(<span class="ruby-identifier">client</span>)
|
||||
123: <span class="ruby-keyword kw">begin</span>
|
||||
124: <span class="ruby-identifier">parser</span> = <span class="ruby-constant">HttpParser</span>.<span class="ruby-identifier">new</span>
|
||||
125: <span class="ruby-identifier">params</span> = {}
|
||||
126: <span class="ruby-identifier">data</span> = <span class="ruby-value str">""</span>
|
||||
127:
|
||||
128: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
|
||||
129: <span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-constant">CHUNK_SIZE</span>)
|
||||
130:
|
||||
131: <span class="ruby-identifier">nread</span> = <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">execute</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">data</span>)
|
||||
132:
|
||||
133: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">error?</span>
|
||||
134: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"parser error:"</span>
|
||||
135: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">data</span>
|
||||
136: <span class="ruby-keyword kw">break</span>
|
||||
137: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">finished?</span>
|
||||
138: <span class="ruby-identifier">script_name</span>, <span class="ruby-identifier">path_info</span>, <span class="ruby-identifier">handler</span> = <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">resolve</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value str">"PATH_INFO"</span>])
|
||||
139:
|
||||
140: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">handler</span>
|
||||
141: <span class="ruby-identifier">params</span>[<span class="ruby-value str">'PATH_INFO'</span>] = <span class="ruby-identifier">path_info</span>
|
||||
142: <span class="ruby-identifier">params</span>[<span class="ruby-value str">'SCRIPT_NAME'</span>] = <span class="ruby-identifier">script_name</span>
|
||||
143:
|
||||
144: <span class="ruby-identifier">request</span> = <span class="ruby-constant">HttpRequest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">data</span>[<span class="ruby-identifier">nread</span> <span class="ruby-operator">...</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span>], <span class="ruby-identifier">client</span>)
|
||||
145: <span class="ruby-identifier">response</span> = <span class="ruby-constant">HttpResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">client</span>)
|
||||
146:
|
||||
147: <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
|
||||
148: <span class="ruby-keyword kw">else</span>
|
||||
149: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">ERROR_404_RESPONSE</span>)
|
||||
150: <span class="ruby-keyword kw">end</span>
|
||||
151:
|
||||
152: <span class="ruby-keyword kw">break</span>
|
||||
153: <span class="ruby-keyword kw">else</span>
|
||||
154: <span class="ruby-comment cmt"># gotta stream and read again until we can get the parser to be character safe</span>
|
||||
155: <span class="ruby-comment cmt"># TODO: make this more efficient since this means we're parsing a lot repeatedly</span>
|
||||
156: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">reset</span>
|
||||
157: <span class="ruby-keyword kw">end</span>
|
||||
158: <span class="ruby-keyword kw">end</span>
|
||||
159: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">details</span>
|
||||
160: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"ERROR: #{details}"</span>
|
||||
161: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">details</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">"\n"</span>)
|
||||
162: <span class="ruby-keyword kw">ensure</span>
|
||||
163: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span>
|
||||
164: <span class="ruby-keyword kw">end</span>
|
||||
165: <span class="ruby-keyword kw">end</span></pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>run (Mongrel::HttpServer)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 169</span>
|
||||
169: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
|
||||
170: <span class="ruby-ivar">@acceptor</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
|
||||
171: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
|
||||
172: <span class="ruby-identifier">process_client</span>(<span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">accept</span>)
|
||||
173: <span class="ruby-keyword kw">end</span>
|
||||
174: <span class="ruby-keyword kw">end</span>
|
||||
175: <span class="ruby-keyword kw">end</span></pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>register (Mongrel::HttpServer)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 181</span>
|
||||
181: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">handler</span>)
|
||||
182: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">handler</span>)
|
||||
183: <span class="ruby-keyword kw">end</span></pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>unregister (Mongrel::HttpServer)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 187</span>
|
||||
187: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unregister</span>(<span class="ruby-identifier">uri</span>)
|
||||
188: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">unregister</span>(<span class="ruby-identifier">uri</span>)
|
||||
189: <span class="ruby-keyword kw">end</span></pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,257 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Class: Mongrel::URIClassifier</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
||||
function popupCode( url ) {
|
||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
||||
}
|
||||
|
||||
function toggleCode( id ) {
|
||||
if ( document.getElementById )
|
||||
elem = document.getElementById( id );
|
||||
else if ( document.all )
|
||||
elem = eval( "document.all." + id );
|
||||
else
|
||||
return false;
|
||||
|
||||
elemStyle = elem.style;
|
||||
|
||||
if ( elemStyle.display != "block" ) {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make codeblocks hidden by default
|
||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
||||
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="classHeader">
|
||||
<table class="header-table">
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Class</strong></td>
|
||||
<td class="class-name-in-header">Mongrel::URIClassifier</td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>In:</strong></td>
|
||||
<td>
|
||||
<a href="../../files/ext/http11/http11_c.html">
|
||||
ext/http11/http11.c
|
||||
</a>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Parent:</strong></td>
|
||||
<td>
|
||||
Object
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- banner header -->
|
||||
|
||||
<div id="bodyContent">
|
||||
|
||||
|
||||
|
||||
<div id="contextContent">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="method-list">
|
||||
<h3 class="section-bar">Methods</h3>
|
||||
|
||||
<div class="name-list">
|
||||
<a href="#M000013">new</a>
|
||||
<a href="#M000014">register</a>
|
||||
<a href="#M000016">resolve</a>
|
||||
<a href="#M000015">unregister</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- if includes -->
|
||||
|
||||
<div id="section">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- if method_list -->
|
||||
<div id="methods">
|
||||
<h3 class="section-bar">Public Class methods</h3>
|
||||
|
||||
<div id="method-M000013" class="method-detail">
|
||||
<a name="M000013"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="URIClassifier.src/M000013.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('URIClassifier.src/M000013.html');return false;">
|
||||
<span class="method-name">URIClassifier.new → URIClassifier<br />
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Initializes a new <a href="URIClassifier.html">URIClassifier</a> object
|
||||
that you can use to associate URI sequences with objects. You can actually
|
||||
use it with any string sequence and any objects, but it’s mostly used
|
||||
with URIs.
|
||||
</p>
|
||||
<p>
|
||||
It uses TST from <a
|
||||
href="http://www.octavian.org/cs/software.html">www.octavian.org/cs/software.html</a>
|
||||
to build an ternary search trie to hold all of the URIs. It uses this to do
|
||||
an initial search for the a URI prefix, and then to break the URI into
|
||||
SCRIPT_NAME and PATH_INFO portions. It actually will do two searches most
|
||||
of the time in order to find the right handler for the registered prefix
|
||||
portion.
|
||||
</p>
|
||||
<p>
|
||||
Here’s how it all works. Let’s say you register
|
||||
"/blog" with a BlogHandler. Great. Now, someone goes to
|
||||
"/blog/zedsucks/ass". You want SCRIPT_NAME to be
|
||||
"/blog" and PATH_INFO to be "/zedsucks/ass". <a
|
||||
href="URIClassifier.html">URIClassifier</a> first does a TST search and
|
||||
comes up with a failure, but knows that the failure ended at the
|
||||
"/blog" part. So, that’s the SCRIPT_NAME. It then tries a
|
||||
second search for just "/blog". If that comes back good then it
|
||||
sets the rest ("/zedsucks/ass") to the PATH_INFO and returns the
|
||||
BlogHandler.
|
||||
</p>
|
||||
<p>
|
||||
The optimal approach would be to not do the search twice, but the TST lib
|
||||
doesn’t really support returning prefixes. Might not be hard to add
|
||||
later.
|
||||
</p>
|
||||
<p>
|
||||
The key though is that it will try to match the <b>longest</b> match it
|
||||
can. If you also register "/blog/zed" then the above URI will
|
||||
give SCRIPT_NAME="/blog/zed", PATH_INFO="sucks/ass".
|
||||
Probably not what you want, so your handler will need to do the 404 thing.
|
||||
</p>
|
||||
<p>
|
||||
Take a look at the postamble of example/tepee.rb to see how this is handled
|
||||
for Camping.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 class="section-bar">Public Instance methods</h3>
|
||||
|
||||
<div id="method-M000014" class="method-detail">
|
||||
<a name="M000014"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="URIClassifier.src/M000014.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('URIClassifier.src/M000014.html');return false;">
|
||||
<span class="method-name">uc.register("/someuri", SampleHandler.new) → nil<br />
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Registers the SampleHandler (one for all requests) with the
|
||||
"/someuri". When URIClassifier::resolve is called with
|
||||
"/someuri" it’ll return SampleHandler immediately. When
|
||||
"/someuri/pathhere" is called it’ll find SomeHandler after
|
||||
a second search, and setup PATH_INFO="/pathhere".
|
||||
</p>
|
||||
<p>
|
||||
You actually can reuse this class to register nearly anything and quickly
|
||||
resolve it. This could be used for caching, fast mapping, etc. The downside
|
||||
is it uses much more memory than a Hash, but it can be a lot faster.
|
||||
It’s main advantage is that it works on prefixes, which is damn hard
|
||||
to get right with a Hash.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="method-M000016" class="method-detail">
|
||||
<a name="M000016"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="URIClassifier.src/M000016.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('URIClassifier.src/M000016.html');return false;">
|
||||
<span class="method-name">uc.resolve("/someuri") → "/someuri", "", handler<br />
|
||||
uc.resolve("/someuri/pathinfo") → "/someuri", "/pathinfo", handler<br />
|
||||
uc.resolve("/notfound/orhere") → nil, nil, nil<br />
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Attempts to resolve either the whole URI or at the longest prefix,
|
||||
returning the prefix (as script_info), path (as path_info), and registered
|
||||
handler (usually an <a href="HttpHandler.html">HttpHandler</a>).
|
||||
</p>
|
||||
<p>
|
||||
It expects strings. Don‘t try other string-line stuff yet.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="method-M000015" class="method-detail">
|
||||
<a name="M000015"></a>
|
||||
|
||||
<div class="method-heading">
|
||||
<a href="URIClassifier.src/M000015.html" target="Code" class="method-signature"
|
||||
onclick="popupCode('URIClassifier.src/M000015.html');return false;">
|
||||
<span class="method-name">uc.unregister("/someuri")<br />
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="method-description">
|
||||
<p>
|
||||
Yep, just removes this uri and it’s handler from the trie.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="validator-badges">
|
||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,54 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>new (Mongrel::URIClassifier)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre>/**
|
||||
* call-seq:
|
||||
* URIClassifier.new -> URIClassifier
|
||||
*
|
||||
* Initializes a new URIClassifier object that you can use to associate URI sequences
|
||||
* with objects. You can actually use it with any string sequence and any objects,
|
||||
* but it's mostly used with URIs.
|
||||
*
|
||||
* It uses TST from http://www.octavian.org/cs/software.html to build an ternary search
|
||||
* trie to hold all of the URIs. It uses this to do an initial search for the a URI
|
||||
* prefix, and then to break the URI into SCRIPT_NAME and PATH_INFO portions. It actually
|
||||
* will do two searches most of the time in order to find the right handler for the
|
||||
* registered prefix portion.
|
||||
*
|
||||
* Here's how it all works. Let's say you register "/blog" with a BlogHandler. Great.
|
||||
* Now, someone goes to "/blog/zedsucks/ass". You want SCRIPT_NAME to be "/blog" and
|
||||
* PATH_INFO to be "/zedsucks/ass". URIClassifier first does a TST search and comes
|
||||
* up with a failure, but knows that the failure ended at the "/blog" part. So, that's
|
||||
* the SCRIPT_NAME. It then tries a second search for just "/blog". If that comes back
|
||||
* good then it sets the rest ("/zedsucks/ass") to the PATH_INFO and returns the BlogHandler.
|
||||
*
|
||||
* The optimal approach would be to not do the search twice, but the TST lib doesn't
|
||||
* really support returning prefixes. Might not be hard to add later.
|
||||
*
|
||||
* The key though is that it will try to match the *longest* match it can. If you
|
||||
* also register "/blog/zed" then the above URI will give SCRIPT_NAME="/blog/zed",
|
||||
* PATH_INFO="sucks/ass". Probably not what you want, so your handler will need to
|
||||
* do the 404 thing.
|
||||
*
|
||||
* Take a look at the postamble of example/tepee.rb to see how this is handled for
|
||||
* Camping.
|
||||
*/
|
||||
VALUE URIClassifier_init(VALUE self)
|
||||
{
|
||||
VALUE hash;
|
||||
|
||||
// we create an internal hash to protect stuff from the GC
|
||||
hash = rb_hash_new();
|
||||
rb_iv_set(self, "handler_map", hash);
|
||||
}</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,50 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>register (Mongrel::URIClassifier)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre>/**
|
||||
* call-seq:
|
||||
* uc.register("/someuri", SampleHandler.new) -> nil
|
||||
*
|
||||
* Registers the SampleHandler (one for all requests) with the "/someuri".
|
||||
* When URIClassifier::resolve is called with "/someuri" it'll return
|
||||
* SampleHandler immediately. When "/someuri/pathhere" is called it'll
|
||||
* find SomeHandler after a second search, and setup PATH_INFO="/pathhere".
|
||||
*
|
||||
* You actually can reuse this class to register nearly anything and
|
||||
* quickly resolve it. This could be used for caching, fast mapping, etc.
|
||||
* The downside is it uses much more memory than a Hash, but it can be
|
||||
* a lot faster. It's main advantage is that it works on prefixes, which
|
||||
* is damn hard to get right with a Hash.
|
||||
*/
|
||||
VALUE URIClassifier_register(VALUE self, VALUE uri, VALUE handler)
|
||||
{
|
||||
int rc = 0;
|
||||
void *ptr = NULL;
|
||||
struct tst *tst = NULL;
|
||||
DATA_GET(self, struct tst, tst);
|
||||
|
||||
rc = tst_insert((unsigned char *)StringValueCStr(uri), (void *)handler , tst, 0, &ptr);
|
||||
|
||||
if(rc == TST_DUPLICATE_KEY) {
|
||||
rb_raise(rb_eStandardError, "Handler already registered with that name");
|
||||
} else if(rc == TST_ERROR) {
|
||||
rb_raise(rb_eStandardError, "Memory error registering handler");
|
||||
} else if(rc == TST_NULL_KEY) {
|
||||
rb_raise(rb_eStandardError, "URI was empty");
|
||||
}
|
||||
|
||||
rb_hash_aset(rb_iv_get(self, "handler_map"), uri, handler);
|
||||
|
||||
return Qnil;
|
||||
}</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,36 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>unregister (Mongrel::URIClassifier)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre>/**
|
||||
* call-seq:
|
||||
* uc.unregister("/someuri")
|
||||
*
|
||||
* Yep, just removes this uri and it's handler from the trie.
|
||||
*/
|
||||
VALUE URIClassifier_unregister(VALUE self, VALUE uri)
|
||||
{
|
||||
void *handler = NULL;
|
||||
struct tst *tst = NULL;
|
||||
DATA_GET(self, struct tst, tst);
|
||||
|
||||
handler = tst_delete((unsigned char *)StringValueCStr(uri), tst);
|
||||
|
||||
if(handler) {
|
||||
rb_hash_delete(rb_iv_get(self, "handler_map"), uri);
|
||||
|
||||
return (VALUE)handler;
|
||||
} else {
|
||||
return Qnil;
|
||||
}
|
||||
}</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,73 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>resolve (Mongrel::URIClassifier)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
</head>
|
||||
<body class="standalone-code">
|
||||
<pre>/**
|
||||
* call-seq:
|
||||
* uc.resolve("/someuri") -> "/someuri", "", handler
|
||||
* uc.resolve("/someuri/pathinfo") -> "/someuri", "/pathinfo", handler
|
||||
* uc.resolve("/notfound/orhere") -> nil, nil, nil
|
||||
*
|
||||
* Attempts to resolve either the whole URI or at the longest prefix, returning
|
||||
* the prefix (as script_info), path (as path_info), and registered handler
|
||||
* (usually an HttpHandler).
|
||||
*
|
||||
* It expects strings. Don't try other string-line stuff yet.
|
||||
*/
|
||||
VALUE URIClassifier_resolve(VALUE self, VALUE uri)
|
||||
{
|
||||
void *handler = NULL;
|
||||
int pref_len = 0;
|
||||
struct tst *tst = NULL;
|
||||
VALUE result;
|
||||
VALUE script_name;
|
||||
VALUE path_info;
|
||||
unsigned char *uri_str = NULL;
|
||||
unsigned char *script_name_str = NULL;
|
||||
|
||||
DATA_GET(self, struct tst, tst);
|
||||
uri_str = (unsigned char *)StringValueCStr(uri);
|
||||
|
||||
handler = tst_search(uri_str, tst, &pref_len);
|
||||
|
||||
// setup for multiple return values
|
||||
result = rb_ary_new();
|
||||
|
||||
|
||||
if(handler == NULL) {
|
||||
script_name = rb_str_substr (uri, 0, pref_len);
|
||||
script_name_str = (unsigned char *)StringValueCStr(script_name);
|
||||
|
||||
handler = tst_search(script_name_str, tst, NULL);
|
||||
|
||||
if(handler == NULL) {
|
||||
// didn't find the script name at all
|
||||
rb_ary_push(result, Qnil);
|
||||
rb_ary_push(result, Qnil);
|
||||
rb_ary_push(result, Qnil);
|
||||
return result;
|
||||
} else {
|
||||
// found a handler, setup the path info and we're good
|
||||
path_info = rb_str_substr(uri, pref_len, RSTRING(uri)->len);
|
||||
}
|
||||
} else {
|
||||
// whole thing was found, so uri is the script name, path info empty
|
||||
script_name = uri;
|
||||
path_info = rb_str_new2("");
|
||||
}
|
||||
|
||||
rb_ary_push(result, script_name);
|
||||
rb_ary_push(result, path_info);
|
||||
rb_ary_push(result, (VALUE)handler);
|
||||
return result;
|
||||
}</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1 +0,0 @@
|
|||
Thu Jan 26 01:27:35 EST 2006
|
|
@ -1,756 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>File: COPYING</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
||||
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
||||
function popupCode( url ) {
|
||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
||||
}
|
||||
|
||||
function toggleCode( id ) {
|
||||
if ( document.getElementById )
|
||||
elem = document.getElementById( id );
|
||||
else if ( document.all )
|
||||
elem = eval( "document.all." + id );
|
||||
else
|
||||
return false;
|
||||
|
||||
elemStyle = elem.style;
|
||||
|
||||
if ( elemStyle.display != "block" ) {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make codeblocks hidden by default
|
||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
||||
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="fileHeader">
|
||||
<h1>COPYING</h1>
|
||||
<table class="header-table">
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Path:</strong></td>
|
||||
<td>COPYING
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Last Update:</strong></td>
|
||||
<td>Mon Jan 16 11:34:01 EST 2006</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- banner header -->
|
||||
|
||||
<div id="bodyContent">
|
||||
|
||||
|
||||
|
||||
<div id="contextContent">
|
||||
|
||||
<div id="description">
|
||||
<pre>
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
</pre>
|
||||
<p>
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
</p>
|
||||
<pre>
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
</pre>
|
||||
<p>
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change free
|
||||
software—to make sure the software is free for all its users.
|
||||
</p>
|
||||
<pre>
|
||||
This license, the Lesser General Public License, applies to some
|
||||
</pre>
|
||||
<p>
|
||||
specially designated software packages—typically libraries—of
|
||||
the Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether this
|
||||
license or the ordinary General Public License is the better strategy to
|
||||
use in any particular case, based on the explanations below.
|
||||
</p>
|
||||
<pre>
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
</pre>
|
||||
<p>
|
||||
not price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for this
|
||||
service if you wish); that you receive source code or can get it if you
|
||||
want it; that you can change the software and use pieces of it in new free
|
||||
programs; and that you are informed that you can do these things.
|
||||
</p>
|
||||
<pre>
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
</pre>
|
||||
<p>
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for you if
|
||||
you distribute copies of the library or if you modify it.
|
||||
</p>
|
||||
<pre>
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
</pre>
|
||||
<p>
|
||||
or for a fee, you must give the recipients all the rights that we gave you.
|
||||
You must make sure that they, too, receive or can get the source code. If
|
||||
you link other code with the library, you must provide complete object
|
||||
files to the recipients, so that they can relink them with the library
|
||||
after making changes to the library and recompiling it. And you must show
|
||||
them these terms so they know their rights.
|
||||
</p>
|
||||
<pre>
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
</pre>
|
||||
<p>
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
</p>
|
||||
<pre>
|
||||
To protect each distributor, we want to make it very clear that
|
||||
</pre>
|
||||
<p>
|
||||
there is no warranty for the free library. Also, if the library is modified
|
||||
by someone else and passed on, the recipients should know that what they
|
||||
have is not the original version, so that the original author’s
|
||||
reputation will not be affected by problems that might be introduced by
|
||||
others.
|
||||
</p>
|
||||
<pre>
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
</pre>
|
||||
<p>
|
||||
any free program. We wish to make sure that a company cannot effectively
|
||||
restrict the users of a free program by obtaining a restrictive license
|
||||
from a patent holder. Therefore, we insist that any patent license obtained
|
||||
for a version of the library must be consistent with the full freedom of
|
||||
use specified in this license.
|
||||
</p>
|
||||
<pre>
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
</pre>
|
||||
<p>
|
||||
ordinary GNU General Public License. This license, the GNU Lesser General
|
||||
Public License, applies to certain designated libraries, and is quite
|
||||
different from the ordinary General Public License. We use this license for
|
||||
certain libraries in order to permit linking those libraries into non-free
|
||||
programs.
|
||||
</p>
|
||||
<pre>
|
||||
When a program is linked with a library, whether statically or using
|
||||
</pre>
|
||||
<p>
|
||||
a shared library, the combination of the two is legally speaking a combined
|
||||
work, a derivative of the original library. The ordinary General Public
|
||||
License therefore permits such linking only if the entire combination fits
|
||||
its criteria of freedom. The Lesser General Public License permits more lax
|
||||
criteria for linking other code with the library.
|
||||
</p>
|
||||
<pre>
|
||||
We call this license the "Lesser" General Public License because it
|
||||
</pre>
|
||||
<p>
|
||||
does Less to protect the user’s freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less of an
|
||||
advantage over competing non-free programs. These disadvantages are the
|
||||
reason we use the ordinary General Public License for many libraries.
|
||||
However, the Lesser license provides advantages in certain special
|
||||
circumstances.
|
||||
</p>
|
||||
<pre>
|
||||
For example, on rare occasions, there may be a special need to
|
||||
</pre>
|
||||
<p>
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be allowed to
|
||||
use the library. A more frequent case is that a free library does the same
|
||||
job as widely used non-free libraries. In this case, there is little to
|
||||
gain by limiting the free library to free software only, so we use the
|
||||
Lesser General Public License.
|
||||
</p>
|
||||
<pre>
|
||||
In other cases, permission to use a particular library in non-free
|
||||
</pre>
|
||||
<p>
|
||||
programs enables a greater number of people to use a large body of free
|
||||
software. For example, permission to use the GNU C Library in non-free
|
||||
programs enables many more people to use the whole GNU operating system, as
|
||||
well as its variant, the GNU/Linux operating system.
|
||||
</p>
|
||||
<pre>
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
</pre>
|
||||
<p>
|
||||
users’ freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run that
|
||||
program using a modified version of the Library.
|
||||
</p>
|
||||
<pre>
|
||||
The precise terms and conditions for copying, distribution and
|
||||
</pre>
|
||||
<p>
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the
|
||||
library". The former contains code derived from the library, whereas
|
||||
the latter must be combined with the library in order to run.
|
||||
</p>
|
||||
<pre>
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
</pre>
|
||||
<p>
|
||||
program which contains a notice placed by the copyright holder or other
|
||||
authorized party saying it may be distributed under the terms of this
|
||||
Lesser General Public License (also called "this License"). Each
|
||||
licensee is addressed as "you".
|
||||
</p>
|
||||
<pre>
|
||||
A "library" means a collection of software functions and/or data
|
||||
</pre>
|
||||
<p>
|
||||
prepared so as to be conveniently linked with application programs (which
|
||||
use some of those functions and data) to form executables.
|
||||
</p>
|
||||
<pre>
|
||||
The "Library", below, refers to any such software library or work
|
||||
</pre>
|
||||
<p>
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a portion
|
||||
of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
</p>
|
||||
<pre>
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
</pre>
|
||||
<p>
|
||||
making modifications to it. For a library, complete source code means all
|
||||
the source code for all modules it contains, plus any associated interface
|
||||
definition files, plus the scripts used to control compilation and
|
||||
installation of the library.
|
||||
</p>
|
||||
<pre>
|
||||
Activities other than copying, distribution and modification are not
|
||||
</pre>
|
||||
<p>
|
||||
covered by this License; they are outside its scope. The act of running a
|
||||
program using the Library is not restricted, and output from such a program
|
||||
is covered only if its contents constitute a work based on the Library
|
||||
(independent of the use of the Library in a tool for writing it). Whether
|
||||
that is true depends on what the Library does and what the program that
|
||||
uses the Library does.
|
||||
</p>
|
||||
<pre>
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
</pre>
|
||||
<p>
|
||||
complete source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the notices
|
||||
that refer to this License and to the absence of any warranty; and
|
||||
distribute a copy of this License along with the Library.
|
||||
</p>
|
||||
<pre>
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
</pre>
|
||||
<p>
|
||||
and you may at your option offer warranty protection in exchange for a fee.
|
||||
</p>
|
||||
<pre>
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
</pre>
|
||||
<p>
|
||||
of it, thus forming a work based on the Library, and copy and distribute
|
||||
such modifications or work under the terms of Section 1 above, provided
|
||||
that you also meet all of these conditions:
|
||||
</p>
|
||||
<pre>
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
</pre>
|
||||
<p>
|
||||
These requirements apply to the modified work as a whole. If identifiable
|
||||
sections of that work are not derived from the Library, and can be
|
||||
reasonably considered independent and separate works in themselves, then
|
||||
this License, and its terms, do not apply to those sections when you
|
||||
distribute them as separate works. But when you distribute the same
|
||||
sections as part of a whole which is a work based on the Library, the
|
||||
distribution of the whole must be on the terms of this License, whose
|
||||
permissions for other licensees extend to the entire whole, and thus to
|
||||
each and every part regardless of who wrote it.
|
||||
</p>
|
||||
<p>
|
||||
Thus, it is not the intent of this section to claim rights or contest your
|
||||
rights to work written entirely by you; rather, the intent is to exercise
|
||||
the right to control the distribution of derivative or collective works
|
||||
based on the Library.
|
||||
</p>
|
||||
<p>
|
||||
In addition, mere aggregation of another work not based on the Library with
|
||||
the Library (or with a work based on the Library) on a volume of a storage
|
||||
or distribution medium does not bring the other work under the scope of
|
||||
this License.
|
||||
</p>
|
||||
<pre>
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
</pre>
|
||||
<p>
|
||||
License instead of this License to a given copy of the Library. To do this,
|
||||
you must alter all the notices that refer to this License, so that they
|
||||
refer to the ordinary GNU General Public License, version 2, instead of to
|
||||
this License. (If a newer version than version 2 of the ordinary GNU
|
||||
General Public License has appeared, then you can specify that version
|
||||
instead if you wish.) Do not make any other change in these notices.
|
||||
</p>
|
||||
<pre>
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
</pre>
|
||||
<p>
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
</p>
|
||||
<pre>
|
||||
This option is useful when you wish to copy part of the code of
|
||||
</pre>
|
||||
<p>
|
||||
the Library into a program that is not a library.
|
||||
</p>
|
||||
<pre>
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
</pre>
|
||||
<p>
|
||||
derivative of it, under Section 2) in object code or executable form under
|
||||
the terms of Sections 1 and 2 above provided that you accompany it with the
|
||||
complete corresponding machine-readable source code, which must be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange.
|
||||
</p>
|
||||
<pre>
|
||||
If distribution of object code is made by offering access to copy
|
||||
</pre>
|
||||
<p>
|
||||
from a designated place, then offering equivalent access to copy the source
|
||||
code from the same place satisfies the requirement to distribute the source
|
||||
code, even though third parties are not compelled to copy the source along
|
||||
with the object code.
|
||||
</p>
|
||||
<pre>
|
||||
5. A program that contains no derivative of any portion of the
|
||||
</pre>
|
||||
<p>
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and therefore
|
||||
falls outside the scope of this License.
|
||||
</p>
|
||||
<pre>
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
</pre>
|
||||
<p>
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License. Section
|
||||
6 states terms for distribution of such executables.
|
||||
</p>
|
||||
<pre>
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
</pre>
|
||||
<p>
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not. Whether
|
||||
this is true is especially significant if the work can be linked without
|
||||
the Library, or if the work is itself a library. The threshold for this to
|
||||
be true is not precisely defined by law.
|
||||
</p>
|
||||
<pre>
|
||||
If such an object file uses only numerical parameters, data
|
||||
</pre>
|
||||
<p>
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object file is
|
||||
unrestricted, regardless of whether it is legally a derivative work.
|
||||
(Executables containing this object code plus portions of the Library will
|
||||
still fall under Section 6.)
|
||||
</p>
|
||||
<pre>
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
</pre>
|
||||
<p>
|
||||
distribute the object code for the work under the terms of Section 6. Any
|
||||
executables containing that work also fall under Section 6, whether or not
|
||||
they are linked directly with the Library itself.
|
||||
</p>
|
||||
<pre>
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
</pre>
|
||||
<p>
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work under
|
||||
terms of your choice, provided that the terms permit modification of the
|
||||
work for the customer’s own use and reverse engineering for debugging
|
||||
such modifications.
|
||||
</p>
|
||||
<pre>
|
||||
You must give prominent notice with each copy of the work that the
|
||||
</pre>
|
||||
<p>
|
||||
Library is used in it and that the Library and its use are covered by this
|
||||
License. You must supply a copy of this License. If the work during
|
||||
execution displays copyright notices, you must include the copyright notice
|
||||
for the Library among them, as well as a reference directing the user to
|
||||
the copy of this License. Also, you must do one of these things:
|
||||
</p>
|
||||
<pre>
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
</pre>
|
||||
<p>
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception, the
|
||||
materials to be distributed need not include anything that is normally
|
||||
distributed (in either source or binary form) with the major components
|
||||
(compiler, kernel, and so on) of the operating system on which the
|
||||
executable runs, unless that component itself accompanies the executable.
|
||||
</p>
|
||||
<pre>
|
||||
It may happen that this requirement contradicts the license
|
||||
</pre>
|
||||
<p>
|
||||
restrictions of other proprietary libraries that do not normally accompany
|
||||
the operating system. Such a contradiction means you cannot use both them
|
||||
and the Library together in an executable that you distribute.
|
||||
</p>
|
||||
<pre>
|
||||
7. You may place library facilities that are a work based on the
|
||||
</pre>
|
||||
<p>
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on the
|
||||
Library and of the other library facilities is otherwise permitted, and
|
||||
provided that you do these two things:
|
||||
</p>
|
||||
<pre>
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
</pre>
|
||||
<p>
|
||||
the Library except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense, link with, or distribute the Library
|
||||
is void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under this
|
||||
License will not have their licenses terminated so long as such parties
|
||||
remain in full compliance.
|
||||
</p>
|
||||
<pre>
|
||||
9. You are not required to accept this License, since you have not
|
||||
</pre>
|
||||
<p>
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the Library),
|
||||
you indicate your acceptance of this License to do so, and all its terms
|
||||
and conditions for copying, distributing or modifying the Library or works
|
||||
based on it.
|
||||
</p>
|
||||
<pre>
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
</pre>
|
||||
<p>
|
||||
Library), the recipient automatically receives a license from the original
|
||||
licensor to copy, distribute, link with or modify the Library subject to
|
||||
these terms and conditions. You may not impose any further restrictions on
|
||||
the recipients’ exercise of the rights granted herein. You are not
|
||||
responsible for enforcing compliance by third parties with this License.
|
||||
</p>
|
||||
<pre>
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
</pre>
|
||||
<p>
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot distribute so
|
||||
as to satisfy simultaneously your obligations under this License and any
|
||||
other pertinent obligations, then as a consequence you may not distribute
|
||||
the Library at all. For example, if a patent license would not permit
|
||||
royalty-free redistribution of the Library by all those who receive copies
|
||||
directly or indirectly through you, then the only way you could satisfy
|
||||
both it and this License would be to refrain entirely from distribution of
|
||||
the Library.
|
||||
</p>
|
||||
<p>
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
</p>
|
||||
<p>
|
||||
It is not the purpose of this section to induce you to infringe any patents
|
||||
or other property right claims or to contest validity of any such claims;
|
||||
this section has the sole purpose of protecting the integrity of the free
|
||||
software distribution system which is implemented by public license
|
||||
practices. Many people have made generous contributions to the wide range
|
||||
of software distributed through that system in reliance on consistent
|
||||
application of that system; it is up to the author/donor to decide if he or
|
||||
she is willing to distribute software through any other system and a
|
||||
licensee cannot impose that choice.
|
||||
</p>
|
||||
<p>
|
||||
This section is intended to make thoroughly clear what is believed to be a
|
||||
consequence of the rest of this License.
|
||||
</p>
|
||||
<pre>
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
</pre>
|
||||
<p>
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
</p>
|
||||
<pre>
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
</pre>
|
||||
<p>
|
||||
versions of the Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may differ
|
||||
in detail to address new problems or concerns.
|
||||
</p>
|
||||
<p>
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms
|
||||
and conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a license
|
||||
version number, you may choose any version ever published by the Free
|
||||
Software Foundation.
|
||||
</p>
|
||||
<pre>
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
</pre>
|
||||
<p>
|
||||
programs whose distribution conditions are incompatible with these, write
|
||||
to the author to ask for permission. For software which is copyrighted by
|
||||
the Free Software Foundation, write to the Free Software Foundation; we
|
||||
sometimes make exceptions for this. Our decision will be guided by the two
|
||||
goals of preserving the free status of all derivatives of our free software
|
||||
and of promoting the sharing and reuse of software generally.
|
||||
</p>
|
||||
<pre>
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
</pre>
|
||||
<p>
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
|
||||
WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE
|
||||
LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
</p>
|
||||
<pre>
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
</pre>
|
||||
<p>
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER
|
||||
SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
</p>
|
||||
<pre>
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
</pre>
|
||||
<p>
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
</p>
|
||||
<pre>
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
</pre>
|
||||
<p>
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
</p>
|
||||
<pre>
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
</pre>
|
||||
<p>
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
</p>
|
||||
<p>
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library,
|
||||
if necessary. Here is a sample; alter the names:
|
||||
</p>
|
||||
<pre>
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
</pre>
|
||||
<p>
|
||||
That’s all there is to it!
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- if includes -->
|
||||
|
||||
<div id="section">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- if method_list -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="validator-badges">
|
||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,756 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>File: LICENSE</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
||||
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
||||
function popupCode( url ) {
|
||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
||||
}
|
||||
|
||||
function toggleCode( id ) {
|
||||
if ( document.getElementById )
|
||||
elem = document.getElementById( id );
|
||||
else if ( document.all )
|
||||
elem = eval( "document.all." + id );
|
||||
else
|
||||
return false;
|
||||
|
||||
elemStyle = elem.style;
|
||||
|
||||
if ( elemStyle.display != "block" ) {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make codeblocks hidden by default
|
||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
||||
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="fileHeader">
|
||||
<h1>LICENSE</h1>
|
||||
<table class="header-table">
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Path:</strong></td>
|
||||
<td>LICENSE
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Last Update:</strong></td>
|
||||
<td>Mon Jan 16 11:34:01 EST 2006</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- banner header -->
|
||||
|
||||
<div id="bodyContent">
|
||||
|
||||
|
||||
|
||||
<div id="contextContent">
|
||||
|
||||
<div id="description">
|
||||
<pre>
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
</pre>
|
||||
<p>
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
</p>
|
||||
<pre>
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
</pre>
|
||||
<p>
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change free
|
||||
software—to make sure the software is free for all its users.
|
||||
</p>
|
||||
<pre>
|
||||
This license, the Lesser General Public License, applies to some
|
||||
</pre>
|
||||
<p>
|
||||
specially designated software packages—typically libraries—of
|
||||
the Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether this
|
||||
license or the ordinary General Public License is the better strategy to
|
||||
use in any particular case, based on the explanations below.
|
||||
</p>
|
||||
<pre>
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
</pre>
|
||||
<p>
|
||||
not price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for this
|
||||
service if you wish); that you receive source code or can get it if you
|
||||
want it; that you can change the software and use pieces of it in new free
|
||||
programs; and that you are informed that you can do these things.
|
||||
</p>
|
||||
<pre>
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
</pre>
|
||||
<p>
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for you if
|
||||
you distribute copies of the library or if you modify it.
|
||||
</p>
|
||||
<pre>
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
</pre>
|
||||
<p>
|
||||
or for a fee, you must give the recipients all the rights that we gave you.
|
||||
You must make sure that they, too, receive or can get the source code. If
|
||||
you link other code with the library, you must provide complete object
|
||||
files to the recipients, so that they can relink them with the library
|
||||
after making changes to the library and recompiling it. And you must show
|
||||
them these terms so they know their rights.
|
||||
</p>
|
||||
<pre>
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
</pre>
|
||||
<p>
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
</p>
|
||||
<pre>
|
||||
To protect each distributor, we want to make it very clear that
|
||||
</pre>
|
||||
<p>
|
||||
there is no warranty for the free library. Also, if the library is modified
|
||||
by someone else and passed on, the recipients should know that what they
|
||||
have is not the original version, so that the original author’s
|
||||
reputation will not be affected by problems that might be introduced by
|
||||
others.
|
||||
</p>
|
||||
<pre>
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
</pre>
|
||||
<p>
|
||||
any free program. We wish to make sure that a company cannot effectively
|
||||
restrict the users of a free program by obtaining a restrictive license
|
||||
from a patent holder. Therefore, we insist that any patent license obtained
|
||||
for a version of the library must be consistent with the full freedom of
|
||||
use specified in this license.
|
||||
</p>
|
||||
<pre>
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
</pre>
|
||||
<p>
|
||||
ordinary GNU General Public License. This license, the GNU Lesser General
|
||||
Public License, applies to certain designated libraries, and is quite
|
||||
different from the ordinary General Public License. We use this license for
|
||||
certain libraries in order to permit linking those libraries into non-free
|
||||
programs.
|
||||
</p>
|
||||
<pre>
|
||||
When a program is linked with a library, whether statically or using
|
||||
</pre>
|
||||
<p>
|
||||
a shared library, the combination of the two is legally speaking a combined
|
||||
work, a derivative of the original library. The ordinary General Public
|
||||
License therefore permits such linking only if the entire combination fits
|
||||
its criteria of freedom. The Lesser General Public License permits more lax
|
||||
criteria for linking other code with the library.
|
||||
</p>
|
||||
<pre>
|
||||
We call this license the "Lesser" General Public License because it
|
||||
</pre>
|
||||
<p>
|
||||
does Less to protect the user’s freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less of an
|
||||
advantage over competing non-free programs. These disadvantages are the
|
||||
reason we use the ordinary General Public License for many libraries.
|
||||
However, the Lesser license provides advantages in certain special
|
||||
circumstances.
|
||||
</p>
|
||||
<pre>
|
||||
For example, on rare occasions, there may be a special need to
|
||||
</pre>
|
||||
<p>
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be allowed to
|
||||
use the library. A more frequent case is that a free library does the same
|
||||
job as widely used non-free libraries. In this case, there is little to
|
||||
gain by limiting the free library to free software only, so we use the
|
||||
Lesser General Public License.
|
||||
</p>
|
||||
<pre>
|
||||
In other cases, permission to use a particular library in non-free
|
||||
</pre>
|
||||
<p>
|
||||
programs enables a greater number of people to use a large body of free
|
||||
software. For example, permission to use the GNU C Library in non-free
|
||||
programs enables many more people to use the whole GNU operating system, as
|
||||
well as its variant, the GNU/Linux operating system.
|
||||
</p>
|
||||
<pre>
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
</pre>
|
||||
<p>
|
||||
users’ freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run that
|
||||
program using a modified version of the Library.
|
||||
</p>
|
||||
<pre>
|
||||
The precise terms and conditions for copying, distribution and
|
||||
</pre>
|
||||
<p>
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the
|
||||
library". The former contains code derived from the library, whereas
|
||||
the latter must be combined with the library in order to run.
|
||||
</p>
|
||||
<pre>
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
</pre>
|
||||
<p>
|
||||
program which contains a notice placed by the copyright holder or other
|
||||
authorized party saying it may be distributed under the terms of this
|
||||
Lesser General Public License (also called "this License"). Each
|
||||
licensee is addressed as "you".
|
||||
</p>
|
||||
<pre>
|
||||
A "library" means a collection of software functions and/or data
|
||||
</pre>
|
||||
<p>
|
||||
prepared so as to be conveniently linked with application programs (which
|
||||
use some of those functions and data) to form executables.
|
||||
</p>
|
||||
<pre>
|
||||
The "Library", below, refers to any such software library or work
|
||||
</pre>
|
||||
<p>
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a portion
|
||||
of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
</p>
|
||||
<pre>
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
</pre>
|
||||
<p>
|
||||
making modifications to it. For a library, complete source code means all
|
||||
the source code for all modules it contains, plus any associated interface
|
||||
definition files, plus the scripts used to control compilation and
|
||||
installation of the library.
|
||||
</p>
|
||||
<pre>
|
||||
Activities other than copying, distribution and modification are not
|
||||
</pre>
|
||||
<p>
|
||||
covered by this License; they are outside its scope. The act of running a
|
||||
program using the Library is not restricted, and output from such a program
|
||||
is covered only if its contents constitute a work based on the Library
|
||||
(independent of the use of the Library in a tool for writing it). Whether
|
||||
that is true depends on what the Library does and what the program that
|
||||
uses the Library does.
|
||||
</p>
|
||||
<pre>
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
</pre>
|
||||
<p>
|
||||
complete source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the notices
|
||||
that refer to this License and to the absence of any warranty; and
|
||||
distribute a copy of this License along with the Library.
|
||||
</p>
|
||||
<pre>
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
</pre>
|
||||
<p>
|
||||
and you may at your option offer warranty protection in exchange for a fee.
|
||||
</p>
|
||||
<pre>
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
</pre>
|
||||
<p>
|
||||
of it, thus forming a work based on the Library, and copy and distribute
|
||||
such modifications or work under the terms of Section 1 above, provided
|
||||
that you also meet all of these conditions:
|
||||
</p>
|
||||
<pre>
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
</pre>
|
||||
<p>
|
||||
These requirements apply to the modified work as a whole. If identifiable
|
||||
sections of that work are not derived from the Library, and can be
|
||||
reasonably considered independent and separate works in themselves, then
|
||||
this License, and its terms, do not apply to those sections when you
|
||||
distribute them as separate works. But when you distribute the same
|
||||
sections as part of a whole which is a work based on the Library, the
|
||||
distribution of the whole must be on the terms of this License, whose
|
||||
permissions for other licensees extend to the entire whole, and thus to
|
||||
each and every part regardless of who wrote it.
|
||||
</p>
|
||||
<p>
|
||||
Thus, it is not the intent of this section to claim rights or contest your
|
||||
rights to work written entirely by you; rather, the intent is to exercise
|
||||
the right to control the distribution of derivative or collective works
|
||||
based on the Library.
|
||||
</p>
|
||||
<p>
|
||||
In addition, mere aggregation of another work not based on the Library with
|
||||
the Library (or with a work based on the Library) on a volume of a storage
|
||||
or distribution medium does not bring the other work under the scope of
|
||||
this License.
|
||||
</p>
|
||||
<pre>
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
</pre>
|
||||
<p>
|
||||
License instead of this License to a given copy of the Library. To do this,
|
||||
you must alter all the notices that refer to this License, so that they
|
||||
refer to the ordinary GNU General Public License, version 2, instead of to
|
||||
this License. (If a newer version than version 2 of the ordinary GNU
|
||||
General Public License has appeared, then you can specify that version
|
||||
instead if you wish.) Do not make any other change in these notices.
|
||||
</p>
|
||||
<pre>
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
</pre>
|
||||
<p>
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
</p>
|
||||
<pre>
|
||||
This option is useful when you wish to copy part of the code of
|
||||
</pre>
|
||||
<p>
|
||||
the Library into a program that is not a library.
|
||||
</p>
|
||||
<pre>
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
</pre>
|
||||
<p>
|
||||
derivative of it, under Section 2) in object code or executable form under
|
||||
the terms of Sections 1 and 2 above provided that you accompany it with the
|
||||
complete corresponding machine-readable source code, which must be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange.
|
||||
</p>
|
||||
<pre>
|
||||
If distribution of object code is made by offering access to copy
|
||||
</pre>
|
||||
<p>
|
||||
from a designated place, then offering equivalent access to copy the source
|
||||
code from the same place satisfies the requirement to distribute the source
|
||||
code, even though third parties are not compelled to copy the source along
|
||||
with the object code.
|
||||
</p>
|
||||
<pre>
|
||||
5. A program that contains no derivative of any portion of the
|
||||
</pre>
|
||||
<p>
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and therefore
|
||||
falls outside the scope of this License.
|
||||
</p>
|
||||
<pre>
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
</pre>
|
||||
<p>
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License. Section
|
||||
6 states terms for distribution of such executables.
|
||||
</p>
|
||||
<pre>
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
</pre>
|
||||
<p>
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not. Whether
|
||||
this is true is especially significant if the work can be linked without
|
||||
the Library, or if the work is itself a library. The threshold for this to
|
||||
be true is not precisely defined by law.
|
||||
</p>
|
||||
<pre>
|
||||
If such an object file uses only numerical parameters, data
|
||||
</pre>
|
||||
<p>
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object file is
|
||||
unrestricted, regardless of whether it is legally a derivative work.
|
||||
(Executables containing this object code plus portions of the Library will
|
||||
still fall under Section 6.)
|
||||
</p>
|
||||
<pre>
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
</pre>
|
||||
<p>
|
||||
distribute the object code for the work under the terms of Section 6. Any
|
||||
executables containing that work also fall under Section 6, whether or not
|
||||
they are linked directly with the Library itself.
|
||||
</p>
|
||||
<pre>
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
</pre>
|
||||
<p>
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work under
|
||||
terms of your choice, provided that the terms permit modification of the
|
||||
work for the customer’s own use and reverse engineering for debugging
|
||||
such modifications.
|
||||
</p>
|
||||
<pre>
|
||||
You must give prominent notice with each copy of the work that the
|
||||
</pre>
|
||||
<p>
|
||||
Library is used in it and that the Library and its use are covered by this
|
||||
License. You must supply a copy of this License. If the work during
|
||||
execution displays copyright notices, you must include the copyright notice
|
||||
for the Library among them, as well as a reference directing the user to
|
||||
the copy of this License. Also, you must do one of these things:
|
||||
</p>
|
||||
<pre>
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
</pre>
|
||||
<p>
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception, the
|
||||
materials to be distributed need not include anything that is normally
|
||||
distributed (in either source or binary form) with the major components
|
||||
(compiler, kernel, and so on) of the operating system on which the
|
||||
executable runs, unless that component itself accompanies the executable.
|
||||
</p>
|
||||
<pre>
|
||||
It may happen that this requirement contradicts the license
|
||||
</pre>
|
||||
<p>
|
||||
restrictions of other proprietary libraries that do not normally accompany
|
||||
the operating system. Such a contradiction means you cannot use both them
|
||||
and the Library together in an executable that you distribute.
|
||||
</p>
|
||||
<pre>
|
||||
7. You may place library facilities that are a work based on the
|
||||
</pre>
|
||||
<p>
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on the
|
||||
Library and of the other library facilities is otherwise permitted, and
|
||||
provided that you do these two things:
|
||||
</p>
|
||||
<pre>
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
</pre>
|
||||
<p>
|
||||
the Library except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense, link with, or distribute the Library
|
||||
is void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under this
|
||||
License will not have their licenses terminated so long as such parties
|
||||
remain in full compliance.
|
||||
</p>
|
||||
<pre>
|
||||
9. You are not required to accept this License, since you have not
|
||||
</pre>
|
||||
<p>
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the Library),
|
||||
you indicate your acceptance of this License to do so, and all its terms
|
||||
and conditions for copying, distributing or modifying the Library or works
|
||||
based on it.
|
||||
</p>
|
||||
<pre>
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
</pre>
|
||||
<p>
|
||||
Library), the recipient automatically receives a license from the original
|
||||
licensor to copy, distribute, link with or modify the Library subject to
|
||||
these terms and conditions. You may not impose any further restrictions on
|
||||
the recipients’ exercise of the rights granted herein. You are not
|
||||
responsible for enforcing compliance by third parties with this License.
|
||||
</p>
|
||||
<pre>
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
</pre>
|
||||
<p>
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot distribute so
|
||||
as to satisfy simultaneously your obligations under this License and any
|
||||
other pertinent obligations, then as a consequence you may not distribute
|
||||
the Library at all. For example, if a patent license would not permit
|
||||
royalty-free redistribution of the Library by all those who receive copies
|
||||
directly or indirectly through you, then the only way you could satisfy
|
||||
both it and this License would be to refrain entirely from distribution of
|
||||
the Library.
|
||||
</p>
|
||||
<p>
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
</p>
|
||||
<p>
|
||||
It is not the purpose of this section to induce you to infringe any patents
|
||||
or other property right claims or to contest validity of any such claims;
|
||||
this section has the sole purpose of protecting the integrity of the free
|
||||
software distribution system which is implemented by public license
|
||||
practices. Many people have made generous contributions to the wide range
|
||||
of software distributed through that system in reliance on consistent
|
||||
application of that system; it is up to the author/donor to decide if he or
|
||||
she is willing to distribute software through any other system and a
|
||||
licensee cannot impose that choice.
|
||||
</p>
|
||||
<p>
|
||||
This section is intended to make thoroughly clear what is believed to be a
|
||||
consequence of the rest of this License.
|
||||
</p>
|
||||
<pre>
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
</pre>
|
||||
<p>
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
</p>
|
||||
<pre>
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
</pre>
|
||||
<p>
|
||||
versions of the Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may differ
|
||||
in detail to address new problems or concerns.
|
||||
</p>
|
||||
<p>
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms
|
||||
and conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a license
|
||||
version number, you may choose any version ever published by the Free
|
||||
Software Foundation.
|
||||
</p>
|
||||
<pre>
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
</pre>
|
||||
<p>
|
||||
programs whose distribution conditions are incompatible with these, write
|
||||
to the author to ask for permission. For software which is copyrighted by
|
||||
the Free Software Foundation, write to the Free Software Foundation; we
|
||||
sometimes make exceptions for this. Our decision will be guided by the two
|
||||
goals of preserving the free status of all derivatives of our free software
|
||||
and of promoting the sharing and reuse of software generally.
|
||||
</p>
|
||||
<pre>
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
</pre>
|
||||
<p>
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
|
||||
WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE
|
||||
LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
</p>
|
||||
<pre>
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
</pre>
|
||||
<p>
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER
|
||||
SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
</p>
|
||||
<pre>
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
</pre>
|
||||
<p>
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
</p>
|
||||
<pre>
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
</pre>
|
||||
<p>
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
</p>
|
||||
<pre>
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
</pre>
|
||||
<p>
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
</p>
|
||||
<p>
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library,
|
||||
if necessary. Here is a sample; alter the names:
|
||||
</p>
|
||||
<pre>
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
</pre>
|
||||
<p>
|
||||
That’s all there is to it!
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- if includes -->
|
||||
|
||||
<div id="section">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- if method_list -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="validator-badges">
|
||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,170 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>File: README</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
||||
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
||||
function popupCode( url ) {
|
||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
||||
}
|
||||
|
||||
function toggleCode( id ) {
|
||||
if ( document.getElementById )
|
||||
elem = document.getElementById( id );
|
||||
else if ( document.all )
|
||||
elem = eval( "document.all." + id );
|
||||
else
|
||||
return false;
|
||||
|
||||
elemStyle = elem.style;
|
||||
|
||||
if ( elemStyle.display != "block" ) {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make codeblocks hidden by default
|
||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
||||
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="fileHeader">
|
||||
<h1>README</h1>
|
||||
<table class="header-table">
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Path:</strong></td>
|
||||
<td>README
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Last Update:</strong></td>
|
||||
<td>Thu Jan 26 01:27:16 EST 2006</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- banner header -->
|
||||
|
||||
<div id="bodyContent">
|
||||
|
||||
|
||||
|
||||
<div id="contextContent">
|
||||
|
||||
<div id="description">
|
||||
<h2><a href="../classes/Mongrel.html">Mongrel</a>: Simple Fast Mostly Ruby Web Server</h2>
|
||||
<p>
|
||||
<a href="../classes/Mongrel.html">Mongrel</a> is a small library that
|
||||
provides a very fast HTTP 1.1 server for Ruby web applications. It is not
|
||||
particular to any framework, and is intended to be just enough to get a web
|
||||
application running behind a more complete and robust web server.
|
||||
</p>
|
||||
<p>
|
||||
What makes <a href="../classes/Mongrel.html">Mongrel</a> so fast is the
|
||||
careful use of a C extension to provide fast HTTP 1.1 protocol parsing and
|
||||
fast URI lookup. This combination makes the server very fast without too
|
||||
many portability issues.
|
||||
</p>
|
||||
<h2>Status</h2>
|
||||
<p>
|
||||
<a href="../classes/Mongrel.html">Mongrel</a> is still very ALPHA work, but
|
||||
you can see how it’s used with the Camping framework (version 1.2)
|
||||
and take a look at how you might use it. Right now it handles HTTP requests
|
||||
well and process the responses fast, but you have to "roll your
|
||||
own" response code.
|
||||
</p>
|
||||
<p>
|
||||
The next release of <a href="../classes/Mongrel.html">Mongrel</a> will have
|
||||
improved IO handling, much more stability, and should have a better <a
|
||||
href="../classes/Mongrel/HttpResponse.html">Mongrel::HttpResponse</a>
|
||||
object with more useful features.
|
||||
</p>
|
||||
<h2>Install</h2>
|
||||
<p>
|
||||
You can install it via source from <a
|
||||
href="http://www.zedshaw.com/downloads/mongrel">www.zedshaw.com/downloads/mongrel</a>/
|
||||
or you can gram a RubyGem at <a
|
||||
href="http://www.zedshaw.com/downloads/mongrel">www.zedshaw.com/downloads/mongrel</a>/
|
||||
and install that manually. I’m working on setting up a RubyForge
|
||||
project.
|
||||
</p>
|
||||
<p>
|
||||
It doesn’t explicitly require Camping, but if you want to run the
|
||||
examples/tepee.rb example then you’ll need to install Camping 1.2 at
|
||||
least (and redcloth I think). These are all available from RubyGems.
|
||||
</p>
|
||||
<p>
|
||||
The library consists of a C extension so you’ll need a C compiler or
|
||||
at least a friend who can build it for you.
|
||||
</p>
|
||||
<p>
|
||||
Finally, the source include a setup.rb for those who hate RubyGems.
|
||||
</p>
|
||||
<h2>Usage</h2>
|
||||
<p>
|
||||
Best place to look for usage examples right now is the examples/ directory.
|
||||
</p>
|
||||
<h2>Speed</h2>
|
||||
<p>
|
||||
This 0.1.2 release will not be as fast as the 0.1.1 release since
|
||||
I’ve temporarily removed threads as a test. There were many stability
|
||||
issues related to handling each request in a thread, especially on OSX.
|
||||
I’ve taken them out for now to make things stable. Even with this
|
||||
removed <a href="../classes/Mongrel.html">Mongrel</a> is still pretty fast
|
||||
compared to WEBrick.
|
||||
</p>
|
||||
<h2>Contact</h2>
|
||||
<p>
|
||||
E-mail zedshaw at zedshaw.com and I’ll help. Comments about the API
|
||||
are welcome.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- if includes -->
|
||||
|
||||
<div id="section">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- if method_list -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="validator-badges">
|
||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,101 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>File: http11.c</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
||||
function popupCode( url ) {
|
||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
||||
}
|
||||
|
||||
function toggleCode( id ) {
|
||||
if ( document.getElementById )
|
||||
elem = document.getElementById( id );
|
||||
else if ( document.all )
|
||||
elem = eval( "document.all." + id );
|
||||
else
|
||||
return false;
|
||||
|
||||
elemStyle = elem.style;
|
||||
|
||||
if ( elemStyle.display != "block" ) {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make codeblocks hidden by default
|
||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
||||
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="fileHeader">
|
||||
<h1>http11.c</h1>
|
||||
<table class="header-table">
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Path:</strong></td>
|
||||
<td>ext/http11/http11.c
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Last Update:</strong></td>
|
||||
<td>Thu Jan 26 00:41:25 EST 2006</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- banner header -->
|
||||
|
||||
<div id="bodyContent">
|
||||
|
||||
|
||||
|
||||
<div id="contextContent">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- if includes -->
|
||||
|
||||
<div id="section">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- if method_list -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="validator-badges">
|
||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,110 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>File: mongrel.rb</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
||||
function popupCode( url ) {
|
||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
||||
}
|
||||
|
||||
function toggleCode( id ) {
|
||||
if ( document.getElementById )
|
||||
elem = document.getElementById( id );
|
||||
else if ( document.all )
|
||||
elem = eval( "document.all." + id );
|
||||
else
|
||||
return false;
|
||||
|
||||
elemStyle = elem.style;
|
||||
|
||||
if ( elemStyle.display != "block" ) {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make codeblocks hidden by default
|
||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
||||
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="fileHeader">
|
||||
<h1>mongrel.rb</h1>
|
||||
<table class="header-table">
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Path:</strong></td>
|
||||
<td>lib/mongrel.rb
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="top-aligned-row">
|
||||
<td><strong>Last Update:</strong></td>
|
||||
<td>Thu Jan 26 01:10:22 EST 2006</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- banner header -->
|
||||
|
||||
<div id="bodyContent">
|
||||
|
||||
|
||||
|
||||
<div id="contextContent">
|
||||
|
||||
|
||||
<div id="requires-list">
|
||||
<h3 class="section-bar">Required files</h3>
|
||||
|
||||
<div class="name-list">
|
||||
socket
|
||||
http11
|
||||
thread
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- if includes -->
|
||||
|
||||
<div id="section">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- if method_list -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="validator-badges">
|
||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,34 +0,0 @@
|
|||
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<!--
|
||||
|
||||
Classes
|
||||
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Classes</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="rdoc-style.css" type="text/css" />
|
||||
<base target="docwin" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="index">
|
||||
<h1 class="section-bar">Classes</h1>
|
||||
<div id="index-entries">
|
||||
<a href="classes/Mongrel.html">Mongrel</a><br />
|
||||
<a href="classes/Mongrel/Error404Handler.html">Mongrel::Error404Handler</a><br />
|
||||
<a href="classes/Mongrel/HttpHandler.html">Mongrel::HttpHandler</a><br />
|
||||
<a href="classes/Mongrel/HttpParser.html">Mongrel::HttpParser</a><br />
|
||||
<a href="classes/Mongrel/HttpRequest.html">Mongrel::HttpRequest</a><br />
|
||||
<a href="classes/Mongrel/HttpResponse.html">Mongrel::HttpResponse</a><br />
|
||||
<a href="classes/Mongrel/HttpServer.html">Mongrel::HttpServer</a><br />
|
||||
<a href="classes/Mongrel/URIClassifier.html">Mongrel::URIClassifier</a><br />
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,31 +0,0 @@
|
|||
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<!--
|
||||
|
||||
Files
|
||||
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Files</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="rdoc-style.css" type="text/css" />
|
||||
<base target="docwin" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="index">
|
||||
<h1 class="section-bar">Files</h1>
|
||||
<div id="index-entries">
|
||||
<a href="files/COPYING.html">COPYING</a><br />
|
||||
<a href="files/LICENSE.html">LICENSE</a><br />
|
||||
<a href="files/README.html">README</a><br />
|
||||
<a href="files/ext/http11/http11_c.html">ext/http11/http11.c</a><br />
|
||||
<a href="files/lib/mongrel_rb.html">lib/mongrel.rb</a><br />
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,47 +0,0 @@
|
|||
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<!--
|
||||
|
||||
Methods
|
||||
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Methods</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="stylesheet" href="rdoc-style.css" type="text/css" />
|
||||
<base target="docwin" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="index">
|
||||
<h1 class="section-bar">Methods</h1>
|
||||
<div id="index-entries">
|
||||
<a href="classes/Mongrel/HttpParser.html#M000005">error? (Mongrel::HttpParser)</a><br />
|
||||
<a href="classes/Mongrel/HttpParser.html#M000004">execute (Mongrel::HttpParser)</a><br />
|
||||
<a href="classes/Mongrel/HttpParser.html#M000003">finish (Mongrel::HttpParser)</a><br />
|
||||
<a href="classes/Mongrel/HttpParser.html#M000006">finished? (Mongrel::HttpParser)</a><br />
|
||||
<a href="classes/Mongrel/HttpParser.html#M000001">new (Mongrel::HttpParser)</a><br />
|
||||
<a href="classes/Mongrel/Error404Handler.html#M000019">new (Mongrel::Error404Handler)</a><br />
|
||||
<a href="classes/Mongrel/HttpResponse.html#M000018">new (Mongrel::HttpResponse)</a><br />
|
||||
<a href="classes/Mongrel/HttpServer.html#M000008">new (Mongrel::HttpServer)</a><br />
|
||||
<a href="classes/Mongrel/URIClassifier.html#M000013">new (Mongrel::URIClassifier)</a><br />
|
||||
<a href="classes/Mongrel/HttpRequest.html#M000021">new (Mongrel::HttpRequest)</a><br />
|
||||
<a href="classes/Mongrel/HttpParser.html#M000007">nread (Mongrel::HttpParser)</a><br />
|
||||
<a href="classes/Mongrel/Error404Handler.html#M000020">process (Mongrel::Error404Handler)</a><br />
|
||||
<a href="classes/Mongrel/HttpHandler.html#M000017">process (Mongrel::HttpHandler)</a><br />
|
||||
<a href="classes/Mongrel/HttpServer.html#M000009">process_client (Mongrel::HttpServer)</a><br />
|
||||
<a href="classes/Mongrel/URIClassifier.html#M000014">register (Mongrel::URIClassifier)</a><br />
|
||||
<a href="classes/Mongrel/HttpServer.html#M000011">register (Mongrel::HttpServer)</a><br />
|
||||
<a href="classes/Mongrel/HttpParser.html#M000002">reset (Mongrel::HttpParser)</a><br />
|
||||
<a href="classes/Mongrel/URIClassifier.html#M000016">resolve (Mongrel::URIClassifier)</a><br />
|
||||
<a href="classes/Mongrel/HttpServer.html#M000010">run (Mongrel::HttpServer)</a><br />
|
||||
<a href="classes/Mongrel/HttpServer.html#M000012">unregister (Mongrel::HttpServer)</a><br />
|
||||
<a href="classes/Mongrel/URIClassifier.html#M000015">unregister (Mongrel::URIClassifier)</a><br />
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,24 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
||||
|
||||
<!--
|
||||
|
||||
RDoc Documentation
|
||||
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>RDoc Documentation</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
</head>
|
||||
<frameset rows="20%, 80%">
|
||||
<frameset cols="25%,35%,45%">
|
||||
<frame src="fr_file_index.html" title="Files" name="Files" />
|
||||
<frame src="fr_class_index.html" name="Classes" />
|
||||
<frame src="fr_method_index.html" name="Methods" />
|
||||
</frameset>
|
||||
<frame src="files/README.html" name="docwin" />
|
||||
</frameset>
|
||||
</html>
|
|
@ -1,208 +0,0 @@
|
|||
|
||||
body {
|
||||
font-family: Verdana,Arial,Helvetica,sans-serif;
|
||||
font-size: 90%;
|
||||
margin: 0;
|
||||
margin-left: 40px;
|
||||
padding: 0;
|
||||
background: white;
|
||||
}
|
||||
|
||||
h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
|
||||
h1 { font-size: 150%; }
|
||||
h2,h3,h4 { margin-top: 1em; }
|
||||
|
||||
a { background: #eef; color: #039; text-decoration: none; }
|
||||
a:hover { background: #039; color: #eef; }
|
||||
|
||||
/* Override the base stylesheet's Anchor inside a table cell */
|
||||
td > a {
|
||||
background: transparent;
|
||||
color: #039;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* and inside a section title */
|
||||
.section-title > a {
|
||||
background: transparent;
|
||||
color: #eee;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* === Structural elements =================================== */
|
||||
|
||||
div#index {
|
||||
margin: 0;
|
||||
margin-left: -40px;
|
||||
padding: 0;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
|
||||
div#index a {
|
||||
margin-left: 0.7em;
|
||||
}
|
||||
|
||||
div#index .section-bar {
|
||||
margin-left: 0px;
|
||||
padding-left: 0.7em;
|
||||
background: #ccc;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
|
||||
div#classHeader, div#fileHeader {
|
||||
width: auto;
|
||||
color: white;
|
||||
padding: 0.5em 1.5em 0.5em 1.5em;
|
||||
margin: 0;
|
||||
margin-left: -40px;
|
||||
border-bottom: 3px solid #006;
|
||||
}
|
||||
|
||||
div#classHeader a, div#fileHeader a {
|
||||
background: inherit;
|
||||
color: white;
|
||||
}
|
||||
|
||||
div#classHeader td, div#fileHeader td {
|
||||
background: inherit;
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
div#fileHeader {
|
||||
background: #057;
|
||||
}
|
||||
|
||||
div#classHeader {
|
||||
background: #048;
|
||||
}
|
||||
|
||||
|
||||
.class-name-in-header {
|
||||
font-size: 180%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
div#bodyContent {
|
||||
padding: 0 1.5em 0 1.5em;
|
||||
}
|
||||
|
||||
div#description {
|
||||
padding: 0.5em 1.5em;
|
||||
background: #efefef;
|
||||
border: 1px dotted #999;
|
||||
}
|
||||
|
||||
div#description h1,h2,h3,h4,h5,h6 {
|
||||
color: #125;;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
div#validator-badges {
|
||||
text-align: center;
|
||||
}
|
||||
div#validator-badges img { border: 0; }
|
||||
|
||||
div#copyright {
|
||||
color: #333;
|
||||
background: #efefef;
|
||||
font: 0.75em sans-serif;
|
||||
margin-top: 5em;
|
||||
margin-bottom: 0;
|
||||
padding: 0.5em 2em;
|
||||
}
|
||||
|
||||
|
||||
/* === Classes =================================== */
|
||||
|
||||
table.header-table {
|
||||
color: white;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.type-note {
|
||||
font-size: small;
|
||||
color: #DEDEDE;
|
||||
}
|
||||
|
||||
.xxsection-bar {
|
||||
background: #eee;
|
||||
color: #333;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.section-bar {
|
||||
color: #333;
|
||||
border-bottom: 1px solid #999;
|
||||
margin-left: -20px;
|
||||
}
|
||||
|
||||
|
||||
.section-title {
|
||||
background: #79a;
|
||||
color: #eee;
|
||||
padding: 3px;
|
||||
margin-top: 2em;
|
||||
margin-left: -30px;
|
||||
border: 1px solid #999;
|
||||
}
|
||||
|
||||
.top-aligned-row { vertical-align: top }
|
||||
.bottom-aligned-row { vertical-align: bottom }
|
||||
|
||||
/* --- Context section classes ----------------------- */
|
||||
|
||||
.context-row { }
|
||||
.context-item-name { font-family: monospace; font-weight: bold; color: black; }
|
||||
.context-item-value { font-size: small; color: #448; }
|
||||
.context-item-desc { color: #333; padding-left: 2em; }
|
||||
|
||||
/* --- Method classes -------------------------- */
|
||||
.method-detail {
|
||||
background: #efefef;
|
||||
padding: 0;
|
||||
margin-top: 0.5em;
|
||||
margin-bottom: 1em;
|
||||
border: 1px dotted #ccc;
|
||||
}
|
||||
.method-heading {
|
||||
color: black;
|
||||
background: #ccc;
|
||||
border-bottom: 1px solid #666;
|
||||
padding: 0.2em 0.5em 0 0.5em;
|
||||
}
|
||||
.method-signature { color: black; background: inherit; }
|
||||
.method-name { font-weight: bold; }
|
||||
.method-args { font-style: italic; }
|
||||
.method-description { padding: 0 0.5em 0 0.5em; }
|
||||
|
||||
/* --- Source code sections -------------------- */
|
||||
|
||||
a.source-toggle { font-size: 90%; }
|
||||
div.method-source-code {
|
||||
background: #262626;
|
||||
color: #ffdead;
|
||||
margin: 1em;
|
||||
padding: 0.5em;
|
||||
border: 1px dashed #999;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
div.method-source-code pre { color: #ffdead; overflow: hidden; }
|
||||
|
||||
/* --- Ruby keyword styles --------------------- */
|
||||
|
||||
.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
|
||||
|
||||
.ruby-constant { color: #7fffd4; background: transparent; }
|
||||
.ruby-keyword { color: #00ffff; background: transparent; }
|
||||
.ruby-ivar { color: #eedd82; background: transparent; }
|
||||
.ruby-operator { color: #00ffee; background: transparent; }
|
||||
.ruby-identifier { color: #ffdead; background: transparent; }
|
||||
.ruby-node { color: #ffa07a; background: transparent; }
|
||||
.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
|
||||
.ruby-regexp { color: #ffa07a; background: transparent; }
|
||||
.ruby-value { color: #7fffd4; background: transparent; }
|
Loading…
Reference in a new issue