Преглед изворни кода

ignore empty filter tokens

Andrew Cantino пре 12 година
родитељ
комит
fead62f41d
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      bin/twitter_stream.rb

+ 1 - 1
bin/twitter_stream.rb

@@ -70,7 +70,7 @@ def load_and_run(agents)
         recent_tweets.shift if recent_tweets.length > DUPLICATE_DETECTION_LENGTH
         puts status["text"]
         filter_to_agent_map.keys.each do |filter|
-          if filter.downcase.split(SEPARATOR) - status["text"].downcase.split(SEPARATOR) == [] # Hacky McHackerson
+          if (filter.downcase.split(SEPARATOR) - status["text"].downcase.split(SEPARATOR)).reject(&:empty) == [] # Hacky McHackerson
             filter_to_agent_map[filter].each do |agent|
               puts " -> #{agent.name}"
               agent.process_tweet(filter, status)