class RSpec::Core::Formatters::Loader

def add(formatter_to_use, *paths)

Other tags:
    Private: -
def add(formatter_to_use, *paths)
  formatter_class = find_formatter(formatter_to_use)
  args = paths.map { |p| p.respond_to?(:puts) ? p : file_at(p) }
  if !Loader.formatters[formatter_class].nil?
    formatter = formatter_class.new(*args)
    register formatter, notifications_for(formatter_class)
  elsif defined?(RSpec::LegacyFormatters)
    formatter = RSpec::LegacyFormatters.load_formatter formatter_class, *args
    register formatter, formatter.notifications
  else
    call_site = "Formatter added at: #{::RSpec::CallerFilter.first_non_rspec_line}"
    RSpec.warn_deprecation <<-WARNING.gsub(/\s*\|/, ' ')
      |The #{formatter_class} formatter uses the deprecated formatter
      |interface not supported directly by RSpec 3.
      |
      |To continue to use this formatter you must install the
      |`rspec-legacy_formatters` gem, which provides support
      |for legacy formatters or upgrade the formatter to a
      |compatible version.
      |
      |#{call_site}
    WARNING
  end
end