cucumber/gherkin — pull request #275 by SierraGolf (2013-09-21 12:13:31+00:00)
Title: extension of the Formatter interface for more precise lifecycle handling

The idea is to provide to new methods that get called at the beginning and at the end of the scenario lifecycle.

Beginning is defined through: before the first "before" hook.
End is defined through: after the last "after" hook.

The current implementations have been provided with stub implementations, which could be filled with logic to solve existing bugs like [#476](https://github.com/cucumber/cucumber-jvm/issues/476) and [#570](https://github.com/cucumber/cucumber-jvm/issues/570).

The new ```Formatter``` methods will be called from within the ```CucumberScenario.run(Formatter, Reporter, Runtime) ``` method like this:

```java
@Override
public void run(Formatter formatter, Reporter reporter, Runtime runtime) {
Set tags = tagsAndInheritedTags();
runtime.buildBackendWorlds(reporter, tags);
formatter.startOfScenarioLifeCycle();
runtime.runBeforeHooks(reporter, tags);

runBackground(formatter, reporter, runtime);
format(formatter);
runSteps(reporter, runtime);

runtime.runAfterHooks(reporter, tags);
formatter.endOfScenarioLifeCycle();
runtime.disposeBackendWorlds();
}
```

The pull request for the cucumber-jvm project, which will follow, will also include stub implementations.