Skip to content

Commit

Permalink
Teamcity
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgoedjen committed Mar 13, 2013
2 parents 54a24f5 + a100968 commit c065d9f
Show file tree
Hide file tree
Showing 19 changed files with 162 additions and 276 deletions.
24 changes: 21 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
v2.2.1
v2.4.2
======

https://github.com/github/hubot-scripts/compare/v2.4.1...v2.4.2

v2.4.1
======

https://github.com/github/hubot-scripts/compare/v2.2.2...v2.4.1

v2.2.2
======

https://github.com/github/hubot-scripts/compare/v2.2.1...v2.2.2
Expand Down Expand Up @@ -30,42 +40,50 @@ https://github.com/github/hubot-scripts/compare/v2.1.0...v2.1.1

v2.1.0
======

Massive update to every scripts documentation header.

https://github.com/github/hubot-scripts/compare/v2.0.7...v2.1.0


v2.0.6
======
There is a ton of new functionality. The Second laziest changelog entry in a while.

There is a ton of new functionality. The Second laziest changelog entry in
a while.

https://github.com/github/hubot-scripts/compare/v2.0.5...v2.0.6

v2.0.5
======

There is a ton of new functionality. Laziest changelog entry in a while.

https://github.com/github/hubot-scripts/compare/v2.0.4...v2.0.5

v2.0.4
======

There is a ton of new functionality.

https://github.com/github/hubot-scripts/compare/v2.0.3...v2.0.4

v2.0.3
======

* start using `robot.logger` instead of console.log, eases runtime debugging
* remove dependencies in package.json that don't work on node 0.6.0
* require hubot 2.0 explicitly to start using new stuff

v1.1.8
======

* allow people to start tracks - Zach Holman <[email protected]>
* simplify local development - atmos

v1.1.7
======

* urban dictionary definitions - Kevin Traver <[email protected]>
* latest tweet from a user - Kevin Traver <[email protected]>
* bit.ly shortening - Kevin Traver <[email protected]>
Expand All @@ -88,6 +106,7 @@ v1.1.7

v1.1.4
======

* hubot define me - Pete Nicholls <[email protected]>
* google directions support - Zakaria Zajac <[email protected]>
* hubot vanity me fixup - Alex Whitman <[email protected]>
Expand All @@ -104,4 +123,3 @@ v1.0.4
* Add 'hubot google me' - i'm feeling lucky search - Justin Searls<[email protected]>
* Add 'hubot travis me owner/repo' - travis ci status by Erik Michaels-Ober <[email protected]>
* Add 'hubot vanity me' - sort users by twitter followers by Jon Maddox <[email protected]>

2 changes: 1 addition & 1 deletion LICENSE.md → LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2011 GitHub Inc.
Copyright (c) 2013 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
15 changes: 0 additions & 15 deletions Makefile

This file was deleted.

28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@ of all the available scripts.

## Installing

Once you have Hubot installed, you should already have `hubot-scripts` installed.
Check `package.json` to be sure. If that is the case, you update `hubot-scripts.json`
to list any scripts from this repository you want to load. The default
`hubot-scripts.json` looks like:
Once you have Hubot installed, you should already have `hubot-scripts`
installed. Check `package.json` to be sure. If that is the case, you update
`hubot-scripts.json` to list any scripts from this repository you want to load.
The default `hubot-scripts.json` looks like:

["redis-brain.coffee", "tweet.coffee", "shipit.coffee"]

If you update `hubot-scripts` in `package.json`, you will automatically get updates to your scripts listed here.
If you update `hubot-scripts` in `package.json`, you will automatically get
updates to your scripts listed here.

Alternatively, you can copy files from this repository into your `scripts` directory.
Note that you would not get updates from the `hubot-scripts` repository unless you
copy them yourself.
Alternatively, you can copy files from this repository into your `scripts`
directory. Note that you would not get updates from the `hubot-scripts`
repository unless you copy them yourself.

Any third-party dependencies for scripts need the addition of your `package.json`
otherwise a lot of errors will be thrown during the start up of your hubot. You
can find a list of dependencies for a script in the documentation header at the
top of the script.
Any third-party dependencies for scripts need the addition of your
`package.json` otherwise a lot of errors will be thrown during the start up of
your hubot. You can find a list of dependencies for a script in the
documentation header at the top of the script.

Restart your robot, and you're good to go.

Expand All @@ -39,9 +40,6 @@ Want to write your own Hubot script? The best way is to take a look at an
[existing script][example-script] and see how things are set up. Hubot scripts
are written in CoffeeScript, a higher-level implementation of JavaScript.

You'll also want to [add tests][hubot-script-tests] for your script; no one
likes untested code. It makes Hubot sad.

Additionally, it's extremely helpful to add [TomDoc][tomdoc] to the top of each
file. (Check out [an example][example-script-doc]). We'll pull out the commands
from those lines and display them in the generic, robot-wide `hubot help`
Expand Down
6 changes: 0 additions & 6 deletions bin/hubot

This file was deleted.

15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "hubot-scripts",
"version": "2.4.2",

"author": "hubot",
"keywords": "hubot plugin scripts campfire bot robot",

"keywords": ["hubot", "plugin", "scripts", "campfire", "bot", "robot"],
"description": "Allows you to opt in to a variety of scripts",

