Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

show storage

  • Loading branch information...
commit 438c0b4b268f0c86278a918a344a31de90e65f77 1 parent 1042f6b
@atmos atmos authored
Showing with 22 additions and 0 deletions.
  1. +22 −0 src/hubot/scripts/storage.coffee
View
22 src/hubot/scripts/storage.coffee
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.