ruby-web


Table of Contents

I. Installation
1. General Installation Considerations
2. Library Installation
3. Interpreter Installation
4. Windows Notes
Note about FastCGI
Windows Installer
Manual Installation Steps
Microsoft IIS
General considerations for all installations of ruby-web with IIS
Windows NT/200x/XP and IIS 4 or newer
Apache 1.3.x on Microsoft Windows
Installing as a CGI binary
Apache 2.0.x on Microsoft Windows
Installing as a CGI binary
5. Mac OS X Notes
6. Problems?
Other problems
Bug reports
II. Core Reference
7. Basics
8. Web Variables
9. Output Functions
10. Header Functions
11. Utility Functions
12. Configuration
III. Additional Libraries
13. Compatibility
14. Custom Templates
15. Testing Functions
IV. Credits
16. Source Code Credits
17. Manual Credits

List of Examples

4.1. ruby-web and Apache 1.3.x as CGI
4.2. ruby-web and Apache 2.0 as CGI

Installation

Chapter 1. General Installation Considerations

There are two ways to use ruby-web: as a replacement for cgi.rb, and as an extension to the Ruby interpreter. Installing ruby-web as a library is simple, and gives one access to the useful functions of ruby-web. There are a few additional features which can be provided at a higher level.

Dependencies

Both the library and interpreter installations of ruby-web depend on Ruby 1.8.x.

Scaling options include:

Library Features

  • Query parsing
  • Output and Header functions
  • Standard IO replacement
  • Compatibility with cgi.rb

Interpreter Features

All of the above, plus:

  • Web friendly reporting of all errors, including syntax errors
  • Dynamic web scripting with .rhtml documents, like php or coldfusion
  • Reduced boilerplate in scripts. Hello, World is just
    puts 'Hello, World'
  • (planned) Consistent scope for interpreter state between requests across different server environments

ruby-web source code and binary distributions can be found at http://rubyforge.org/frs/?group_id=873.

Finally, please note that these install instructions are a work in progress. Please report any problems at http://rubyforge.org/tracker/?group_id=873, so that we can solve your problem, and improve.

Chapter 2. Library Installation

The simplest way to install ruby-web is to install the gem:

% gem install ruby-web
     

Then, you can use ruby-web in your cgi programs:

#!/usr/bin/env ruby

require 'rubygems'
require_gem 'ruby-web'

Web::open do
  puts "Hello World"
end
			

Another way to install ruby-web as a library is to use the tar.gz distribution

% tar -xvzf ruby-web_x.x.x.tar.gz
% cd ruby-web_x.x.x
% ruby install.rb config
% ruby install.rb setup
% ruby install.rb install
       

Similar to above, you can now use ruby-web in your cgi programs:

#!/usr/bin/env ruby

require 'web'

Web::open do
  puts "Hello World"
end

Note: for compatibility with cgi.rb:

require "web/shim/cgi"

Note: this this does compile and install the ruby-web interpreter, but you are free to ignore it.

Note: these examples are compatible with FastCGI and mod_ruby. Configure your webserver, and in the case of fastcgi, install the fastcgi ruby libraries. Ruby-web will detect the server environment and run appropriately.

Chapter 3. Interpreter Installation

Download the latest ruby-web_x.x.x.tar.gz. Run the enclosed installer:

% cd ruby-web_x.x.x
% ruby install.rb config
% ruby install.rb setup
% ruby install.rb install

This will compile and install the ruby-web interpreter into the same directory as ruby. If you are running ruby-web as a cgi, all you need to do is swap ruby-web for ruby:

#!/usr/bin/ruby-web

puts 'Hello, World'

FastCGI

After configuring ruby-web as the interpreter, you need the library to run fastcgi.

You will still need to do the standard FastCGI config on your webserver. You can find a links to extensions for Apache and other web servers at http://www.fastcgi.com

Mod Ruby

