def self.load_blacklist(filename = nil)
if filename == nil
CONFIG_PATHS.each do |path|
testname = File.join(path, 'blacklist.refcop')
if File.exist?(testname)
@options.blacklist = testname
break
end
end
if @options.blacklist == nil
abort('Error: Blacklist file not found.')
end
end
$stderr.puts "Using blacklist #{@options.blacklist}" if $VERBOSE
blacklist = Array.new
IO.foreach(@options.blacklist) do |line|
line.sub!(/#.*/, '')
line.strip!
next if line.empty?
blacklist << Regexp.new(@options.prefix + line + @options.suffix,
Regexp::IGNORECASE)
end
$stderr.puts "Compiled #{blacklist.length} blacklist patterns" if $VERBOSE
return blacklist
end