<commit_before>#!/bin/bash
# nodeGame install from sources script
# Copyright(c) 2015 <NAME>
# MIT Licensed

# Clone the main repo.
git clone https://github.com/nodeGame/nodegame.git
cd nodegame

# Install the dependencies.
npm install nodegame-client
npm install nodegame-server
npm install nodegame-window
npm install nodegame-widgets
npm install JSUS
npm install NDDB
npm install shelf.js
npm install descil-mturk
npm install nodegame-db
npm install nodegame-mongodb
npm install smoosh
npm install ya-csv
npm install commander
npm install docker

# Entering nodegame-server directory.
cd node_modules/nodegame-server
 
# Patching express connect.
patch node_modules/express/node_modules/connect/lib/middleware/static.js < \
  bin/ng.connect.static.js.patch
 
# Rebuild js files.
cd bin
node make build-client -a -o nodegame-full

# Install ultimatum game.
cd ../../..
git clone https://github.com/nodeGame/ultimatum games/ultimatum


# Execute the following commands to try out the ultimatum game.

# Start the ultimatum game:
# node start/ultimatum-server

# Open two browser tabs for two players at the address:
# http://localhost:8080/ultimatum/
# Open the admin console at:
# http://localhost:8080/ultimatum/monitor.htm
# See the wiki documentation to modify settings.
<commit_msg>Added version check to install.stable.sh<commit_after>#!/bin/bash
# nodeGame install from sources script
# Copyright(c) 2015 <NAME>
# MIT Licensed

# Check node.js version, must be higher than 0.8.
node_version=$(node --version)  # e.g. "v0.10.20"
node_version=${node_version#v}  # e.g. "0.10.20"
node_major=$(cut -d. -f1 <<< $node_version)
node_minor=$(cut -d. -f2 <<< $node_version)
if (( node_major <= 0 && node_minor < 10 ))
then
    echo "Found node.js version $node_version, but at least 0.10 required."
    exit 1
fi

# Clone the main repo.
git clone https://github.com/nodeGame/nodegame.git
cd nodegame

# Install the dependencies.
npm install nodegame-client
npm install nodegame-server
npm install nodegame-window
npm install nodegame-widgets
npm install JSUS
npm install NDDB
npm install shelf.js
npm install descil-mturk
npm install nodegame-db
npm install nodegame-mongodb
npm install smoosh
npm install ya-csv
npm install commander
npm install docker

# Entering nodegame-server directory.
cd node_modules/nodegame-server
 
# Patching express connect.
patch node_modules/express/node_modules/connect/lib/middleware/static.js < \
  bin/ng.connect.static.js.patch
 
# Rebuild js files.
cd bin
node make build-client -a -o nodegame-full

# Install ultimatum game.
cd ../../..
git clone https://github.com/nodeGame/ultimatum games/ultimatum


# Execute the following commands to try out the ultimatum game.

# Start the ultimatum game:
# node start/ultimatum-server

# Open two browser tabs for two players at the address:
# http://localhost:8080/ultimatum/
# Open the admin console at:
# http://localhost:8080/ultimatum/monitor.htm
# See the wiki documentation to modify settings.

{'fraction_non_alphanumeric': 0.09463087248322148, 'fraction_numerical': 0.015100671140939598, 'mean_word_length': 4.229824561403508, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '1509859', 'n_tokens_mistral': 1005, 'n_tokens_neox': 913, 'n_words': 316}