class DeprecationToolkit::Collector

def -(other)

def -(other)
  difference = deprecations.dup
  current = deprecations_without_stacktrace
  other = other.deprecations_without_stacktrace
  other.each do |deprecation|
    index = current.index(deprecation)
    if index
      current.delete_at(index)
      difference.delete_at(index)
    end
  end
  difference
end

def <=>(other)

def <=>(other)
  deprecations_without_stacktrace <=> other.deprecations_without_stacktrace
end

def active_support_deprecation_sub_params

def active_support_deprecation_sub_params
  [/ \(called from .*\)$/, ""]
end

def collect(message)

def collect(message)
  deprecations << message
end

def deprecations_without_stacktrace

def deprecations_without_stacktrace
  deprecations.map do |deprecation|
    deprecation
      .sub(*active_support_deprecation_sub_params)
      .sub(*gem_deprecate_sub_params)
  end
end

def flaky?

def flaky?
  size == 1 && deprecations.first["flaky"] == true
end

def gem_deprecate_sub_params

def gem_deprecate_sub_params
  [/NOTE: (.*is deprecated.*)\n.* called from.*:\d+\.\n/, "\\1"]
end

def initialize(deprecations)

def initialize(deprecations)
  self.deprecations = deprecations
end

def load(test)

def load(test)
  new(read(test))
end

def reset!

def reset!
  deprecations.clear
end