To use the ruby-web interpreter with mod_ruby, there is a slightly different configuration for http.conf:

  <IfModule mod_ruby.c>
  RubySafeLevel 0
  # for Web::RubyRun
  RubyRequire web/sapi/apache

  <Location / >
      Options Indexes FollowSymLinks ExecCGI
      AddHandler ruby-object cgi rb rhtml
      RubyHandler Web::RubyRun.instance
  </Location>
  </IfModule>
  

Webrick

ruby-web provides a Web::RubyWebHandler, based on the CGIHandler, to run ruby-web scripts. You will need to add the Web::RubyWebHandler to webrick with a startup script like this, replacing :DocumentRoot with the appropriate value:

    #!/usr/local/bin/ruby
    $: << File.dirname($0)
    require 'webrick'
    require 'web/sapi/webrick'

    include WEBrick

		# These lines configure webrick to handle .rb and .rhtml files with ruby-web
    HTTPServlet::FileHandler.add_handler("rb", Web::RubyWebHandler)
    HTTPServlet::FileHandler.add_handler("rhtml", Web::RubyWebHandler)

    s = HTTPServer.new(:Port            => 80,
                       :DocumentRoot    => "./htdocs" )
    trap("INT"){ s.shutdown }
    s.start
 

Chapter 4. Windows Notes

Note about FastCGI

FastCGI is an great way to scale on Windows, but compiling the ruby fcgi bindings on ruby is difficult. There are various distributions of pre-compiled ruby fcgi bindings, but I do not know which ones to recommend.

Windows Installer

The Windows ruby-web installer is available from the downloads page at http://rubyforge.org/frs/?group_id=873. This installs ruby-web and for IIS, Apache 1.x, and Apache 2.x, it also configures the web server to run .rb and .rhtml scripts using the CGI version of ruby-web.

First, install your selected HTTP (web) server on your system, and make sure that it works.

The installation wizard gathers enough information to set up the ruby-web, and configure certain web servers to use ruby-web as a cgi.

Once the installation has completed, the installer will restart the server, and you should be ready to just start using ruby-web.

Manual Installation Steps

This install guide will help you manually install and configure ruby-web with a web server on Microsoft Windows. Although we distribute a ruby-web installer for Microsoft Windows, you might want to take to setup ruby-web yourself as this will provide you with a better understanding of the system.

To get started you'll need to download the tar.gz distribution from the downloads page at http://rubyforge.org/frs/?group_id=873. If you have not already done so, you will need to install the Ruby One Click installer in the directory of your choice. You may choose a different location but do not have spaces in the path (like C:\Program Files\Ruby) as some web servers will crash properly if you do.

Extract the archive (using a program like Winzip) . From the command line, execute these commands:

  ruby.exe install.rb config
  ruby.exe install.rb setup
  ruby.exe install.rb install
  

If you're using NTFS on Windows NT, 2000, XP or 2003, make sure that the user running the web server has read permissions to your ruby lib directories (e.g. make c:/ruby/bin and c:/ruby/lib readable by Everyone).

ruby-web is now setup on your system. The next step is to configure your webserver to run ruby-web.

Microsoft IIS

This section contains notes and hints specific to IIS (Microsoft Internet Information Server).

General considerations for all installations of ruby-web with IIS

  • First, read the Manual Installation Instructions. Do not skip this step as it provides crucial information for installing ruby-web on Windows.
  • The ruby-web CGI is named ruby-web.exe
  • The IIS user (usually IUSR_MACHINENAME) needs permission to read various files and directories, including c:/ruby/bin, c:/ruby/lib, docroot, and the session tmp directory.
  • When defining the executable, the 'check that file exists' box may also be checked. For a small performance penalty, the IIS (or PWS) will check that the script file exists and sort out authentication before firing up ruby-web.

Windows NT/200x/XP and IIS 4 or newer

You need to start the Microsoft Management Console (may appear as 'Internet Services Manager', either in your Windows NT 4.0 Option Pack branch or the Control Panel=>Administrative Tools under Windows 2000/XP). Then right click on your Web server node (this will most probably appear as 'Default Web Server'), and select 'Properties'.

