Created
August 23, 2011 03:02
-
-
Save rramsden/1164238 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onLoad() { | |
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); | |
try { | |
crafty = executeScript(getClass().getResourceAsStream( "/crafty/core.clj" ), "/crafty/core.clj"); | |
} catch (Exception e) { | |
System.out.println(e.getMessage()); | |
} | |
protected Object executeScript(InputStream ins, String path) { | |
int slash = path.lastIndexOf('/'); | |
String file = slash >= 0 ? path.substring(slash + 1) : path; | |
try { | |
return Compiler.load(new InputStreamReader(ins), path, file); | |
} catch (Exception e) { | |
System.out.println(e.getMessage()); | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment