annotate 1-Ruby/run.sh @ 4:9f14e665fd1b

Add runner script to run through ruby and irb and log output in a consistent way
author IBBoard <dev@ibboard.co.uk>
date Mon, 02 Jan 2017 20:36:04 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
9f14e665fd1b Add runner script to run through ruby and irb and log output in a consistent way
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 #! /bin/bash
9f14e665fd1b Add runner script to run through ruby and irb and log output in a consistent way
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2
9f14e665fd1b Add runner script to run through ruby and irb and log output in a consistent way
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 if [[ $# -ne 1 ]]; then
9f14e665fd1b Add runner script to run through ruby and irb and log output in a consistent way
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4 echo "Need to supply file to run" >2
9f14e665fd1b Add runner script to run through ruby and irb and log output in a consistent way
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 exit 1
9f14e665fd1b Add runner script to run through ruby and irb and log output in a consistent way
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 elif [[ ! -f $1 ]]; then
9f14e665fd1b Add runner script to run through ruby and irb and log output in a consistent way
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 echo "Need to supply file to run" >2
9f14e665fd1b Add runner script to run through ruby and irb and log output in a consistent way
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 exit 1
9f14e665fd1b Add runner script to run through ruby and irb and log output in a consistent way
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 fi
9f14e665fd1b Add runner script to run through ruby and irb and log output in a consistent way
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10
9f14e665fd1b Add runner script to run through ruby and irb and log output in a consistent way
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 ruby "$1" > "${1/.rb}"-ruby.output 2>&1
9f14e665fd1b Add runner script to run through ruby and irb and log output in a consistent way
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 irb "$1" > "${1/.rb}"-irb.output 2>&1