/jEdit/tags/jedit-4-1-pre4/bsh/commands/source.bsh
# · Unknown · 18 lines · 14 code · 4 blank · 0 comment · 0 complexity · b085bed985038e81023c6f4e3a8dba62 MD5 · raw file
- /**
- Read filename into the interpreter and evaluate it in the current
- namespace. Like the Bourne Shell "." command.
- */
- bsh.help.source = "usage: source( filename | URL )";
- Object source( String filename ) {
- return this.interpreter.source( filename, this.caller.namespace );
- }
- Object source( URL url ) {
- return this.interpreter.eval(
- new InputStreamReader(url.openStream()), this.caller.namespace,
- "URL: "+url.toString()
- );
- }