If you want to install ruby-web as a CGI, do the following:

  • Under 'Home Directory', 'Virtual Directory', or 'Directory', do the following:
  • Change the Execute Permissions to 'Scripts only'
  • Click on the 'Configuration' button, and choose the Application Mappings tab. Click Add and set the Executable path to the ruby-web.exe file. An example value is: C:\ruby\bin\ruby-web.exe Supply .rb or .rhtml as the extension. Leave 'Method exclusions' blank, and check the 'Script engine' checkbox. Now, click OK a few times.
  • Set up the appropriate security. (This is done in Internet Service Manager), and if your NT Server uses NTFS file system, add execute rights for I_USR_ to the c:\ruby\bin and read rights for I_USR_ to the c:\ruby\lib directories.

In order to use index.rhtml as a default content page, do the following: From within the Documents tab, choose Add. Type in index.rhtml and click OK. Adjust the order by choosing Move Up or Move Down. This is similar to setting DirectoryIndex with Apache.

Apache 1.3.x on Microsoft Windows

This section contains notes and hints specific to Apache 1.3.x installs of ruby-web on Microsoft Windows systems. There are also instructions and notes for Apache 2 on a separate page.

Note

Please read the manual installation steps first!

After changing the configuration file, remember to restart the server, for example, NET STOP APACHE followed by NET START APACHE, if you run Apache as a Windows Service, or use your regular shortcuts.

Note

Remember that when adding path values in the Apache configuration files on Windows, all backslashes such as c:\directory\file.ext must be converted to forward slashes, as c:/directory/file.ext.

Installing as a CGI binary

If your ruby is installed in C:\ruby\ as described in the Manual Installation Steps section, you need to insert these lines to your Apache configuration file to set up the CGI binary:

Example 4.1. ruby-web and Apache 1.3.x as CGI


ScriptAlias /ruby/ "c:/ruby/bin"
AddType application/x-httpd-ruby .rb
Action application/x-httpd-rb "/ruby/ruby-web.exe"

       

Note that the second line in the list above can be found in the actual versions of httpd.conf, but it is commented out. Remember also to substitute the c:/ruby/ for your actual path to Ruby.

Apache 2.0.x on Microsoft Windows

This section contains notes and hints specific to Apache 2.0.x installs of ruby-web on Microsoft Windows systems. We also have instructions and notes for Apache 1.3.x users on a separate page.

Note

You should read the manual installation steps first!

You are highly encouraged to take a look at the Apache Documentation to get a basic understanding of the Apache 2.0.x Server. Also consider to read the Windows specific notes for Apache 2.0.x before reading on here.

Warning

Apache 2.0.x is designed to run on Windows NT 4.0, Windows 2000 or Windows XP. At this time, support for Windows 9x is incomplete. Apache 2.0.x is not expected to work on those platforms at this time.

Download the most recent version of Apache 2.0.x and a fitting ruby-web version. Follow the Manual Installation Steps and come back to go on with the integration of ruby-web and Apache.

Note

Remember that when adding path values in the Apache configuration files on Windows, all backslashes such as c:\directory\file.ext must be converted to forward slashes, as c:/directory/file.ext.

Installing as a CGI binary

You need to insert these three lines to your Apache httpd.conf configuration file to set up the CGI binary:

Example 4.2. ruby-web and Apache 2.0 as CGI


ScriptAlias /ruby/ "c:/ruby/bin"
AddType application/x-httpd-ruby .rb
Action application/x-httpd-ruby "/ruby/ruby-web.exe"

       

Chapter 5. Mac OS X Notes

The simplest way to install ruby-web is to use the installer found in the ruby-web.x.x.x-powerpc-darwin.dmg. This will install ruby-web and configure the default Apache with mod_ruby.

The installer has been tested on Mac OS X Tiger (10.4). Please let me know (install.help@hexane.org) if you have success or failure on other versions of Mac OS X.

If the installer does not work on your version of Mac OS X, use the unix instructions to install and configure ruby-web by hand.

Chapter 6. Problems?

Table of Contents

Other problems
Bug reports

Other problems

If you are still stuck, someone on the ruby-web mailing list may be able to help you. To subscribe to the ruby-web installation mailing list, submit the form athttp://lists.sourceforge.net/lists/listinfo/narf-lib-devel. The mailing list address is narf-devel@sourceforge.net.

