Permalink
Browse files

we need the settings on the chat service

  • Loading branch information...
1 parent 85c151e commit 67eb8eb687d39fd513f60e25b8e84da05ff527d4 @flype committed Aug 10, 2012
Showing with 8 additions and 3 deletions.
  1. +1 −1 lib/janky.rb
  2. +7 −2 lib/janky/notifier/chat_service.rb
View
2 lib/janky.rb
@@ -200,7 +200,7 @@ def self.setup(settings)
ChatService.setup(chat_name, chat_settings, chat_room)
active_notifiers = [
- Notifier::ChatService,
+ Notifier::ChatService.new(settings),
Notifier::GithubPullRequestService.new(settings)
]
View
9 lib/janky/notifier/chat_service.rb
@@ -1,7 +1,12 @@
module Janky
module Notifier
class ChatService
- def self.completed(build)
+
+ def initialize(settings)
+ @settings = settings
+ end
+
+ def completed(build)
status = build.green? ? "was successful" : "failed"
color = build.green? ? "green" : "red"
@@ -19,7 +24,7 @@ def self.completed(build)
::Janky::ChatService.speak(message, build.room_id, {:color => color})
end
- def self.base_url
+ def base_url
@settings['JANKY_BASE_URL']
end
end

0 comments on commit 67eb8eb

Please sign in to comment.