Writing Steps in JRuby

JRuby makes the Ruby language available to the JVM.

JRuby provides the extensions to Ruby that are required by JBehave to allow writing Steps classes directly in Ruby: method annotations and signatures.

The JRuby steps classes must provide method metadata specifying the java annotation and signature:

The JRuby classes must be compiled into Java bytecode.

The jrubyc executable supports the --javac option to generate Java sources:

The jruby-complete artifact contains the jrubyc script in the META-INF/jruby.home/bin directory.

If using Maven, the jruby-maven-plugin can do the same task more cleanly: