問題
hubot@2.9.0 で src/scripts が削除された。
hubot ping は hubot img は hubot die はどこへ行ってしまったのか。また使えるようにするにはどうすれば良いのか。
解決策
generator-hubot を使った際に生成されるプロジェクトを参考に、npm install せよ。
generator-hubot は yeoman のジェネレーターである。hubot@2.9.1 で削除された hubot --create の代替手段。従来のテンプレートに近いものは、これを使えば生成できる。
$ sudo npm install -g yo generator-hubot
$ mkdir myhubot
$ cd myhubot/
$ yo hubot
理想では……。実際には 0.1.0, 0.1.1 は npm publish に失敗しているらしく、npm install -g generator-hubot では、まともに動かない。git clone git://github.com/github/generator-hubot.git して npm install するなどすれば動かせるが、面倒なので、詳しくは説明しない。
以前の標準スクリプトは package.json の dependencies に追加された上で、external-scripts.json で参照されている。github/hubot-scripts が hubot-scripts/* という Org に移行された時点で予想できた自体だが、今後は Hubot スクリプト開発の標準的なスタイルになるだろう。
補足情報
補足情報というか最も重要な情報なのだが、各スクリプトのゆくえをメモする。
リポジトリ名がわかれば、 npm install して external-scripts.json に加えるだけなので、なんとかなるだろうから。
hubot@2.8.3 の src/scripts の Hubot スクリプト。
| hubot@2.8.3 | コマンド | 
|---|---|
| events.coffee | fake event | 
| google-images.coffee | image me / animate me / mustache me | 
| help.coffee | help | 
| httpd.coffee | (/hubot/ping での待ち受けなど) | 
| maps.coffee | map me | 
| ping.coffee | ping / adapter / echo / time / die | 
| pugme.coffee | pug me / pug bomb | 
| roles.coffee | |
| rules.coffee | the rules | 
| storage.coffee | show storage / show users | 
| translate.coffee | translate me | 
| youtube.coffee | youtube me | 
generator-hubot@0.1.0 で追加される Hubot スクリプト。
| hubot@2.9.0 | コマンド | 備考 | 
|---|---|---|
| hubot-diagnostics | ping / adapter / echo / time | die がなくなっている! | 
| hubot-google-images | image me / animate me / mustache me | |
| hubot-google-translate | translate me | |
| hubot-help | help | |
| hubot-heroku-keepalive | HUBOT_HEROKU_URL の代替 | |
| hubot-maps | map me | |
| hubot-pugme | pug me / pug bomb | |
| hubot-redis-brain | 以前は hubot-scripts.json に入っていた。 | |
| hubot-rules | the rules | |
| hubot-shipit | 以前は hubot-scripts.json に入っていた。 | |
| hubot-youtube | youtube me | 
まとめ
hubot die は死んだ。