diff --git a/Makefile b/Makefile index f3b53d4c7..000b24286 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,10 @@ dev: generate-js generate-js: @find src -name '*.coffee' | xargs coffee -c -o lib +package: + @bin/hubot -c hubot + @chmod 0755 hubot/bin/hubot + remove-js: @rm -fr lib/ diff --git a/README.md b/README.md index 2959f7099..bc23dda1f 100644 --- a/README.md +++ b/README.md @@ -6,26 +6,21 @@ You'll probably never have to hack on this repo directly. Instead this repo provides a library that's distributed by npm that you simply require in your project. -We provide a generator to help you get a hubot going very quickly. - ## Getting Your Own -Make sure you have [node.js](http://nodejs.org/), [npm](http://npmjs.org/), [redis](http://redis.io/), -and [coffee-script](http://jashkenas.github.com/coffee-script/#installation) installed. Clone this repository, and run these commands: +Make sure you have [node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed. - % npm install -g - % hubot -c ~/my_bot +Download the [latest version of hubot](https://github.com/github/hubot/downloads). -Then follow the instructions in the README in the `~/my_bot` directory. +Then follow the instructions in the README in the `hubot` directory. ## Scripts -Hubot ships with a couple of default scripts, but there's a whole big world out -there in the [hubot-scripts](https://github.com/github/hubot-scripts) -repository. `hubot-scripts` is a way to share scripts with the entire -community. Check out the -[README](https://github.com/github/hubot-scripts#readme) for more help on -installing individual scripts. +Hubot ships with a couple of default scripts, but there's a growing +number of extras in the [hubot-scripts](https://github.com/github/hubot-scripts) +repository. `hubot-scripts` is a way to share scripts with the entire +community. Check out the [README](https://github.com/github/hubot-scripts#readme) +for more help on installing individual scripts. ## Local Testing diff --git a/src/creator.coffee b/src/creator.coffee index 67a4e4a76..576bf8f88 100644 --- a/src/creator.coffee +++ b/src/creator.coffee @@ -47,11 +47,12 @@ class Creator console.log "Creating a hubot install at #{@path}" @mkdirDashP(@path) + @mkdirDashP("#{@path}/bin") @mkdirDashP("#{@path}/scripts") @copyDefaultScripts("#{@path}/scripts") - ["Procfile", "package.json", "README.md", ".gitignore"].forEach (file) => + ["Procfile", "package.json", "README.md", ".gitignore", "bin/hubot"].forEach (file) => @copy "#{@templateDir}/#{file}", "#{@path}/#{file}" exports.Creator = Creator diff --git a/src/robot.coffee b/src/robot.coffee index c776ce70a..8770a0050 100644 --- a/src/robot.coffee +++ b/src/robot.coffee @@ -50,6 +50,7 @@ class Robot else newRegex = new RegExp("^#{@name}:?\\s*#{pattern}", modifiers) + console.log newRegex.toString() @listeners.push new Listener(@, newRegex, callback) # Public: Passes the given message to any interested Listeners. diff --git a/src/templates/README.md b/src/templates/README.md index 99e13e2bb..d6e26b29e 100644 --- a/src/templates/README.md +++ b/src/templates/README.md @@ -11,8 +11,7 @@ Playing with Hubot You'll need to install the necessary dependencies for hubot. All of those dependencies are provided by [npm](http://npmjs.org). - % npm install -g hubot - % hubot + % bin/hubot You'll see some startup output about where your scripts come from. diff --git a/src/templates/bin/hubot b/src/templates/bin/hubot new file mode 100755 index 000000000..e6a096374 --- /dev/null +++ b/src/templates/bin/hubot @@ -0,0 +1,5 @@ +#!/bin/sh + +npm install + +node_modules/.bin/hubot