names_manager.rb 478 Bytes
Newer Older
1 2
require 'set'

3
module NamesManager
4 5 6
  extend HardCodedAuthors
  extend FalsePositives
  extend CanonicalNames
7

Xavier Noria's avatar
Xavier Noria committed
8
  # Determines whether any heuristic has been updated since +ts+.
9 10 11
  def self.updated_since?(ts)
    [__FILE__, *Dir.glob("#{__dir__}/names_manager/*.rb")].any? do |filename|
      File.mtime(filename) > ts
Xavier Noria's avatar
Xavier Noria committed
12
    end
13 14
  end

15 16 17 18
  # Removes email addresses (anything between <...>), and strips whitespace.
  def self.sanitize(name)
    name.sub(/<[^>]+>/, '').strip
  end
19
end