dariusk/wordfilter — pull request #7 by mambocab (2014-11-09 18:35:26+00:00)
Title: fixes ruby behavior on added strings with capitals

The previous implementation didn't do any downcasing on the word list, so added words containing capital letters were never filtered for, so if you added the string `CLEAN`:

```ruby
Wordfilter::add_words(['CLEAN']);
```

then `Wordfilter::blacklisted?("this string was clean!")` would return false, because it contains `clean`, not `CLEAN`. The JavaScript implementation doesn't seem to have this problem, I think because of the behavior of `toLowerCase`.

This implementation downcases the contents of the blacklist lazily, just before it's consulted. In principle, I'm pretty sure that's the right way to do it, but I have no idea if this implementation is good Ruby -- it may belong in `init_first_time` or equivalent. Seems to work, though!