<commit_before>ATTENTION: RingoJS was formerly known as Helma NG. We are currently in the
process of renaming to RingoJS, so please bear with us while occasional "Helma"
references keep popping up.


RingoJS
=======

RingoJS is a JavaScript runtime and web application framework written in Java.
RingoJS consists of several components that can be used together or alone:

  1) A compact JavaScript runtime environment based on Mozilla Rhino. It adds
     to Rhino a reloading module system that is compatible to the CommonJS
     Securable Module proposal.

  2) An interactive shell with support for autocompletion and history.

  3) A module library implemented in JavaScript, covering basic functionality
     such as extensions to the built-in objects, file I/O, logging,
     persistence, client and server side HTTP support and more.

For more information, check out the RingoJS homepage and wiki:

    http://ringojs.org/

Building RingoJS
================

RingoJS requires Java 1.5 and uses Apache Ant as its build environment. If you
have these installed, building RingoJS is straightforward:

  Check out RingoJS from Git:

      git clone git://github.com/ringo/ringojs.git

  Change to the ringojs directory and run ant to compile:

      ant jar

If this succeeds you should now have a file called run.jar and be ready to go.

JavaScript Runtime and Shell
============================

The Ringo JavaScript runtime is based on Mozilla Rhino and supports JavaScript
1.7 with partial support for JavaScript 1.8 features.

To run RingoJS, add the ringojs/bin directory to your PATH environment
variable:

    export PATH=$PATH:/path/to/ringojs/bin

To start a shell session, just run the helma command without any arguments:

    helma

To run a script simply pass it to helma on the command line:

    helma apps/demo/main.js

If you run a script that is contained in RingoJS' module path you can also use
the simpler abstract module name instead of the file name. For example, to run
the RingoJS test suite:

    helma test/all

To create a new web application, use the admin/create script. This will copy an
simple skeleton app to the location you define. You can pass the application
directory as command line argument, or the script will prompt you for it.

    helma admin/create [appdir]

Run helma with the -h or --help switch to get more information about available
command line options. For example, the -i or --interactive option allows you to
run an application and use the shell at the same time, which can be really
handy.

Module Path Setup
=================

RingoJS loads JavaScript resources using a module loader that is compliant with
the ServerJS Securable Modules proposal:

    https://wiki.mozilla.org/ServerJS/Modules/SecurableModules

RingoJS actually goes one step further and makes sure every module has its own
top level scope, so modules are fully isolated from each other, providing a
programming environment that resembles that of Python environment more than the
one of ordinary client-side JavaScript runtime.

RingoJS uses the concept of a module path to look up and load modules that is
similar to the PATH environment variable used to find executables on most
operating systems. By default, the module path consists of two entries:

    1. The application root, which is the parent directory of the command line
       script, or the current working directory if called without script
       argument.

    2. The system modules root, which corresponds to the modules directory in
       the RingoJS home directory.

RingoJS provides several ways to access and set the module path. The simplest
is to set the HELMA_MODULE_PATH environment variable, separating multiple
entries with ':' or whatever character is used to separate PATH entries on your
system:

     export HELMA_MODULE_PATH=../foo/lib:../my/lib

Alternatively, you can define the module path using the helma.modulepath Java
system property, and you can add entries to the module path using the
addRepository() method in the helma/system module.

Module and Resource Loading
===========================

RingoJS provides three functions with different semantics to load modules:

require(moduleName)

    The require function provides the functionality defined in the ServerJS
    Securable Modules proposal. It tries to locate a module in the module path,
    loads it and returns its exports object.

import(moduleName)

    The import function builds on top of require, additionally setting a
    property in the calling module scope whose name is the name of the loaded
    module and whose value is the loaded module's exports object.

include(moduleName)

    The include function builds on top of require, additionally copying all
    exported properties of the loaded module to the calling module scope.

export(propertyName[, ...])

    The export function provides an alternative method to the exports object to
    define exported properties in a module by passing the names of exported
    properties as arguments.

addToClasspath(pathName)

    This function adds a jar file or directory to the classpath. By default,
    all jar files in the RingoJS lib directory are included in the classpath.

getResource(pathName)

    This looks for a file with the given path name in the module path and
    returns a resource object. This can be used to load resources other than
    JavaScript files using the same lookup rules as the module loader.

Web Framework
=============<commit_msg>Reflect ServerJS to CommonJS renaming<commit_after>ATTENTION: RingoJS was formerly known as Helma NG. We are currently in the
process of renaming to RingoJS, so please bear with us while occasional "Helma"
references keep popping up.


