= trinidad

Trinidad allows you to run a rails or rackup applications within an embedded Apache Tomcat container.

* Mail list: http://groups.google.com/group/rails-trinidad
* Bug tracker: http://github.com/calavera/trinidad/issues
* Irc channel on Freenode: #trinidad

== INSTALL:

  jgem install trinidad

== USAGE:

Rails applications:

    $ cd myrailsapp
    $ jruby -S trinidad

Rack applications:

    $ cd myrackapplication

    $ jruby -S trinidad -r path_to_rackup/rackup_file

    or if the name of the file is config.ru

    $ jruby -S trinidad -r path_to_rackup

    or if config.ru is in the base directory

    $ jruby -S trinidad -r

    or if config.ru is under the directory WEB-INF

    $ jruby -S trinidad

== CONFIGURATION:

Trinidad allows you to configure some parameters when the server is started from the command line, the following is a list of the currently supported options:

  * -p, --port PORT             =>  port to bind to.
  * -e, --env ENVIRONMENT       =>  rails environment.
  * -c, --context CONTEXT       =>  application context path.
  * --lib, --jars LIBS_DIR      =>  directory containing jars.
  * --classes CLASSES_DIR       =>  directory containing classes.
  * -r, --rackup [RACKUP_FILE]  =>  run a provided rackup file instead of a rails application, by default it's config.ru.
  * --public PUBLIC_DIR         =>  specify the public directory for your application, by default it's 'public'.
  * -t, --threadsafe            =>  shortcut to work in threadsafe mode. Setting jruby_min_runtimes and jruby_max_runtimes to 1 in the configuration file the server behaves as the same way.
  * -l, --load EXTENSION_NAME   =>  load an extension to use its command line options.
  * --address HOST              =>  set the server host.
  * -g, --log LEVEL             =>  set the log level, default INFO.
  * --apps APPS_BASE_DIRECTORY  =>  set the applications base directory.

The server can also be configured from a yaml file. By default, if a file is not especified, the server tries to load the file <em>config/trinidad.yml</em>. Within this file you can add other options like jruby.min.runtimes(:jruby_min_runtimes) or jruby.max.runtimes(:jruby_max_runtimes).

  jruby -S trinidad --config my_custom_configuration.yml

You can also specify a default web.xml to config your web application. By default the server tries to load the file <em>config/web.xml</em> but you can modify this path adding the option <em>default_web_xml</em> within your configuration file. 

Other advanced options can be found in the wiki: http://wiki.github.com/calavera/trinidad/advanced-configuration

== HOT DEPLOYMENT:

Although the early versions of Trinidad used an extension to let deploy applications monitorizing a file, since Trinidad 1.1.0 this feature is
integrated into the core. When the file `tmp/restart.txt` is modified, the server reloads the application that the file belongs. This file can be
modified with the option `:monitor`.

== EXTENSIONS:

From the version 0.8.0 Trinidad allows to extend the server with more Tomcat features, here there is a list with the current available extensions:

* Database connection pooling: http://github.com/calavera/trinidad-dbpool
* Daemons:
    ** Daemon based on Akuma (ala GF gem): http://github.com/calavera/trinidad_daemon_extension
    ** Daemon based on Apache Commons Daemon (supports Unix and Windows systems): http://github.com/calavera/trinidad_daemon
* Hot deploy, do hot deploys monitorizing a temporal file, ala Passenger: http://github.com/calavera/trinidad_hotdeploy_extension
* Sandbox, management console and REST api: http://github.com/calavera/trinidad_sandbox_extension
* Logging, enhance the Trinidad's logging system: http://github.com/calavera/trinidad_logging_extension
* Lifecycle, application and server lifecycle management: http://github.com/calavera/trinidad_lifecycle_extension

You can find further information on how to write your own extension in the wiki: http://wiki.github.com/calavera/trinidad/extensions

== Copyright

Copyright (c) 2011 David Calavera<calavera@apache.org>. See LICENSE for details.