Created
October 22, 2009 15:45
-
-
Save enebo/216027 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
package my.example; | |
import java.util.Arrays; | |
import java.util.List; | |
import org.jruby.embed.AttributeName; | |
import org.jruby.embed.PathType; | |
import org.jruby.embed.ScriptingContainer; | |
public class Main { | |
public static void main(String[] args) { | |
ScriptingContainer container = new ScriptingContainer(); | |
container.getProvider().setLoadPaths(Arrays.asList("lib")); | |
container.setAttribute(AttributeName.BASE_DIR, System.getProperty("user.dir")); | |
container.runScriptlet(PathType.RELATIVE, "load_git.rb"); | |
//... | |
List<GitDiff> list = (List<GitDiff>) container.runScriptlet("last_patch"); | |
for (GitDiff diff : list) { | |
System.out.println("PATH: " + diff.getPath()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment