# `CucumberGherkin`

`CucumberGherkin` allows you to parse Gherkin files to pickles (or tokens). These pickles can be used in a cucumber implementation.

The CucumberMessages library is used in almost every step of building the pickles and envelopes.

Testdata is used from the Cucumber repository.

# `parse_path`

Parse a single feature file and return a list of envelopes. You can provide the following opts in a list:

* :no_source
* :no_ast
* :no_pickles

## Examples

    iex> CucumberGherkin.parse_path("testdata/good/background.feature", [:no_ast, :no_pickles])
    [
      %CucumberMessages.Envelope{
        __uf__: [],
        message: {:source,
          %CucumberMessages.Source{
            # ...
        }}
      }
    ]

# `parse_paths`

Returns a list of envelopes. See `parse_path/2` for more information.

# `print_messages`

Rely on CucumberMessages printer to print the envelopes to the specified format. Currently only `:ndjson` is supported.

It is likely that Elixir projects won't directly use this as they can use the unformatted protobuf message version in Cucumber as well.

## Examples

    iex> CucumberGherkin.parse_path("testdata/good/background.feature", []) |> CucumberGherkin.print_messages(:ndjson) |> IO.puts
    {"source":{"data": .......... }}
    {"gherkinDocument":{"feature": ........... }}
    {"pickle":{ .......... }}
    {"pickle":{ .......... }}

# `tokenize`

Tokenizes a feature file. Normally you should not need this.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