If you want to get help on the mailing list, please try to be precise and give the necessary details about your environment (which operating system, what ruby-web version, what web server, if you are running ruby-web as CGI or a server module, safe mode, etc...), and preferably enough code to make others able to reproduce and test your problem.

Bug reports

If you think you have found a bug in ruby-web, please report it. The ruby-web developers probably don't know about it, and unless you report it, chances are it won't be fixed. You can report bugs using the bug-tracking system at http://rubyforge.org/tracker/?group_id=873. Please do not send bug reports in mailing list or personal letters. The bug system is also suitable to submit feature requests.

Core Reference

Chapter 7. Basics

Templates can be loaded using Web::load(filename). ruby-web loads .rb files as ruby, and assumes everything else is an erb template. Below is a short guide to erb templating:

<% ... %>
Evaluate ruby code.
<%= ... %>
Evaluate the enclosed ruby code and print the output.
<%%, %%>
Print out literal <%% or %%>.

The ruby-web interpreter will open a connection to the webserver and load the first command-line argument using Web::load. In a script, one can include additional files using Web::load.

In a ruby script, one can also open a Web::Connection using Web::open. This is not recommended, but is documented here for use in unsupported server environments.

Web::load( filename )
Given 'filename.ext' as filename, load using the handler Web::config[:load_suffix][:ext]. Returns value from handler.
Web::include( filename )
Loads filename, and returns output. Intended for use with Web::filter.
Web::connection
Return current Web::Connection.
Web::open(options)
Handle a web request. Use this method when running the ruby-web libraries outside of the ruby-web interpreter and outside of Web::load.
#!/usr/bin/ruby
require 'web'
Web::open do |connection|
  Web::write "Hello"
  cgi.write  "World"
end

Guide to options (defaults are in parenthesis):

