# Purpose: FreeRIDE constant declarations and module inclusion # # $Id: freeride.rb,v 1.1 2002/12/17 04:29:33 richkilmer Exp $ # # Authors: Rich Kilmer # Contributors: # # This file is part of the FreeRIDE project # # This application is free software; you can redistribute it and/or # modify it under the terms of the Ruby license defined in the # COPYING file. # # Copyright (c) 2001 Rich Kilmer. All rights reserved. # require 'freebase/freebase' require 'rbconfig' module FreeRIDE include Config #version information VERSION_MAJOR = 0 VERSION_MINOR = 1 VERSION_RELEASE = 0 ## # Start up FreeRIDE and block until shut down event is received # # dir:: [String] The directory which holds the properties.xml and/or default.xml # def FreeRIDE.startup(dir) #make sure architecture specific directory is in the include path and before #all system standard path $:.unshift(File.join('redist', Config::CONFIG['arch'])) #verify the existence of the supplied directory begin files = Dir.entries(dir) rescue raise "Could not locate directory #{dir}" end #make sure that either properties.yaml exists or default.yaml unless files.include?("properties.yaml") raise "Could not locate default.yaml in #{dir}" unless files.include?("default.yaml") end #This method will not return until FreeRIDE is closed (shut down) FreeBASE::Core.startup("#{dir}/properties.yaml","#{dir}/default.yaml") do |core| #This method will not return until FreeRIDE is closed (shut down) #trap("INT") do # core.bus["/system/shutdown"].call(2) #end end end end if $0==__FILE__ configDir = './config' configDir = ARGV[0] if ARGV.size > 0 FreeRIDE.startup(configDir) end