lib/chatterbot/config.rb in chatterbot-0.6.3 vs lib/chatterbot/config.rb in chatterbot-0.6.5
- old
+ new
@@ -106,24 +106,27 @@
else
store_local_config
end
end
+ def update_config_at_exit
+ update_config
+ end
+
#
# update the since_id with either the highest ID of the specified
# tweets, unless it is lower than what we have already
def update_since_id(search)
return if search.nil?
- tmp_id = case
- # Twitter::SearchResults
- when search.respond_to?(:max_id) then search.max_id
+ tmp_id = case search
+ when Twitter::SearchResults then search.max_id
# incoming tweets
- when search.respond_to?(:id) then search.id
+ when Twitter::Tweet then search.id
# an enumeration
- when search.respond_to?(:max) then search.max { |a, b| a.id <=> b.id }.id
+ when Array then search.max { |a, b| a.id <=> b.id }.id
# probably an actual tweet ID at this point,
# otherwise it will fail and return 0
else search
end.to_i