Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit f6a33c3

Browse files
Merge pull request #1237 from rgbkrk/patch-4
Add documentation header, fix regex
2 parents f3517e8 + 318042f commit f6a33c3

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/scripts/go-for-it.coffee

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# Description:
2+
# Display a random gopher
3+
#
4+
# Dependencies:
5+
# None
6+
#
7+
# Configuration:
8+
# HUBOT_SHIP_EXTRA_GOPHERS # Optional
9+
#
10+
# Commands:
11+
# go for it
12+
# went for it
13+
# going for it
14+
# goes for it
15+
#
16+
# Author:
17+
# dylanegan
18+
119
gophers = [
220
'http://25.media.tumblr.com/tumblr_m6k6iluYFU1qa4vxjo1_500.jpg'
321
'http://www.sixprizes.com/wp-content/uploads/gopher_caddyshack.jpg'
@@ -12,9 +30,9 @@ module.exports = (robot) ->
1230

1331
# Enable a looser regex if environment variable is set
1432
if process.env.HUBOT_SHIP_EXTRA_GOPHERS
15-
regex = /(went|go(ing|es))? for it/i
33+
regex = /(went|go(ing|es)?) for it/i
1634
else
1735
regex = /go for it/i
1836

1937
robot.hear regex, (msg) ->
20-
msg.send msg.random gophers
38+
msg.send msg.random gophers

0 commit comments

Comments
 (0)