:prompt => "Language",
:key => "core.language",
:type => :enum,
- :items => Dir.new(CONFIG::DATADIR + "/languages").collect {|f|
+ :items => Dir.new(Config::DATADIR + "/languages").collect {|f|
f =~ /\.lang$/ ? f.gsub(/\.lang$/, "") : nil
}.compact
},
# create a new IrcBot with botclass +botclass+
def initialize(botclass)
- unless Config::DATA_DIR && FileTest.directory? Config::DATA_DIR
- puts "no data directory '#{Config::DATA_DIR}' found, did you run install.rb?"
+ unless FileTest.directory? Config::DATADIR
+ puts "no data directory '#{Config::DATADIR}' found, did you run install.rb?"
exit 2
end
puts "Error: file #{botclass} exists but isn't a directory"
exit 2
end
- FileUtils.cp_r Config::DATA_DIR+'/templates', botclass
+ FileUtils.cp_r Config::DATADIR+'/templates', botclass
end
Dir.mkdir("#{botclass}/logs") if(!File.exist?("#{botclass}/logs"))
# load plugins from pre-assigned list of directories
def scan
dirs = Array.new
- dirs << CONFIG::DATADIR + "/plugins"
+ dirs << Config::DATADIR + "/plugins"
dirs += @dirs
dirs.each {|dir|
if(FileTest.directory?(dir))
File.open('rbotconfig.rb', "w") {|f|
f.puts "module Irc"
f.puts " module Config"
- f.puts " DATADIR = '#{config('datadir')}'"
+ f.puts " DATADIR = '#{config('datadir')}/rbot'"
f.puts " end"
f.puts "end"
}