Skip to content

Commit

Permalink
Ditched rescue nil in favor of something a bit more explicit. [#9 sta…
Browse files Browse the repository at this point in the history
…tus:resolved]
  • Loading branch information
adambair committed Jun 29, 2008
1 parent f1cdf29 commit 1f45119
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/profanity_filter.rb
Expand Up @@ -34,7 +34,8 @@ class Base
DICTIONARY = YAML.load_file(File.join(File.dirname(__FILE__), '../config/dictionary.yml'))

def self.clean(text, replace_method = '')
text.split(/(\W)/).collect{|word| replace_method == 'dictionary' ? clean_word_dictionary(word) : clean_word_basic(word)}.join rescue nil
return text if text.blank?
text.split(/(\W)/).collect{|word| replace_method == 'dictionary' ? clean_word_dictionary(word) : clean_word_basic(word)}.join
end

def self.clean_word_dictionary(word)
Expand Down

0 comments on commit 1f45119

Please sign in to comment.