More lenient parsing of blocked_ips.txt and spam_patterns.txt

This commit is contained in:
Rick Okin 2005-08-09 02:28:37 +00:00
parent 7ab0f052f3
commit 634bc67342

View file

@ -5,11 +5,15 @@ ActionController::Base.perform_caching = false
spam_patterns_filename = RAILS_ROOT + '/config/spam_patterns.txt'
if File.exists? spam_patterns_filename
SPAM_PATTERNS = File.readlines(spam_patterns_filename).select { |line| line != '' }.map {
|line| Regexp.new(line) }
SPAM_PATTERNS = File.readlines(spam_patterns_filename).delete_if { |line| line.strip.empty? }.map {
|line| Regexp.new(line.strip) }
end
blocked_ips_filename = RAILS_ROOT + '/config/blocked_ips.txt'
if File.exists? blocked_ips_filename
BLOCKED_IPS = File.readlines(blocked_ips_filename).select { |line| line != '' }
BLOCKED_IPS = File.readlines(blocked_ips_filename).delete_if { |line| line.strip.empty? }.map {
|line| line.strip }
end
require 'breakpoint'
breakpoint