Mercurial > repos > other > SevenLanguagesInSevenWeeks
changeset 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 | 38f4a671cfa4 |
children | 2b423d86da51 |
files | 1-Ruby/run.sh |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /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