Skip to content

Commit

Permalink
changes from upstream that aren't merged into master...meh
Browse files Browse the repository at this point in the history
  • Loading branch information
gotascii committed Nov 17, 2010
1 parent 64c75cc commit 1499a92
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions lib/cijoe/campfire.rb
Expand Up @@ -15,8 +15,7 @@ def self.activate(project_path)
puts "Can't load Campfire notifier."
puts "Please add the following to your project's .git/config:"
puts "[campfire]"
puts "\tuser = your@campfire.email"
puts "\tpass = passw0rd"
puts "\ttoken = your_api_token"
puts "\tsubdomain = whatever"
puts "\troom = Awesomeness"
puts "\tssl = false"
Expand All @@ -26,16 +25,15 @@ def self.activate(project_path)
def self.config
campfire_config = Config.new('campfire', @project_path)
@config ||= {
:subdomain => campfire_config.subdomain.to_s,
:user => campfire_config.user.to_s,
:pass => campfire_config.pass.to_s,
:room => campfire_config.room.to_s,
:ssl => campfire_config.ssl.to_s.strip == 'true'
:subdomain => Config.campfire.subdomain.to_s,
:token => Config.campfire.token.to_s,
:room => Config.campfire.room.to_s,
:ssl => Config.campfire.ssl.to_s.strip == 'true'
}
end

def self.valid_config?
%w( subdomain user pass room ).all? do |key|
%w( subdomain token room ).all? do |key|
!config[key.intern].empty?
end
end
Expand All @@ -51,8 +49,7 @@ def room
@room ||= begin
config = Campfire.config
campfire = Tinder::Campfire.new(config[:subdomain],
:username => config[:user],
:password => config[:pass],
:token => config[:token],
:ssl => config[:ssl] || false)
campfire.find_room_by_name(config[:room])
end
Expand Down

0 comments on commit 1499a92

Please sign in to comment.