Permalink
Browse files

Simplifying campfire login code.

  • Loading branch information...
1 parent 5af1724 commit a2cd01d06958a5c57c9e71faa0349eff2f65e0e0 @jqr jqr committed Aug 29, 2008
Showing with 5 additions and 8 deletions.
  1. +5 −8 lib/snitch/services/campfire.rb
@@ -4,14 +4,11 @@ class Snitch
module Services
class Campfire < Service
- def connection(force=false)
- if @campfire.nil? || force
- connection = ::Tinder::Campfire.new(subdomain)
- connection.login(login, password)
- raise ServiceLoginError, "Login to Campfire failed" unless connection.logged_in?
- @campfire = connection.find_or_create_room_by_name(room)
- end
- @campfire
+ def connection
+ connection = ::Tinder::Campfire.new(subdomain)
+ connection.login(login, password)
+ raise ServiceLoginError, "Login to Campfire failed" unless connection.logged_in?
+ connection.find_or_create_room_by_name(room)
end
def tattle(message)

0 comments on commit a2cd01d

Please sign in to comment.