Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
technicalpickles committed Mar 13, 2015
2 parents 360eb25 + a350eab commit ed66e45
Show file tree
Hide file tree
Showing 17 changed files with 167 additions and 78 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
node_modules
.hubot_history
15 changes: 15 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,18 @@
v2.11.4
=======

* Fix shell adapter parsing history on node 0.8 (ie don't include newlines)

v2.11.3
=======

* Fix issues around shell adapter throwing errors when there isn't a .hubot_history file

v2.11.2
=======

* Add support for namespaced alternative environment variables for controlling the port and address express binds to (EXPRESS_PORT and EXPRESS_BIND_ADDRESS).

v2.11.1
=======

Expand Down
2 changes: 1 addition & 1 deletion LICENSE → LICENSE.md
@@ -1,4 +1,4 @@
Copyright (c) 2013 GitHub Inc.
Copyright (c) 2011-2015 GitHub Inc.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
5 changes: 2 additions & 3 deletions README.md
Expand Up @@ -7,13 +7,12 @@ cool. He's extendable with
scripts, and can work on [many different chat services](docs/adapters.md).

This repository provides a library that's distributed by `npm` that you
use for building your own bots. See the [docs/README.md](docs/README.md)
use for building your own bots. See the [documentation](http://hubot.github.com/docs)
for details on getting up and running with your very own robot friend.

In most cases, you'll probably never have to hack on this repo directly if you
are building your own bot. But if you do, check out [CONTRIBUTING.md](CONTRIBUTING.md)

## License

Copyright (c) 2011-2014 GitHub, Inc. See the LICENSE file for license rights and
limitations (MIT).
See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).
9 changes: 6 additions & 3 deletions docs/adapters.md
@@ -1,13 +1,16 @@
# Hubot Adapters
---
permalink: /docs/adapters/index.html
layout: docs
---

Adapters are the interface to the service you want your hubot to run on.

## Official Adapters

Hubot includes two official adapters:

* [Shell](adapters/shell.md), i.e. for use with development
* [Campfire](adapters/campfire.md)
* [Shell](/docs/adapters/shell/), i.e. for use with development
* [Campfire](/docs/adapters/campfire/)

## Third-party Adapters

Expand Down
7 changes: 5 additions & 2 deletions docs/adapters/campfire.md
@@ -1,4 +1,7 @@
# Adapter: Campfire
---
permalink: /docs/adapters/campfire/index.html
layout: docs
---

[Campfire](http://campfirenow.com/) is a web based chat application built by
[37signals](http://37signals.com). The Campfire adapter is one of the original
Expand All @@ -13,7 +16,7 @@ Next, you will need to create a user on your Campfire account for your Hubot,
then give it access so it can join to your rooms. You will need to create a room
if you haven't already.

Hubot defaults to using its [shell](shell.md), so to use Campfire instead, you
Hubot defaults to using its [shell](/docs/adapters/shell/), so to use Campfire instead, you
can run hubot with `-a campfire`:

% bin/hubot -a campfire
Expand Down
5 changes: 4 additions & 1 deletion docs/adapters/shell.md
@@ -1,4 +1,7 @@
# Adapters: Shell
---
permalink: /docs/adapters/shell/index.html
layout: docs
---

The shell adapter provides a simple read-eval-print loop for interacting with a hubot locally.
It can be useful for testing scripts before using them on a live hubot.
Expand Down
8 changes: 8 additions & 0 deletions docs/deploying.md
@@ -0,0 +1,8 @@
---
permalink: /docs/deploying/index.html
layout: docs
---

- [Heroku](/docs/deploying/heroku/)
- [Unix](/docs/deploying/unix/)
- [Windows](/docs/deploying/windows/)
9 changes: 6 additions & 3 deletions docs/deploying/heroku.md
@@ -1,4 +1,7 @@
# Deploying Hubot to Heroku
---
permalink: /docs/deploying/heroku/index.html
layout: docs
---

If you've been following along with [Getting Started](../README.md), it's time to deploy so you can use it beyond just your local machine.
[Heroku](http://www.heroku.com/) is an easy and supported way to deploy hubot.
Expand Down Expand Up @@ -29,7 +32,7 @@ Then create a Heroku application:

Before you deploy the application, you'll need to configure some environment
variables for hubot to use. The specific variables you'll need depends on which
[adapter](../adapters.md) and scripts you are using. For Campfire, with no other
[adapter](/docs/adapters/) and scripts you are using. For Campfire, with no other
scripts, you'd need to set the following environment variables:

% heroku config:set HUBOT_CAMPFIRE_ACCOUNT=yourcampfireaccount
Expand All @@ -39,7 +42,7 @@ scripts, you'd need to set the following environment variables:
In addition, there is one special environment variable for Heroku. The default hubot
[Procfile](https://devcenter.heroku.com/articles/procfile) marks the process as
a 'web' process type, in order to support serving http requests (more on that
in the [scripting docs](../scripting.md)). The downside of this is that dynos
in the [scripting docs](/docs/scripting/)). The downside of this is that dynos
will [idle after an hour of inactivity](https://devcenter.heroku.com/articles/dynos#dyno-idling).
That means your hubot would leave after an hour of idle web traffic, and only rejoin when it does get traffic. This is extremely
inconvenient since most interaction is done through chat, and hubot has to be online and in the room to respond to messages. To get around this,
Expand Down
5 changes: 4 additions & 1 deletion docs/deploying/unix.md
@@ -1,4 +1,7 @@
# Deploying Hubot to UNIX
---
permalink: /docs/deploying/unix/index.html
layout: docs
---

Because there are so many variations of Linux, and more generally UNIX, it's
difficult for the hubot team to have canonical documentation for installing and
Expand Down
7 changes: 5 additions & 2 deletions docs/deploying/windows.md
@@ -1,4 +1,7 @@
# Deploying Hubot to Windows
---
permalink: /docs/deploying/windows/index.html
layout: docs
---

Hasn't been fully tested - YMMV

Expand Down Expand Up @@ -32,4 +35,4 @@ You can run this command from your git checkout on the server, but there are som

## Expanding the documentation

Not yet fleshed out. [Help contribute by submitting a pull request, please?](https://github.com/github/hubot/pull/new/master)
Not yet fleshed out. [Help contribute by submitting a pull request, please?](https://github.com/github/hubot/pull/new/master)
20 changes: 12 additions & 8 deletions docs/README.md → docs/index.md
@@ -1,4 +1,8 @@
# Hubot
---
title: Hubot
permalink: /docs/index.html
layout: docs
---

## Getting Started With Hubot

Expand All @@ -19,7 +23,7 @@ we wanted to make a bot called myhubot:
% yo hubot

At this point, you'll be asked a few questions about who is creating the bot,
and which [adapter](adapters.md) you'll be using. Adapters are hubot's way of
and which [adapter](/docs/adapters/) you'll be using. Adapters are hubot's way of
integrating with different chat providers.

If you are using git, the generated directory includes a .gitignore, so you can
Expand Down Expand Up @@ -50,7 +54,7 @@ Hubot needs Redis to persist data, so before you can start hubot on your own com
% bin/hubot
Hubot>

This starts hubot using the [shell adapter](adapters/shell.md), which
This starts hubot using the [shell adapter](/docs/adapters/shell/), which
is mostly useful for development. Make note of `Hubot>`; this is the name your hubot will
`respond` to with commands. For example, to list available commands:

Expand Down Expand Up @@ -118,18 +122,18 @@ name as a double quoted string to the `external-scripts.json` file in this repo.

## Adapters

Hubot uses the adapter pattern to support multiple chat-backends. Read available adapters in [docs/adapters.md](adapters.md), along with how to configure them.
Hubot uses the adapter pattern to support multiple chat-backends. Here is a [list of available adaptesr](/docs/adapters/), along with details on how to configure them.

## Deploying

You can deploy hubot to Heroku, which is the officially supported method.
Additionally you are able to deploy hubot to a UNIX-like system or Windows.
Please note the support for deploying to Windows isn't officially supported.

* [Deploying Hubot onto Heroku](deploying/heroku.md)
* [Deploying Hubot onto UNIX](deploying/unix.md)
* [Deploying Hubot onto Windows](deploying/windows.md)
* [Deploying Hubot onto Heroku](/docs/deploying/heroku/)
* [Deploying Hubot onto UNIX](/docs/deploying/unix/)
* [Deploying Hubot onto Windows](/docs/deploying/windows/)

## Patterns

Using custom scripts, you can quickly customize Hubot to be the most life embettering robot he or she can be. Read [docs/patterns.md](patterns.md) for some nifty tricks that may come in handy as you teach your hubot new skills.
Using custom scripts, you can quickly customize Hubot to be the most life embettering robot he or she can be. Read [docs/patterns.md](/docs/patterns/) for some nifty tricks that may come in handy as you teach your hubot new skills.
7 changes: 5 additions & 2 deletions docs/patterns.md
@@ -1,4 +1,7 @@
# Patterns
---
permalink: /docs/patterns/index.html
layout: docs
---

Shared patterns for dealing with common Hubot scenarios.

Expand All @@ -11,7 +14,7 @@ When you rename Hubot, he will no longer respond to his former name. In order to

Setting this up is very easy:

1. Create a [bundled script](scripting.md) in the `scripts/` directory of your Hubot instance called `rename-hubot.coffee`
1. Create a [bundled script](/docs/scripting/) in the `scripts/` directory of your Hubot instance called `rename-hubot.coffee`
2. Add the following code, modified for your needs:

```coffeescript
Expand Down
11 changes: 8 additions & 3 deletions docs/scripting.md
@@ -1,4 +1,7 @@
# Scripting
---
permalink: /docs/scripting/index.html
layout: docs
---

Hubot out of the box doesn't do too much, but it is an extensible, scriptable robot friend.

Expand Down Expand Up @@ -102,7 +105,7 @@ It wouldn't be called for:

## Send & reply

The `msg` parameter is, despite the name, an instance of [Response](../src/response.coffee). With it, you can `send` a message back to the room the `msg` came from, `emote` a message to a room (If the given adapter supports it), or `reply` to the person that sent the message. For example:
The `msg` parameter is, despite the name, an instance of `Response`. With it, you can `send` a message back to the room the `msg` came from, `emote` a message to a room (If the given adapter supports it), or `reply` to the person that sent the message. For example:

```coffeescript
module.exports = (robot) ->
Expand Down Expand Up @@ -418,7 +421,7 @@ module.exports = (robot) ->

## HTTP Listener

Hubot includes support for the [express](http://expressjs.com/guide.html) web framework to serve up HTTP requests. It listens on the port specified by the `PORT` environment variable, and defaults to 8080. An instance of an express application is available at `robot.router`. It can be protected with username and password by specifying `EXPRESS_USER` and `EXPRESS_PASSWORD`. It can automatically serve static files by setting `EXPRESS_STATIC`.
Hubot includes support for the [express](http://expressjs.com/guide.html) web framework to serve up HTTP requests. It listens on the port specified by the `EXPRESS_PORT` or `PORT` environment variables (preferred in that order) and defaults to 8080. An instance of an express application is available at `robot.router`. It can be protected with username and password by specifying `EXPRESS_USER` and `EXPRESS_PASSWORD`. It can automatically serve static files by setting `EXPRESS_STATIC`.

The most common use of this is for providing HTTP end points for services with webhooks to push to, and have those show up in chat.

Expand All @@ -435,6 +438,8 @@ module.exports = (robot) ->
res.send 'OK'
```

All endpoint URLs should start with the literal string `/hubot` (regardless of what your robot's name is). This consistency makes it easier to set up webhooks (copy-pasteable URL) and guarantees that URLs are valid (not all bot names are URL-safe).

## Events

Hubot can also respond to events which can be used to pass data between scripts. This is done by encapsulating node.js's [EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter) with `robot.emit` and `robot.on`.
Expand Down
13 changes: 6 additions & 7 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "hubot",
"version": "2.11.1",
"version": "2.11.4",
"author": "hubot",
"keywords": [
"github",
Expand All @@ -21,21 +21,20 @@
},
"dependencies": {
"async": ">=0.1.0 <1.0.0",
"chalk": "^1.0.0",
"cline": "^0.8.2",
"coffee-script": "1.6.3",
"optparse": "1.0.4",
"scoped-http-client": "0.10.0",
"log": "1.4.0",
"express": "3.18.1",
"readline-history": "~1.2.0"
"log": "1.4.0",
"optparse": "1.0.4",
"scoped-http-client": "0.10.0"
},

"devDependencies": {
"hubot-mock-adapter": "^1.0.0",
"mocha": "^2.1.0",
"mockery": "^1.4.0",
"sinon-chai": "^2.6.0"
},

"engines": {
"node": ">= 0.8.x",
"npm": ">= 1.1.x"
Expand Down

0 comments on commit ed66e45

Please sign in to comment.