"licenses": [{
"type": "MIT",
"url": "http://github.com/github/hubot-scripts/raw/master/LICENSE"
Expand All @@ -15,12 +18,6 @@
},

"dependencies": {
"hubot": ">= 2.4.0",
"redis": "0.7.2"
},

"directories": {
"lib": "./src"
},
"engine": "node >= 0.8.x"
"redis": "0.8.2"
}
}
28 changes: 22 additions & 6 deletions src/scripts/factoid.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# ~~<user> <factoid> - Same as ~tell, less typing
# <factoid>? - Same as ~<factiod> except for there is no response if not found
# hubot no, <factoid> is <some phrase, link, whatever> - Replaces the full definition of a factoid
# hubot factoids list - List all factoids
# hubot factoid delete "<factoid>" - delete a factoid
#
# Author:
# arthurkalm
Expand All @@ -29,28 +31,36 @@ class Factoids
add: (key, val) ->
if @cache[key]
"#{key} is already #{@cache[key]}"
else
else
this.setFactoid key, val

append: (key, val) ->
if @cache[key]
@cache[key] = @cache[key] + ", " + val
@robot.brain.data.factoids = @cache
"Ok. #{key} is also #{val} "
else
else
"No factoid for #{key}. It can't also be #{val} if it isn't already something."

setFactoid: (key, val) ->
@cache[key] = val
@robot.brain.data.factoids = @cache
"OK. #{key} is #{val} "

delFactoid: (key) ->
delete @cache[key]
@robot.brain.data.factoids = @cache
"OK. I forgot about #{key}"

niceGet: (key) ->
@cache[key] or "No factoid for #{key}"

get: (key) ->
@cache[key]

list: ->
Object.keys(@cache)

tell: (person, key) ->
factoid = this.get key
if @cache[key]
Expand All @@ -59,11 +69,11 @@ class Factoids
factoid

handleFactoid: (text) ->
if match = /^~(.+) is also (.+)/i.exec text
if match = /^~(.+?) is also (.+)/i.exec text
this.append match[1], match[2]
else if match = /^~(.+) is (.+)/i.exec text
else if match = /^~(.+?) is (.+)/i.exec text
this.add match[1], match[2]
else if match = (/^~tell (.+) about (.+)/i.exec text) or (/^~~(.+) (.+)/.exec text)
else if match = (/^~tell (.+?) about (.+)/i.exec text) or (/^~~(.+) (.+)/.exec text)
this.tell match[1], match[2]
else if match = /^~(.+)/i.exec text
this.niceGet match[1]
Expand All @@ -75,7 +85,7 @@ module.exports = (robot) ->
if match = (/^~tell (.+) about (.+)/i.exec msg.match) or (/^~~(.+) (.+)/.exec msg.match)
msg.send factoids.handleFactoid msg.message.text
else
msg.reply factoids.handleFactoid msg.message.text
msg.reply factoids.handleFactoid msg.message.text

robot.hear /(.+)\?/i, (msg) ->
factoid = factoids.get msg.match[1]
Expand All @@ -84,3 +94,9 @@ module.exports = (robot) ->

robot.respond /no, (.+) is (.+)/i, (msg) ->
msg.reply factoids.setFactoid msg.match[1], msg.match[2]

robot.respond /factoids? list/i, (msg) ->
msg.send factoids.list().join('\n')

robot.respond /factoids? delete "(.*)"$/i, (msg) ->
msg.reply factoids.delFactoid msg.match[1]
18 changes: 9 additions & 9 deletions src/scripts/fogbugz.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ module.exports = (robot) ->
token: env.HUBOT_FOGBUGZ_TOKEN
q: msg.match[1]
cols: "ixBug,sTitle,sStatus,sProject,sArea,sPersonAssignedTo,ixPriority,sPriority,sLatestTextSummary"
.post() (err, res, body) ->
.get() (err, res, body) ->
(new Parser()).parseString body, (err,json) ->
truncate = (text,length=60,suffix="...") ->
if text.length > length then (text.substr(0,length-suffix.length) + suffix) else text
bug = json.cases?.case
bug = json.cases?[0].case[0]
if bug
msg.send "https://#{env.HUBOT_FOGBUGZ_HOST}/?#{bug.ixBug}"
msg.send "https://#{env.HUBOT_FOGBUGZ_HOST}/?#{bug.ixBug[0]}"
details = [
"FogBugz #{bug.ixBug}: #{bug.sTitle}"
" Priority: #{bug.ixPriority} - #{bug.sPriority}"
" Project: #{bug.sProject} (#{bug.sArea})"
" Status: #{bug.sStatus}"
" Assigned To: #{bug.sPersonAssignedTo}"
" Latest Comment: #{truncate bug.sLatestTextSummary}"
"FogBugz #{bug.ixBug[0]}: #{bug.sTitle[0]}"
" Priority: #{bug.ixPriority[0]} - #{bug.sPriority[0]}"
" Project: #{bug.sProject[0]} (#{bug.sArea[0]})"
" Status: #{bug.sStatus[0]}"
" Assigned To: #{bug.sPersonAssignedTo[0]}"
" Latest Comment: #{truncate bug.sLatestTextSummary[0]}"
]
msg.send details.join("\n")
2 changes: 1 addition & 1 deletion src/scripts/team-city-listener.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Author:
# cubanx

Robot = require('hubot').robot()
Robot = require('hubot').Robot

room = process.env.HUBOT_ROOM_TO_RECEIVE_TEAM_CITY_BUILD_RESULTS
unless room
Expand Down
Loading

0 comments on commit c065d9f

Please sign in to comment.