RingoJS
=======

RingoJS is a JavaScript runtime and web application framework written in Java.
RingoJS consists of several components that can be used together or alone:

  1) A compact JavaScript runtime environment based on Mozilla Rhino. It adds
     to Rhino a reloading module system that is compatible to the CommonJS
     Securable Module proposal.

  2) An interactive shell with support for autocompletion and history.

  3) A module library implemented in JavaScript, covering basic functionality
     such as extensions to the built-in objects, file I/O, logging,
     persistence, client and server side HTTP support and more.

For more information, check out the RingoJS homepage and wiki:

    http://ringojs.org/

Building RingoJS
================

RingoJS requires Java 1.5 and uses Apache Ant as its build environment. If you
have these installed, building RingoJS is straightforward:

  Check out RingoJS from Git:

      git clone git://github.com/ringo/ringojs.git

  Change to the ringojs directory and run ant to compile:

      ant jar

If this succeeds you should now have a file called run.jar and be ready to go.

JavaScript Runtime and Shell
============================

The Ringo JavaScript runtime is based on Mozilla Rhino and supports JavaScript
1.7 with partial support for JavaScript 1.8 features.

To run RingoJS, add the ringojs/bin directory to your PATH environment
variable:

    export PATH=$PATH:/path/to/ringojs/bin

To start a shell session, just run the helma command without any arguments:

    helma

To run a script simply pass it to helma on the command line:

    helma apps/demo/main.js

If you run a script that is contained in RingoJS' module path you can also use
the simpler abstract module name instead of the file name. For example, to run
the RingoJS test suite:

    helma test/all

To create a new web application, use the admin/create script. This will copy an
simple skeleton app to the location you define. You can pass the application
directory as command line argument, or the script will prompt you for it.

    helma admin/create [appdir]

Run helma with the -h or --help switch to get more information about available
command line options. For example, the -i or --interactive option allows you to
run an application and use the shell at the same time, which can be really
handy.

Module Path Setup
=================

RingoJS loads JavaScript resources using a module loader that is compliant with
the CommonJS Modules 1.0 Specification:

    http://commonjs.org/specs/modules/1.0.html

RingoJS actually goes one step further and makes sure every module has its own
top level scope, so modules are fully isolated from each other, providing a
programming environment that resembles that of Python environment more than the
one of ordinary client-side JavaScript runtime.

RingoJS uses the concept of a module path to look up and load modules that is
similar to the PATH environment variable used to find executables on most
operating systems. By default, the module path consists of two entries:

    1. The application root, which is the parent directory of the command line
       script, or the current working directory if called without script
       argument.

    2. The system modules root, which corresponds to the modules directory in
       the RingoJS home directory.

RingoJS provides several ways to access and set the module path. The simplest
is to set the HELMA_MODULE_PATH environment variable, separating multiple
entries with ':' or whatever character is used to separate PATH entries on your
system:

     export HELMA_MODULE_PATH=../foo/lib:../my/lib

Alternatively, you can define the module path using the helma.modulepath Java
system property, and you can add entries to the module path using the
addRepository() method in the helma/system module.

Module and Resource Loading
===========================

RingoJS provides three functions with different semantics to load modules:

require(moduleName)

    The require function provides the functionality defined in the CommonJS
    Modules proposal. It tries to locate a module in the module path, loads it
    and returns its exports object.

import(moduleName)

    The import function builds on top of require, additionally setting a
    property in the calling module scope whose name is the name of the loaded
    module and whose value is the loaded module's exports object.

include(moduleName)

    The include function builds on top of require, additionally copying all
    exported properties of the loaded module to the calling module scope.

export(propertyName[, ...])

    The export function provides an alternative method to the exports object to
    define exported properties in a module by passing the names of exported
    properties as arguments.

addToClasspath(pathName)

    This function adds a jar file or directory to the classpath. By default,
    all jar files in the RingoJS lib directory are included in the classpath.

getResource(pathName)

    This looks for a file with the given path name in the module path and
    returns a resource object. This can be used to load resources other than
    JavaScript files using the same lookup rules as the module loader.

Web Framework
=============
{'fraction_non_alphanumeric': 0.05050413298210555, 'fraction_numerical': 0.0023617040603142883, 'mean_word_length': 3.954995499549955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2032864', 'n_tokens_mistral': 2706, 'n_tokens_neox': 2574, 'n_words': 1589}