class ParallelTests::Gherkin::Listener

def all_tags(scenario)

Return a combination of tags declared on this scenario/outline and the feature it belongs to
def all_tags(scenario)
  (scenario.tags || []) + ((@feature && @feature.tags) || [])
end

def background(*args)

def background(*args)
  @background = 1
end

def eof(*args)

def eof(*args)
  @collect[@uri] += (@background_steps * @scenarios) + (@outline_steps * @examples)
  reset_counters!
end

def examples(*args)

def examples(*args)
  @examples += 1
end

def feature(feature)

def feature(feature)
  @feature = feature
end

def initialize

def initialize
  @steps, @uris = [], []
  @collect = {}
  reset_counters!
end

def method_missing(*args)

ignore lots of other possible callbacks ...
def method_missing(*args)
end

def reset_counters!

def reset_counters!
  @examples = @outline = @outline_steps = @background = @background_steps = @scenarios = 0
  @ignoring = nil
end

def scenario(scenario)

def scenario(scenario)
  @outline = @background = 0
  return if should_ignore(scenario)
  @scenarios += 1
end

def scenario_outline(outline)

def scenario_outline(outline)
  return if should_ignore(outline)
  @outline = 1
end

def should_ignore(scenario)

Set @ignoring if we should ignore this scenario/outline based on its tags
def should_ignore(scenario)
  @ignoring = @ignore_tag_pattern && all_tags(scenario).find{ |tag| @ignore_tag_pattern === tag.name }
end

def step(*args)

def step(*args)
  return if @ignoring
  if @background == 1
    @background_steps += 1
  elsif @outline > 0
    @outline_steps += 1
  else
    @collect[@uri] += 1
  end
end

def uri(path)

def uri(path)
  @uri = path
  @collect[@uri] = 0
end