<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
        "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<refentry id="jruby">
    <refmeta>
        <refentrytitle>jruby</refentrytitle>
        <manvolnum>1</manvolnum>
    </refmeta>

    <refnamediv>
        <refname>jruby</refname>
        <refpurpose>jruby interpreter</refpurpose>
    </refnamediv>

    <refsynopsisdiv>
        <cmdsynopsis>
            <command>jruby</command>
            <arg>switches</arg>
            <arg>--</arg>
            <arg>programfile</arg>
            <arg>arguments</arg>
        </cmdsynopsis>
    </refsynopsisdiv>

    <refsect1>
        <title>Desription</title>
        <para>
            <productname>JRuby</productname> is a pure Java implementation of the Ruby
            programming language.
        </para>
    </refsect1>
    <refsect1>
        <title>Switches</title>
        <para>
            <variablelist>
                <varlistentry>
                    <term>-0
                        <varname>octal</varname>
                    </term>
                    <listitem>
                        <para>
                            Specify the record separator (<constant>\0</constant> if no argument is given)
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-a</term>
                    <listitem>
                        <para>
                            autosplit mode with
                            <varname>-n</varname>
                            or
                            <varname>-p</varname>
                            (splits <varname>$_</varname> into <varname>$F</varname>)
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-b</term>
                    <listitem>
                        <para>benchmark mode, times the script execution</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-c</term>
                    <listitem>
                        <para>
                            check syntax only
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-C
                        <varname>directory</varname>
                    </term>
                    <listitem>
                        <para>
                            <methodname>cd</methodname> to
                            <varname>directory</varname>
                            before executing your script
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-d</term>
                    <listitem>
                        <para>
                            set debugging flags (sets <varname>$DEBUG</varname> to true)
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-e
                        <varname>command</varname>
                    </term>
                    <listitem>
                        <para>
                            one line of script. Several <varname>-e</varname>'s are allowed. Omit
                            <varname>programfile</varname> in this case. To be sure that your shell
                            does not mangle the <varname>command</varname>, put it within double quotes.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-f<varname>pattern</varname></term>
                    <listitem>
                        <para><methodname>split()</methodname> pattern for autosplit (<varname>-a</varname>)</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-h</term>
                    <listitem>
                        <para>Show the command help</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-i<varname>extension</varname></term>
                    <listitem>
                        <para>edit <varname>ARGV</varname> files in place (make backup if extension supplied)</para>
                        <!-- TODO how to supply them? -->
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-I<varname>directory</varname></term>
                    <listitem>
                        <para>specify <varname>$LOAD_PATH</varname> directory (may be used more than once)</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-J<varname>java option</varname></term>
                    <listitem>
                        <para>
                            pass an option to the JVM (e.g. <varname>-J-Xmx512m</varname>). Use
                            <varname>--properties</varname> to list <application>JRuby</application> properties.
                            Run <command>java -help</command>
                            for a list of other Java options.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-K<varname>kcode</varname></term>
                    <listitem>
                        <para> specifies code-set (i.e. <varname>-Ku</varname> for Unicode,
                        <varname>-Ke</varname> for EUC and <varname>-Ks</varname> for SJIS)</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-l</term>
                    <listitem>
                        <para>enable line ending processing</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-n</term>
                    <listitem>
                        <para>assume <quote>while gets(); ... end</quote> loop around your script</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-p</term>
                    <listitem>
                        <para>assume loop like <varname>-n</varname> but print line also like <command>sed</command></para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-r<varname>library</varname></term>
                    <listitem>
                        <para>require the library, before executing your script</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-s</term>
                    <listitem>
                        <para>enable some switch parsing for switches after script name</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-S</term>
                    <listitem>
                        <para>look for the script in <filename>bin</filename> or using
                        <varname>PATH</varname> environment variable</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-T<varname>level</varname></term>
                    <listitem>
                        <para>turn on tainting checks</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-v</term>
                    <listitem><para>print version number, then turn on verbose mode</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term>-w</term>
                    <listitem>
                        <para>turn on warnings for your script</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-W<varname>level</varname></term>
                    <listitem>
                        <para>set warning level: 0=silence, 1=medium, 2=verbose(default)</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-X<varname>option</varname></term>
                    <listitem>
                        <para>enable extended option (omit <varname>option</varname> to list them)</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>-y</term>
                    <listitem>
                        <para>enable parsing debug output</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>--copyright</term>
                    <listitem>
                        <para>print the copyright notice and exit</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>--debug</term>
                    <listitem>
                        <para>sets the execution mode most suitable for debugger functionality</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>--help</term>
                    <listitem><para>shows the online help, listing all the command line options</para></listitem>
                </varlistentry>
                <varlistentry>
                    <term>--jdb</term>
                    <listitem>
                        <para>runs the <command>jruby</command> process under JDB</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>--properties</term>
                    <listitem>
                        <para> List all configuration Java properties (pass <varname>-J-Dproperty=value</varname>
                        to set them)</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>--sample</term>
                    <listitem>
                        <para>run with profiling using the JVM's sampling profiler</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>--client</term>
                    <listitem>
                        <para>use the non-optimizing "client" JVM (improves startup time; default)</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>--server</term>
                    <listitem>
                        <para>use the optimizing "server" JVM (improves performance, but takes longer to start)</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>--manage</term>
                    <listitem>
                        <para>
                            enable JMX management and monitoring of the VM and JRuby via
                            local process connections from tools like <command>jconsole</command>.
                            Process name is <classname>org.jruby.Main</classname>.
                            To enable remote connections via JMX
                            remoting, you need to pass additional parameters via <varname>-J</varname>.
                        </para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>--headless</term>
                    <listitem>
                        <para>do not launch a GUI window, no matter what. Corresponds to the
                        JVM option <varname>-Djava.awt.headless</varname></para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>--1.8</term>
                    <listitem>
                        <para>specify Ruby 1.8.x compatibility (default)</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>--1.9</term>
                    <listitem>
                        <para>specify Ruby 1.9.x compatibility (not yet fully done)</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>--bytecode</term>
                    <listitem>
                        <para>show the JVM bytecode produced by compiling specified code</para>
                    </listitem>
                </varlistentry>
                <varlistentry>
                    <term>--version</term>
                    <listitem>
                        <para>print the version</para>
                    </listitem>
                </varlistentry>
            </variablelist>
        </para>
    </refsect1>
    <refsect1>
        <title>See also</title>
        <para>
            <link>http://jruby.org</link>
        </para>
    </refsect1>
    <refsect1>
        <title>Author</title>
        <para><corpauthor>The JRuby team</corpauthor></para>
        <para>
            This manual page was written by
            <author><personname><firstname>Heiko</firstname><surname>Rupp</surname></personname></author>
        </para>
    </refsect1>
</refentry>
