Permalink
Browse files

Fixing up config file reading.

  • Loading branch information...
1 parent be259f1 commit 041fd44e440ad57ea9055d07f2a12df148d2b34a @wilkie wilkie committed Feb 5, 2012
Showing with 4 additions and 2 deletions.
  1. +1 −1 config/config.yml.example
  2. +3 −1 lib/xombot.rb
View
2 config/config.yml.example
@@ -1,5 +1,5 @@
server: irc.freenode.org
port: 6697
name: XOmBot-test
-channels: [#XOmBot]
+channels: ["#XOmBot"]
ssl: true
View
4 lib/xombot.rb
@@ -48,13 +48,15 @@ def start
if not File.exists?("#{config_path}/config.yml")
FileUtils.cp("#{config_path}/config.yml.example", "#{config_path}/config.yml")
end
- config = YAML.load('../config/config.yml')
+ config = YAML.load(File.open("#{config_path}/config.yml"))
+ puts config
name = config["name"] || NAME
server = config["server"] || SERVER
port = config["port"] || PORT
ssl = (config["ssl"] == "true") || SSL
channels = config["channels"] || CHANNELS
+ puts channels
bot = Cinch::Bot.new do
configure do |c|

0 comments on commit 041fd44

Please sign in to comment.