Permalink
Browse files

Merge pull request #26 from jsmestad/patch-1

Fix missing require, working hipchat support.
  • Loading branch information...
2 parents a2ec586 + f98caad commit 473815903dc1facfebe95f712392e8a45d0cf7d0 @sr sr committed Jan 27, 2012
Showing with 15 additions and 15 deletions.
  1. +1 −2 lib/janky.rb
  2. +2 −2 lib/janky/chat/campfire.rb
  3. +3 −3 lib/janky/chat/hipchat.rb
  4. +7 −7 lib/janky/hubot.rb
  5. +2 −1 lib/janky/notifier/chat.rb
View
@@ -38,7 +38,6 @@
require "janky/chat/campfire"
require "janky/chat/hipchat"
require "janky/chat/mock"
-require "janky/chat/room"
require "janky/exception"
require "janky/notifier"
require "janky/notifier/chat"
@@ -156,7 +155,7 @@ def self.setup(settings)
chat_name = settings["JANKY_CHAT"] || "campfire"
chat_settings = {}
settings.each do |key, value|
- if key =~ /^JANKY_CHAT_#{chat_name}_/
+ if key =~ /^JANKY_CHAT_#{chat_name}_/i
chat_settings[key] = value
end
end
@@ -3,8 +3,8 @@ module Chat
class Campfire
def initialize(settings)
Broach.settings = {
- "account" => settings['JANKY_CAMPFIRE_ACCOUNT'],
- "token" => settings['JANKY_CAMPFIRE_TOKEN'],
+ "account" => settings['JANKY_CHAT_CAMPFIRE_ACCOUNT'],
+ "token" => settings['JANKY_CHAT_CAMPFIRE_TOKEN'],
"use_ssl" => true
}
end
@@ -2,12 +2,12 @@ module Janky
module Chat
class HipChat
def initialize(settings)
- @client = ::HipChat::Client.new(settings["JANKY_HIPCHAT_TOKEN"])
- @from = settings["JANKY_HIPCHAT_FROM"] || "CI"
+ @client = ::HipChat::Client.new(settings["JANKY_CHAT_HIPCHAT_TOKEN"])
+ @from = settings["JANKY_CHAT_HIPCHAT_FROM"] || "CI"
end
def speak(message, room_id, options = {:color => "yellow"})
- @client[room_id].send(from, message, options[:color])
+ @client[room_id].send(@from, message, options)
end
def rooms
View
@@ -35,7 +35,7 @@ class Hubot < Sinatra::Base
repo = find_repo(repo_name)
branch = repo.branch_for(branch_name)
build = branch.current_build
- room_id = params["room_id"] && Integer(params["room_id"])
+ room_id = params["room_id"] && Integer(params["room_id"]) rescue nil
if build
build.rerun(room_id)
@@ -105,12 +105,12 @@ class Hubot < Sinatra::Base
get "/help" do
content_type "text/plain"
<<-EOS
-hubot ci build janky
-hubot ci build janky/fix-everything
-hubot ci setup github/janky [name]
-hubot ci toggle janky
-hubot ci rooms
-hubot ci set room janky The Danger Room
+ci build janky
+ci build janky/fix-everything
+ci setup github/janky [name]
+ci toggle janky
+ci rooms
+ci set room janky development
EOS
end
end
@@ -5,13 +5,14 @@ def self.completed(build)
status = build.green? ? "was successful" : "failed"
color = build.green? ? "green" : "red"
- message = "Build #%s (%s) of %s/%s %s (%ss) %s" % [
+ message = "Build #%s (%s) of %s/%s %s (%ss) <a href='%s'>%s</a>" % [
build.number,
build.sha1,
build.repo_name,
build.branch_name,
status,
build.duration,
+ build.compare,
build.compare
]

0 comments on commit 4738159

Please sign in to comment.