# HG changeset patch # User IBBoard # Date 1483389364 0 # Node ID 9f14e665fd1b70cf808acd174bb2774d0383af89 # Parent 38f4a671cfa443dfb57db6dd925dfa991080f3f4 Add runner script to run through ruby and irb and log output in a consistent way diff -r 38f4a671cfa4 -r 9f14e665fd1b 1-Ruby/run.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/1-Ruby/run.sh Mon Jan 02 20:36:04 2017 +0000 @@ -0,0 +1,12 @@ +#! /bin/bash + +if [[ $# -ne 1 ]]; then + echo "Need to supply file to run" >2 + exit 1 +elif [[ ! -f $1 ]]; then + echo "Need to supply file to run" >2 + exit 1 +fi + +ruby "$1" > "${1/.rb}"-ruby.output 2>&1 +irb "$1" > "${1/.rb}"-irb.output 2>&1 \ No newline at end of file