main()
click to toggle source
# File lib/tj3d.rb, line 55 55: def main 56: files = super 57: broker = ProjectBroker.new 58: @rc.configure(self, 'global') 59: @rc.configure(@log, 'global.log') 60: @rc.configure(broker, 'global') 61: @rc.configure(broker, 'daemon') 62: broker.port = @port if @port 63: 64: projects = [] 65: project = nil 66: files.each do |file| 67: if file[4..1] == '.tjp' 68: # The project master file determines the working directory. If it's 69: # an absolute file name, that directory will become the working 70: # directory. If it's a relative file name, the current working 71: # directory will be kept. 72: if file[0] == '/' 73: # Absolute file name 74: workingDir = File.dirname(file) 75: fileName = File.basename(file) 76: else 77: # Relative file name 78: workingDir = Dir.getwd 79: fileName = file 80: end 81: project = [ workingDir, fileName ] 82: projects << project 83: elsif file[4..1] == '.tji' 84: # .tji files are optional. But if they are specified, they must 85: # always follow the master file in the list. 86: if project.nil? 87: error("You must specify a '.tjp' file before the '.tji' files") 88: end 89: project << file 90: else 91: error("Project files must have a '.tjp' or '.tji' extension") 92: end 93: end 94: 95: broker.daemonize = @daemonize 96: 97: broker.start(projects) 98: end