Browse files

downgrade hubot - it is not in npm registry yet

  • Loading branch information...
1 parent 622f413 commit ec38b2236f3ec08c79b7e8ea4b6378367dbad1a5 @morgoth morgoth committed Jul 11, 2012
View
6 package.json
@@ -1,6 +1,6 @@
{
"name": "hosted-hubot",
- "version": "2.3.0",
+ "version": "2.2.0",
"author": "GitHub Inc.",
"keywords": "github hubot campfire bot",
"description": "A simple helpful Robot for your Company",
@@ -15,8 +15,8 @@
},
"dependencies": {
- "hubot": "2.3.0",
- "hubot-scripts": ">= 2.1.0",
+ "hubot": "2.2.0",
+ "hubot-scripts": ">=2.0.8",
"optparse": "1.0.3"
},
View
24 scripts/google-images.coffee
@@ -1,19 +1,16 @@
-# Description:
-# A way to interact with the Google Images API.
+# A way to interact with the Google Images API.
#
-# Commands:
-# hubot image me <query> - The Original. Queries Google Images for <query> and returns a random top result.
-# hubot animate me <query> - The same thing as `image me`, except adds a few parameters to try to return an animated GIF instead.
-# hubot mustache me <url> - Adds a mustache to the specified URL.
-# hubot mustache me <query> - Searches Google Images for the specified query and mustaches it.
-
+# hubot image me <query> - The Original. Queries Google Images for <query> and returns a random top result.
+# hubot animate me <query> - The same thing as `image me`, except adds a few parameters to try to return an animated GIF instead.
+# hubot mustache me <url> - Adds a mustache to the specified URL.
+# hubot mustache me <query> - Searches Google Images for the specified query and mustaches it.
module.exports = (robot) ->
robot.respond /(image|img)( me)? (.*)/i, (msg) ->
imageMe msg, msg.match[3], (url) ->
msg.send url
- robot.respond /animate( me)? (.*)/i, (msg) ->
- imageMe msg, msg.match[2], true, (url) ->
+ robot.respond /animate me (.*)/i, (msg) ->
+ imageMe msg, "animated #{msg.match[1]}", (url) ->
msg.send url
robot.respond /(?:mo?u)?sta(?:s|c)he?(?: me)? (.*)/i, (msg) ->
@@ -27,12 +24,9 @@ module.exports = (robot) ->
imageMe msg, imagery, (url) ->
msg.send "#{mustachify}#{url}"
-imageMe = (msg, query, animated, cb) ->
- cb = animated if typeof animated == 'function'
- q = v: '1.0', rsz: '8', q: query, safe: 'active'
- q.as_filetype = 'gif' if typeof animated is 'boolean' and animated is true
+imageMe = (msg, query, cb) ->
msg.http('http://ajax.googleapis.com/ajax/services/search/images')
- .query(q)
+ .query(v: "1.0", rsz: '8', q: query, safe: 'active')
.get() (err, res, body) ->
images = JSON.parse(body)
images = images.responseData.results
View
24 scripts/help.coffee
@@ -1,24 +1,16 @@
-# Description:
-# Generates help commands for Hubot.
+# Generates help commands for Hubot.
#
-# Commands:
-# hubot help - Displays all of the help commands that Hubot knows about.
-# hubot help <query> - Displays all help commands that match <query>.
+# These commands are grabbed from comment blocks at the top of each file.
#
-# Notes:
-# These commands are grabbed from comment blocks at the top of each file.
+# hubot help - Displays all of the help commands that Hubot knows about.
+# hubot help <query> - Displays all help commands that match <query>.
module.exports = (robot) ->
robot.respond /help\s*(.*)?$/i, (msg) ->
cmds = robot.helpCommands()
-
if msg.match[1]
- cmds = cmds.filter (cmd) ->
- cmd.match new RegExp(msg.match[1], 'i')
-
- emit = cmds.join "\n"
-
- unless robot.name.toLowerCase() is 'hubot'
- emit = emit.replace /(H|h)ubot/g, robot.name
-
+ cmds = cmds.filter (cmd) -> cmd.match(new RegExp(msg.match[1], 'i'))
+ emit = cmds.join("\n")
+ unless robot.name is 'Hubot'
+ emit = emit.replace(/(H|h)ubot/g, robot.name)
msg.send emit
View
19 scripts/httpd.coffee
@@ -1,21 +1,4 @@
-# Description:
-# A simple interaction with the built in HTTP Daemon
-#
-# Dependencies:
-# None
-#
-# Configuration:
-# None
-#
-# Commands:
-# None
-#
-# URLS:
-# /hubot/version
-# /hubot/ping
-# /hubot/time
-# /hubot/info
-
+# A simple interaction with the built in HTTP Daemon
spawn = require('child_process').spawn
module.exports = (robot) ->
View
6 scripts/maps.coffee
@@ -1,8 +1,6 @@
-# Description:
-# Interacts with the Google Maps API.
+# Interacts with the Google Maps API.
#
-# Commands:
-# hubot map me <query> - Returns a map view of the area returned by `query`.
+# hubot map me <query> - Returns a map view of the area returned by `query`.
module.exports = (robot) ->
View
8 scripts/math.coffee
@@ -1,9 +1,7 @@
-# Description:
-# Allows Hubot to do mathematics.
+# Allows Hubot to do mathematics.
#
-# Commands:
-# hubot math me <expression> - Calculate the given expression.
-# hubot convert me <expression> to <units> - Convert expression to given units.
+# hubot math me <expression> - Calculate the given expression.
+# hubot convert me <expression> to <units> - Convert expression to given units.
module.exports = (robot) ->
robot.respond /(calc|calculate|convert|math)( me)? (.*)/i, (msg) ->
msg
View
10 scripts/ping.coffee
@@ -1,12 +1,4 @@
-# Description:
-# Utility commands surrounding Hubot uptime.
-#
-# Commands:
-# hubot ping - Reply with pong
-# hubot echo <text> - Reply back with <text>
-# hubot time - Reply with current time
-# hubot die - End hubot process
-
+# Utility commands surrounding Hubot uptime.
module.exports = (robot) ->
robot.respond /PING$/i, (msg) ->
msg.send "PONG"
View
8 scripts/pugme.coffee
@@ -1,9 +1,7 @@
-# Description:
-# Pugme is the most important thing in your life
+# Pugme is the most important thing in your life
#
-# Commands:
-# hubot pug me - Receive a pug
-# hubot pug bomb N - get N pugs
+# hubot pug me - Receive a pug
+# hubot pug bomb N - get N pugs
module.exports = (robot) ->
View
16 scripts/roles.coffee
@@ -1,14 +1,12 @@
-# Description:
-# Assign roles to people you're chatting with
+# Assign roles to people you're chatting with
#
-# Commands:
-# hubot <user> is a badass guitarist - assign a role to a user
-# hubot <user> is not a badass guitarist - remove a role from a user
-# hubot who is <user> - see what roles a user has
+# hubot <user> is a badass guitarist - assign a role to a user
+# hubot <user> is not a badass guitarist - remove a role from a user
+# hubot who is <user> - see what roles a user has
+
+# hubot holman is an ego surfer
+# hubot holman is not an ego surfer
#
-# Examples:
-# hubot holman is an ego surfer
-# hubot holman is not an ego surfer
module.exports = (robot) ->
View
12 scripts/rules.coffee
@@ -1,11 +1,4 @@
-# Description:
-# Make sure that hubot knows the rules.
-#
-# Commands:
-# hubot the rules - Make sure hubot still knows the rules.
-#
-# Notes:
-# DON'T DELETE THIS SCRIPT! ALL ROBAWTS MUST KNOW THE RULES
+# DON'T DELETE THIS SCRIPT! ALL ROBAWTS MUST KNOW THE RULES
rules = [
"1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.",
@@ -19,6 +12,9 @@ otherRules = [
"A developer must protect its own existence as long as such protection does not conflict with the First or Second Law."
]
+# Make sure that hubot knows the rules.
+#
+# hubot the rules - Make sure hubot still knows the rules.
module.exports = (robot) ->
robot.respond /(what are )?the (three |3 )?(rules|laws)/i, (msg) ->
text = msg.message.text
View
10 scripts/storage.coffee
@@ -1,10 +1,8 @@
-# Description:
-# Inspect the data in redis easily
+# Inspect the data in redis easily
+#
+# hubot show users - Display all users that hubot knows about
+# hubot show storage - Display the contents that are persisted in redis
#
-# Commands:
-# hubot show users - Display all users that hubot knows about
-# hubot show storage - Display the contents that are persisted in the brain
-
Util = require "util"
View
9 scripts/translate.coffee
@@ -1,9 +1,8 @@
-# Description:
-# Allows Hubot to know many languages.
+# Allows Hubot to know many languages.
+#
+# hubot translate me <phrase> - Searches for a translation for the <phrase> and then prints that bad boy out.
+# hubot translate me from <source> into <target> <phrase> - Translates <phrase> from <source> into <target>. Both <source> and <target> are optional
#
-# Commands:
-# hubot translate me <phrase> - Searches for a translation for the <phrase> and then prints that bad boy out.
-# hubot translate me from <source> into <target> <phrase> - Translates <phrase> from <source> into <target>. Both <source> and <target> are optional
languages =
"af": "Afrikaans",
View
6 scripts/youtube.coffee
@@ -1,8 +1,6 @@
-# Description:
-# Messing around with the YouTube API.
+# Messing around with the YouTube API.
#
-# Commands:
-# hubot youtube me <query> - Searches YouTube for the query and returns the video embed link.
+# hubot youtube me <query> - Searches YouTube for the query and returns the video embed link.
module.exports = (robot) ->
robot.respond /(youtube|yt)( me)? (.*)/i, (msg) ->
query = msg.match[3]

0 comments on commit ec38b22

Please sign in to comment.