-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
57 lines (31 loc) · 1.38 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
mogwai is a library that helps you write custom, user-defined Gremlin steps in
Jython or any JVM language.
A Jython example is provided.
To try the example, download the latest Jython
(http://www.jython.org/downloads.html) and copy it to
$ cp jython2.5.2/jython.jar gremlin/target/gremlin-*-standalone/lib/jython.jar
You need modify your environment so that you can run Gremlin scripts from any
directory.
Add these lines to your .bash_profile:
export CLASSPATH=$CLASSPATH:/home/james/projects/mogwai;
export JYTHONPATH=$JYTHONPATH:/home/james/projects/mogwai;
alias jython="/home/james/jython2.5.2/bin/jython"
alias gremlin="/home/james/gremlin/gremlin.sh"
$ source .bash_profile
And you need updated gremlin.sh scripts that will enable you to run gremlin.sh
from any directory while not overriding your CLASSPATH.
Copy the updated scripts to your Gremlin directory:
$ cp mogwai/scripts/gremlin.sh /home/james/gremlin/gremlin.sh
$ cp mogwai/scripts/gremlin.sh.2 /home/james/gremlin/target/gremlin-*-standalone/bin/gremlin.sh
Compile the Java factory and interface:
$ javac mogwai/factories/JythonFactory.java
$ javac mogwai/interfaces/GizmoType.java
Once that's done, run the example Groovy script:
$ gremlin -e mogwai/examples/gizmo.groovy
Gizmo
Gremlin steps...
Gizmo
25
marko
If you see the marko, then success -- it works.
- James Thornton, http://jamesthornton.com