<commit_before>Quick Start
===========

GeoScript JS is packaged for the Narwhal_ platform.

Getting Narwhal
---------------

You can get Narwhal by downloading and extracting a zip archive, or cloning the
repository from http://github.com.

Download the `zip archive <http://github.com/tlrobinson/narwhal/zipball/master>`_ and extract it somewhere on your system (I'll assume your home directory here).

*or*

Clone the repository::

    ~$ git clone git://github.com/tlrobinson/narwhal.git

Now put the `narwhal` executable on your PATH::

    ~$ export PATH=$PATH:~/narwhal/bin

With this, you should be able to confirm that Narwhal is working. Open a
JavaScript console to test this::

    ~$ narwhal

You should be able to execute JavaScript statements here. When you are convinced
things work, ``quit()``. If things don't work, see the Narwhal_ site for more
details.


Getting GeoScript JS
--------------------

The GeoScript JS source is also hosted on http://github.com. As above, you can
get the source by downloading the zip archive or cloning the repository.

Download the `zip archive <http://github.com/tschaub/geoscript/zipball/master>`_ and extract it somewhere on your system (I'll assume you extract it to your home directory).

*or*

Clone the repository::

    ~$ git clone git://github.com/tschaub/geoscript.git


.. _Narwhal: http://narwhaljs.org


Running GeoScript JS
--------------------

After getting the package source, you can open the JavaScript console and import
any of the GeoScript modules. First, you need to activate your environment so
Narwhal knows how to load the modules::

    ~$ cd geoscript
    ~/geoscript$ bin/sea

Now open a JavaScript console and experiment with GeoScript:

.. code-block:: javascript

    ~/geoscript$ js
    Rhino 1.7 release 3 PRERELEASE 2009 04 05
    js> var geom = require('geoscript/geom');
    js> var p1 = new geom.Point([0, 0])
    js> var p2 = new geom.Point([10, 20])
    js> p1.distance(p2)
    22.360679774997898
    js> var poly = p2.buffer(23)
    js> poly.contains(p1)
    true

Running Tests
-------------

After activating your environment (``bin/sea``), you can run all tests with the
following::

    ~/geoscript$ js tests/all.js
<commit_msg>Updating URL for narwhal.<commit_after>Quick Start
===========

GeoScript JS is packaged for the Narwhal_ platform.

Getting Narwhal
---------------

You can get Narwhal by downloading and extracting a zip archive, or cloning the
repository from http://github.com.

Download the `zip archive <http://github.com/280north/narwhal/zipball/master>`_ 
and extract it somewhere on your system (I'll assume your home directory here).

*or*

Clone the repository::

    ~$ git clone git://github.com/280north/narwhal.git

Now put the `narwhal` executable on your PATH::

    ~$ export PATH=$PATH:~/narwhal/bin

With this, you should be able to confirm that Narwhal is working. Open a
JavaScript console to test this::

    ~$ narwhal

You should be able to execute JavaScript statements here. When you are convinced
things work, ``quit()``. If things don't work, see the Narwhal_ site for more
details.


Getting GeoScript JS
--------------------

The GeoScript JS source is also hosted on http://github.com. As above, you can
get the source by downloading the zip archive or cloning the repository.

Download the `zip archive <http://github.com/tschaub/geoscript/zipball/master>`_ 
and extract it somewhere on your system (I'll assume you extract it to your home 
directory).

*or*

Clone the repository::

    ~$ git clone git://github.com/tschaub/geoscript.git


.. _Narwhal: http://narwhaljs.org


Running GeoScript JS
--------------------

After getting the package source, you can open the JavaScript console and import
any of the GeoScript modules. First, you need to activate your environment so
Narwhal knows how to load the modules::

    ~$ cd geoscript
    ~/geoscript$ bin/sea

Now open a JavaScript console and experiment with GeoScript:

.. code-block:: javascript

    ~/geoscript$ js
    Rhino 1.7 release 3 PRERELEASE 2009 04 05
    js> var geom = require('geoscript/geom');
    js> var p1 = new geom.Point([0, 0])
    js> var p2 = new geom.Point([10, 20])
    js> p1.distance(p2)
    22.360679774997898
    js> var poly = p2.buffer(23)
    js> poly.contains(p1)
    true
    js> quit()

Running Tests
-------------

After activating your environment (``bin/sea``), you can run all tests with the
following::

    ~/geoscript$ js tests/all.js

{'fraction_non_alphanumeric': 0.11919642857142858, 'fraction_numerical': 0.020089285714285716, 'mean_word_length': 3.2114661654135337, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7186660', 'n_tokens_mistral': 1455, 'n_tokens_neox': 1308, 'n_words': 553}