Mercurial > repos > other > SevenLanguagesInSevenWeeks
annotate 1-Ruby/run.sh @ 16:8d46064c9afc
Be a nice Ruby user and follow block convention for do/end vs {}
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Tue, 03 Jan 2017 20:38:45 +0000 |
parents | 9f14e665fd1b |
children |
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 |