Skip to content

Commit

Permalink
show storage
Browse files Browse the repository at this point in the history
  • Loading branch information
atmos committed Oct 25, 2011
1 parent 1042f6b commit 438c0b4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/hubot/scripts/storage.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Inspect the data in redis easily
#
# show users - Display all users that hubot knows about
# show storage - Display the contents that are persisted in redis
#

Sys = require "sys"

module.exports = (robot) ->
robot.respond /show storage$/i, (msg) ->
output = Sys.inspect(robot.brain.data, false, 4)
msg.send output

robot.respond /show users$/i, (msg) ->
response = ""

for own key, user of robot.brain.data.users
response += "#{user.id} #{user.name}"
response += " <#{user.email_address}>" if user.email_address
response += "\n"

msg.send response

0 comments on commit 438c0b4

Please sign in to comment.