global

def emit_deprecation_warning

def emit_deprecation_warning
  parent_name = formatter_class_name =~ /::[^:]+\Z/ ? $`.freeze : nil
  return if parent_name == 'Cucumber::Formatter'
  return if !config.out_stream # some unit tests don't set it
  config.out_stream.puts "WARNING: The formatter #{formatter.class.name} is using the deprecated formatter API which will be removed in v4.0 of Cucumber."
  config.out_stream.puts
end