Skip to content

Commit

Permalink
validate campfire settings
Browse files Browse the repository at this point in the history
  • Loading branch information
sr committed Feb 10, 2012
1 parent 2f06856 commit 4ce1722
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/janky/chat_service/campfire.rb
Expand Up @@ -2,10 +2,20 @@ module Janky
module ChatService
class Campfire
def initialize(settings)
account = settings["JANKY_CHAT_CAMPFIRE_ACCOUNT"]
if account.nil? || account.empty?
raise Error, "JANKY_CHAT_CAMPFIRE_ACCOUNT setting is required"
end

token = settings["JANKY_CHAT_CAMPFIRE_TOKEN"]
if token.nil? || token.empty?
raise Error, "JANKY_CHAT_CAMPFIRE_TOKEN setting is required"
end

Broach.settings = {
"account" => settings['JANKY_CHAT_CAMPFIRE_ACCOUNT'],
"token" => settings['JANKY_CHAT_CAMPFIRE_TOKEN'],
"use_ssl" => true
"account" => account,
"token" => token,
"use_ssl" => true,
}
end

Expand Down

0 comments on commit 4ce1722

Please sign in to comment.