:unbuffered
flag whether output should(n't) be buffered. (false)
:cgd
pass in a CGD driver
:out
set the output stream to the given IO ($stdout).
:raw_post_data
set the raw_post_data to the given IO ($stdin).
:request
pass in the request hash
:session
set the session to the given hash (Web::Session).
:env
pass in the ENV variables
:path_info
path_info is the part of the query that is after the script, i.e. the path_info.html in /script_name.rb/path_info.html (Web::env[:path_info])
:document_root
Document root of website. (Web::env[:document_root])
:script_name
Script name, ie /script_name.rb in /script_name.rb/path_info.html (Web::env[:script_name])

Chapter 8. Web Variables

Variables directly submitted by the client are parsed into hashes of { name => [ multiple, values ] } :

  • Web::get
  • Web::post
  • Web::cookie

These hashes are merged together into Web::request, which also is a hash of { name => [ multiple, values ] }. Web[param] is a convenience method to return single values.

File uploads are parsed into Web::Upload objects, with the following methods:

Web::Upload#content_type
The browser-submitted content-type of the upload.
Web::Upload#local_path
The path to the tempfile containing the upload.
Web::Upload#open { |f| ... }
Yields the tempfile IO object, with the pointer at the beginning of the file
Web::Upload#original_filename
The browser-submitted filename of the upload.
Web::Upload#read
Returns the contents of the upload
Web::Upload#save(some_path)
Saves the contents of the tempfile to some_path

Environment variables are copied into a case-insensitive, duck-typing hash (eg Web::env[:script_name])

Reference

Web[key]
Convenience method to access values within Web::request. If the key is array-style, aka 'param[]', the value is returned as an array. Otherwise, value is joined with "," and returned as a string. If Web::request[key] is an array of Web::Upload objects, then the first value of the array is returned.
Web[key] = value
Convenience method to set values within Web::request. If value is not an array, sets key to [value].
Web::cookie
Access cookies sent by the client.
Web::env
ENV variables, scoped to the request, returned in a case-insensitive hash
Web::get
Access parameters passed on the url.
Web::info
Display information about the execution enviroment to the client.
Web::key?(key)
Test whether Web::cookie, Web::get, or Web::post contain the given key.
Web::keys
Return set of the keys of Web::cookie, Web::get, and Web::post.
Web::local
A hash scoped to the current web connection. Similar to Request scope in the Java Servlet API.
Web::post
Access parameters submitted via a form posting.
Web::request
Convenience array. Combines Web::get, Web::post, and Web::cookie into one hash. If the same key is passed in Web::get and Web::post, Web::env['request_method'] is used to choose which takes priority.
Web::raw_post_data
An IO object containing the raw post data from the request.
Web::session
Session values.

Chapter 9. Output Functions

Web << output
Write output to the browser.
Web::clear
Reset output buffer. Fails if headers have been sent.
Web::close
Flushes the output and, if applicable, saves the session.
Web::flush
Send header to the client, and flush any buffered output
Web::puts(output)
Write output to the browser with line breaks.
Web::write(output)
Write output to the browser.
Web::send_file( filename )
This method will replace the contents of the output buffer with the content read from the given filename. If the Content-Type header has not already been set, it will guess an appropriate mime-type from the extension of the file.
Web::send_lib_file( relative_filename )
Using Web::send_file(filename), sends the contents of a file from the ruby lib to the client. Filename is relative to the file of Kernel::caller. This method is intended to help the distribution of web applications as normal ruby libraries.
# sends ".../ruby/site_lib/1.8/web/resources/logo.gif" to the client
Web::send_lib_file( 'resources/logo.gif' )
Web::unbuffered?
Returns whether output buffering is being used. By default, output is buffered.
Web::filter
Start an output buffer. aka Web::ob_start. Yields content for filtering before being written out:
Web::filter do |content|
  # ... filter  content   
end
Web::ob_flush
Flush (send) the output buffer
Web::ob_clean
Erase and discard contents of the output buffer
Web::ob_end_clean
Erase contents of output buffer, and discard the buffer itself
Web::ob_end_flush
Flush (send) the output buffer and discard the buffer itself
Web::ob_get_clean
Get current buffer contents and delete current output buffer
Web::ob_get_contents
Return the contents of the output buffer
Web::ob_get_flush
Flush the output buffer, return it as a string and turn off output buffering
Web::ob_get_length
Return the length of the output buffer
Web::ob_get_level
Return the nesting level of the output buffering mechanism
Web::ob_list_handlers
List all output handlers in use

Chapter 10. Header Functions

Web::charset / Web::charset=(new_charset)
Get / set charset.
Web::cookies_sent
Returns a hash of all the cookie name/value pairs that have been set on the server.
Web::content_type() / Web::content_type=(new_content_type)
Get / set content type. The default content-type is "text/html".
Web::encoding / Web::encoding=( new_encoding )
Get / set character encoding.a
Web::get_cookie(key)
Returns an array of cookie values that have been set. Path / Expires / etc. info is currently not returned. Note that this is different from the cookies that the browser submitted to the server.
Web::status / Web::status=(new_status)
Get / Set new status, as in:
Web::status = 200
Web::set_cookie( name, value, options={} )

Sends client a cookie with the given name and a value, and these optional keyword arguments:

:path
Path string
:domain
Domain string
:expires
Date this cookie should expire
:secure
Whether this cookie should be tagged as secure or not.
Web::set_redirect( new_location )
Sets the status and the location appropriately.

Chapter 11. Utility Functions

Web::escape(string)
URL-encode a string. (from cgi.rb)
url_encoded_string = Web::escape("'Stop!' said Fred")
  # => "%27Stop%21%27+said+Fred"
Web::escape_element(string, *elements)
Escape only the tags of certain HTML elements in string. Takes an element or elements or array of elements. Each element is specified by the name of the element, without angle brackets. This matches both the start and the end tag of that element. The attribute list of the open tag will also be escaped (for instance, the double-quotes surrounding attribute values). (from cgi.rb)
print Web::escape_element('<BR><A HREF="url"></A>', "A", "IMG")
  # "<BR>&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt;"
    
print Web::escape_element('<BR><A HREF="url"></A>', ["A", "IMG"])
  # "<BR>&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt;"
Web::escape_html(string)
Escape special characters in HTML, namely &\"<> (from cgi.rb)
Web::escape_html('Usage: foo "bar" <baz>')
  # => "Usage: foo &quot;bar&quot; &lt;baz&gt;"
Web::get_mime_type(filename)
Guess the mimetype for the filename from the file extension.
Web::lib_file_contents( filename )
Get the contents of a file in the ruby libraries. Filename is relative to Kernel::caller
template = Web::lib_file_contents('resources/template.html')
Web::lib_filename( resource )
This function is for apps that want to store resources with the source files in the ruby lib directories. Filename is relative to Kernel::caller
Web::lib_filename('resources/logo.gif')
  # => ".../ruby/site_lib/1.8/web/resources/logo.gif"
Web::rfc1123_date(time)
Make RFC1123 date string
Web::rfc1123_date(Time.now) # => Sat, 01 Jan 2000 00:00:00 GMT
Web::unescape(string)
URL-decode a string. (from cgi.rb)
string = Web::unescape("%27Stop%21%27+said+Fred")
       # => "'Stop!' said Fred"
Web::unescape_element(string, *elements)
Undo escaping such as that done by Web::escape_element. (from cgi.rb)
print Web::unescape_element(
         Web::escapeHTML('<BR><A HREF="url"></A>'), "A", "IMG")
  # "&lt;BR&gt;<A HREF="url"></A>"

print Web::unescape_element(
        Web::escapeHTML('<BR><A HREF="url"></A>'), ["A", "IMG"])
  # "&lt;BR&gt;<A HREF="url"></A>"
Web::unescape_html(string)
Unescape a string that has been HTML-escaped (from cgi.rb)
Web::unescape_html("Usage: foo &quot;bar&quot; &lt;baz&gt;")
  # => "Usage: foo \"bar\" <baz>"

Chapter 12. Configuration

Config directives are set using Web::config[:directive] = value. If desired, config directives can be set within 'site_lib/x.x/web/site-config.rb'.

Below is a list of available config directives:

:load_suffix

:load_suffix contains a hash of handlers for different file extensions. You can then control the behavior of Web::load:

Web::config[:load_suffix][:amrita] = lambda do |scriptname|
  #...handle amrita templates...
end

:load_suffix by default will load .rb and .erb files appropriately. Everything else is loaded using ruby-web's default templating.

:load_path
:load_path is an array of directories, searched by Web::load when it has been given a relative path to load.
:error_style
Controls how exceptions are handled. Valid values include :development, :production, or :custom. :development prints a full stacktrace, :production prints a more abbreviated message. :custom allows one to defined their own handler using Web::config[:error_handler]
:multipart_progress_hook
Allows one to pass a lambda that will be called as a multipart upload is read. The lambda is called with 2 arguments: the total number of bytes, and the number of bytes read so far. Probably only useful to AJAX implementations.

Additional Libraries

Chapter 13. Compatibility

ruby-web ships with the cgi.rb interface, adapted to use the ruby-web infrastructure.

require 'web/shim/cgi'
cgi = CGI.new
# ...

Chapter 14. Custom Templates

You can customize how ruby-web load templates:

require 'web/phprb'

Web::config['load_suffix']['rhtml'] = lambda do |scriptname|
  PHPRB::load(scriptname)
end
 
# or, if you really really love your templating language:
Web::config['load_suffix'].default = lambda do |scriptname|
  PHPRB::load(scriptname)
end

Web::load('template.rhtml') # <= will be processed by phprb

phprb is an experimental template parser derived from erb, but not as inspired by the systems invented by Sun and Microsoft. It has the following rules:

<? ... ?>
Evaluate ruby code.
<?= ... ?>
Evaluate the enclosed ruby code and print the output.
<!--- ... --->
Comment out the enclosed code.
<??, ??>
Print out literal <?? or ??>.

Chapter 15. Testing Functions

To access these functions, include Web::Testing in your testcase

require 'web/testing'
require 'web/unit/testcase'
class MyWebTest << Test::Unit::TestCase
  include Web::Testing
  #...
end
do_request( scriptname, params={} )

Do a mock request to scriptname, passing in params.

scriptname can be /absolute/scriptname.rb if you use set the docroot using Web::docroot = "...". Otherwise, use a relative path from the current directory.

params is a hash of request parameters. You can mock enviroment parameters on an :env key.

do_submit( formname, params={} )
Once you've done a request, you can submit forms on the page. You can "fill out" fields by passing in params.
assert_content(expected, message="")
fails if content is not set to the provided string.
assert_form_includes(formname, vars)
Assert output content contains a form that includes the given hash of values. ### this could sure use some more docs.
Web::get_content()
the body content of the response (sans headers)
assert_header( name, values, message="" )
Fails if the header has not been set to the provided value(s).
assert_cookie( name, values, message="" )
Fails if cookie values are not present.

Credits

Chapter 16. Source Code Credits

ruby-web is written by Patrick May and Tom Clarke, partly based on cgi.rb written by Wakou Aoyama. It makes significant use of ruby-htmltools, written by Ned Konz. Also, Keunwoo Lee patched Request.read_multipart to be cleaner.

ruby-web contains code from the following projects, and we are in their debt:

ruby-htmltools
This is a Ruby library for building trees representing HTML structure. http://bike-nomad.com/ruby
sgml-parser
The html-parser package is a variant language implementation of the Python's SGML parser (sgmllib.py), HTML parser (htmllib.py) and Formatter (formatter.py). http://www.jin.gr.jp/%7Enahi/Ruby/html-parser/README.html
webunit
WebUnit is Ruby API for testing html/cgi without browser, and is idealy suited for automated unit testing of web sites when combined with a Ruby unit test framework such as RubyUnit. It was designed and implemented by Masaki Suketa. http://www.xpenguin.biz/download/webunit/index-en.html

Chapter 17. Manual Credits

Much of the installation portion of the manual has been derived from the PHP manual. Below are the many contributers to this great resource.

Authors and Contributors

We highlight the currently most active people on the manual frontpage, but there are many more contributors who currently help in our work or provided a great amount of help to the project in the past. There are a lot of unnamed people who help out with their user notes on manual pages, which continually get included in the references, the work of whom we are also very thankful for. All the lists provided below are in alphabetical order.

Authors and Editors

The following contributors should be recognized for the impact they have made and/or continue to make by adding content to the manual: Jouni Ahto, Alexander Aulbach, Daniel Beckham, Stig Bakken, Jesus M. Castagnetto, Ron Chmara, Sean Coates, John Coggeshall, Simone Cortesi, Markus Fischer, Wez Furlong, Sara Golemon, Rui Hirokawa, Brad House, Moriyoshi Koizumi, Rasmus Lerdorf, Andrew Lindeman, Stanislav Malyshev, Rafael Martinez, Yasuo Ohgaki, Derick Rethans, Sander Roobol, Egon Schmid, Thomas Schoefbeck, Sascha Schumann, Dan Scott, Lars Torben Wilson, Jim Winstead, Jeroen van Wolffelaar and Andrei Zmievski.

The following contributors have done significant work editing the manual: Stig Bakken, Hartmut Holzgraefe and Egon Schmid.

User Note Maintainers

The currently most active maintainers are: Mehdi Achour, Friedhelm Betz, Vincent Gevers, Aidan Lister, Nuno Lopes and Tom Sommer.

These people have also put a lot of effort into managing user notes: Daniel Beckham, Victor Boivie, Jesus M. Castagnetto, Nicolas Chaillan, Ron Chmara, James Cox, Sara Golemon, Zak Greant, Szabolcs Heilig, Oliver Hinckel, Hartmut Holzgraefe, Rasmus Lerdorf, Andrew Lindeman, Maxim Maletsky, James Moore, Sebastian Picklum, Derick Rethans, Sander Roobol, Damien Seguy, Jason Sheets, Jani Taskinen, Yasuo Ohgaki, Philip Olson, Lars Torben Wilson, Jim Winstead, Jared Wyles and Jeroen van Wolffelaar.