module Cucumber::LanguageSupport::LanguageMethods

def add_hook(phase, hook)

def add_hook(phase, hook)
  hooks[phase.to_sym] << hook
  hook
end

def add_transform(transform)

def add_transform(transform)
  transforms.unshift transform
  transform
end

def after_configuration(cli_configuration)

def after_configuration(cli_configuration)
  configuration = Configuration.new(cli_configuration)
  hooks[:after_configuration].each do |hook|
    hook.invoke('AfterConfiguration', configuration)
  end
end

def available_step_definition(regexp_source, location)

def available_step_definition(regexp_source, location)
  available_step_definition_hash[StepDefinitionLight.new(regexp_source, location)] = nil
end

def available_step_definition_hash

def available_step_definition_hash
  @available_step_definition_hash ||= {}
end

def clear_hooks

def clear_hooks
  @hooks = nil
end

def execute_transforms(args)

def execute_transforms(args)
  args.map do |arg|
    matching_transform = transforms.detect {|transform| transform.match(arg) }
    matching_transform ? matching_transform.invoke(arg) : arg
  end
end

def hooks

def hooks
  @hooks ||= Hash.new{|h,k| h[k] = []}
end

def hooks_for(phase, scenario) #:nodoc:

:nodoc:
def hooks_for(phase, scenario) #:nodoc:
  hooks[phase.to_sym].select{|hook| scenario.accept_hook?(hook)}
end

def invoked_step_definition(regexp_source, location)

def invoked_step_definition(regexp_source, location)
  invoked_step_definition_hash[StepDefinitionLight.new(regexp_source, location)] = nil
end

def invoked_step_definition_hash

def invoked_step_definition_hash
  @invoked_step_definition_hash ||= {}
end

def transforms

def transforms
  @transforms ||= []
end

def unmatched_step_definitions

def unmatched_step_definitions
  available_step_definition_hash.keys - invoked_step_definition_hash.keys
end