lib/boojs.rb in boojs-0.0.7 vs lib/boojs.rb in boojs-0.0.9
- old
+ new
@@ -45,19 +45,16 @@
system.stderr.writeLine(t.file + ': line ' + t.line );
})
system.stderr.writeLine("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
phantom.exit(1);
}
-
- while (true) {
- var line = system.stdin.readLine();
- eval(line);
- }
}
+
+ #Any code the user wanted
+ js += "\n#{str}" if str
- if str
- js += "\n#{str}"
- end
+ #Repl
+ js += "\nwhile (true) { var line = system.stdin.readLine(); eval(line); }"
phantom = Phantomjs.path
tmp = Tempfile.new(SecureRandom.hex)
tmp.puts js
tmp.close