lib/tweet_watch/config.rb in tweet_watch-0.2.1.pre vs lib/tweet_watch/config.rb in tweet_watch-0.2.2.pre
- old
+ new
@@ -27,14 +27,19 @@
end
end
unless c["tweeters"].nil?
c["tweeters"].each do |t|
- self.tweeters << t
+ self.tweeters << t unless has_tweeter?(t)
end
end
self
+ end
+
+ def has_tweeter?(tweeter)
+ res = @tweeters.find{|t| t.downcase.strip == tweeter.downcase.strip }
+ res != nil
end
def valid?
@error_message = ""
@error_message += "There should be at least one account" if accounts.size ==0
\ No newline at end of file