Changeset 18

Show
Ignore:
Timestamp:
01/04/08 17:42:09 (9 months ago)
Author:
muness
Message:

switch to yaml because of the wierd way ccrb does plugins

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • incubator/cc_campfire_notifier/campfire_notifier.rb

    r17 r18  
    77  end 
    88 
    9   cattr_accessor :settings 
     9  def self.settings 
     10    YAML.load_file(File.join(RAILS_ROOT, "config", "campfire_notifier.yml")) rescue nil 
     11  end 
     12   
    1013  def settings 
    1114    CampfireNotifier.settings 
    1215  end 
     16   
    1317  def room 
    1418    return if room_name.nil? 
    1519    logger.debug("Campfire Notifier configured with #{settings.inspect}") 
    16     campfire = Tinder::Campfire.new(settings[:subdomain], :ssl => settings[:use_ssl]) 
    17     campfire.login settings[:login], settings[:password
    18     logger.debug("Logged in to campfire #{settings[:subdomain]} as #{settings[:login]}") 
     20    campfire = Tinder::Campfire.new(settings["subdomain"], :ssl => settings["use_ssl"]) 
     21    campfire.login settings["login"], settings["password"
     22    logger.debug("Logged in to campfire #{settings['subdomain']} as #{settings['login']}") 
    1923    campfire.find_room_by_name(room_name) 
    2024  rescue => e 
    21     logger.event("Trouble initalizing campfire room #{room_name}", :error
     25    logger.error("Trouble initalizing campfire room #{room_name}"
    2226    raise 
    2327  end 
  • incubator/cc_campfire_notifier/test/campfire_notifier_test.rb

    r17 r18  
    2929 end 
    3030 it "delegates settings to the class variable settings" do 
    31    CampfireNotifier.settings = settings = stub 
     31   CampfireNotifier.stubs(:settings).returns(settings = stub) 
    3232   CampfireNotifier.new.settings.should == settings 
    3333 end