Permalink
Browse files

Add --debug to bin/rubyscript

  • Loading branch information...
1 parent 299f7c6 commit 23f4ddb3bbbf793e20e66b572483f6acdbd26503 @judofyr committed Jul 31, 2011
Showing with 9 additions and 3 deletions.
  1. +0 −1 README.md
  2. +9 −2 bin/rubyscript
View
@@ -19,7 +19,6 @@ Then run:
$ cat test.rb
p 123
$ bin/rubyscript test.rb
- (The compiled JavaScript is printed and evaluated)
123
View
@@ -21,8 +21,15 @@ c.child.on('error', function() {
c.child.on('ready', function() {
try {
- var code = c.compileFile(process.argv[2]);
- console.log(code);
+ var file = process.argv[2];
+
+ if (file == "--debug") {
+ var debug = true;
+ file = process.argv[3];
+ }
+
+ var code = c.compileFile(file);
+ if (debug) console.log(code);
runner.eval(code);
} finally {
c.child.kill();

0 comments on commit 23f4ddb

Please sign in to comment.