Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Downloads

vikramverma edited this page May 14, 2011 · 9 revisions

There are several different builds of Gherkin, for various platforms.

Ruby gems

gem install gherkin

Since the gherkin gem contains native code it is packaged for several different Ruby platforms:

Gem extension Ruby interpreter Explanation
(none) MRI on a POSIX system Contains C source code for the lexer. Gets compiled during gem install
java JRuby Contains gherkin.jar, which is a pure Java lexer
i386-mingw32 MRI (new) on Windows Contains precompiled C lexer
i386-mswin32 MRI (old) on Windows Contains precompiled C lexer
universal-dotnet IronRuby Contains IKVM build of gherkin.jar

When you run gem install gherkin (or if you install another gem, like cucumber that depends on the gherkin gem) you should get the appropriate version for your Ruby interpreter.

See all the gems at Gemcutter.

Pure Java Jar

You can download the gherkin jar from the Cucumber Maven Repo

If you’re using Maven, just add the repo:

<repositories>
  <repository>
    <id>cukes</id>
    <url>http://cukes.info/maven</url>
  </repository>
</repositories>

-and the dependency:

<dependency>
  <groupId>gherkin</groupId>
  <artifactId>gherkin</artifactId>
  <version>1.0.5</version> <!-- Or some other version -->
</dependency>

The jar file can also be run as an executable. See .NET exe below. (Just replace gherkin.exe with java -jar gherkin.jar). For the curious, look at Main.java – it demonstrates pretty much everything you need to know about how to use the Gherkin API.

.NET dll

The .NET dll can be downloaded right here at Github, from the download section. The dll file is built from the pure java gherkin.jar with ikvmc. In order to use the dll you will also need IKVM.OpenJDK.Core.dll, IKVM.OpenJDK.Text.dll and IKVM.Runtime.dll from IKVM.

You can see an example of how this dll is used from .NET in this example.

The exe file produced from this example is not released, but there is another exe file that is just a pure ikvmc build of the jar – in exe mode.

.NET exe

The same jar file that is the basis of the dll is also built as a .NET exe file. (This is possible since the jar file has a main class). You can try it out like this:

gherkin.exe features

or a single file

gherkin.exe features/my_feature.feature

Both of the above will parse feature files and print a dot for every step. Not very useful, except for benchmarking, checking the validity of .feature files and verifying that the ikvmc build actually works. There is nothing else going on than parsing and printing.

If you want to pretty print the feature files instead of just dots, pass a second (arbitrary) argument – e.g.

gherkin.exe features/my_feature.feature prettyplease
Clone this wiki locally