Browse files

deprecate JANKY_CAMPFIRE_ACCOUNT and JANKY_CAMPFIRE_TOKEN

  • Loading branch information...
1 parent 2306108 commit 88e12bc6f55b7fd3277efbdf00979837afca8ed3 @sr sr committed Jan 3, 2012
Showing with 15 additions and 1 deletion.
  1. +15 −1 lib/janky.rb
View
16 lib/janky.rb
@@ -139,6 +139,20 @@ def self.setup(settings)
Janky::Exception.setup(Janky::Exception::Logger.new($stderr))
+ if campfire_account = settings["JANKY_CAMPFIRE_ACCOUNT"]
+ warn "JANKY_CAMPFIRE_ACCOUNT is deprecated. Please use " \
+ "JANKY_CHAT_CAMPFIRE_ACCOUNT instead."
+ settings["JANKY_CHAT_CAMPFIRE_ACCOUNT"] ||=
+ settings["JANKY_CAMPFIRE_ACCOUNT"]
+ end
+
+ if campfire_token = settings["JANKY_CAMPFIRE_TOKEN"]
+ warn "JANKY_CAMPFIRE_TOKEN is deprecated. Please use " \
+ "JANKY_CHAT_CAMPFIRE_TOKEN instead."
+ settings["JANKY_CHAT_CAMPFIRE_ACCOUNT"] ||=
+ settings["JANKY_CAMPFIRE_ACCOUNT"]
+ end
+
chat_name = settings["JANKY_CHAT"] || "campfire"
chat_settings = {}
settings.each do |key, value|
@@ -150,7 +164,7 @@ def self.setup(settings)
settings["JANKY_CAMPFIRE_DEFAULT_ROOM"]
if settings["JANKY_CAMPFIRE_DEFAULT_ROOM"]
warn "JANKY_CAMPFIRE_DEFAULT_ROOM is deprecated. Please use " \
- "JANKY_CHAT_DEFAULT_ROOM instead"
+ "JANKY_CHAT_DEFAULT_ROOM instead."
end
Chat.setup(chat_name, chat_settings, chat_room)

0 comments on commit 88e12bc

Please sign in to comment.