#!/usr/lib/ruby # To convert from a webrick based Iowa application to, for example, an # apache/mod_ruby based one, on the Iowa side all one need to is change the # require below to require 'iowa'. require 'iowa_webrick' class MyApplication < Iowa::Application attr_accessor :mapfile def initialize(*args) ##### #// Initialize the application with appwide things, such as a database #// connection pool, data sets for the use of the whole appliation, session #// caching adjustments, etc.... ##### #// If using the connection pool, make sure to require the class at the #// top of the script The example below also assumes that one wants to #// make use of Kansas for object-relational-mapping. # #@dbpool = Iowa::DbPool.new('Mysql','localhost','DATABASE','USERID','PASSWORD',NUMBER_OF_CONNECTIONS,300) {|dbh| # ksdbh = KSDatabase.new(dbh) # begin # @@ks_done_init # rescue NameError # @@ks_done_init = true # ksdbh.map_all_tables # end # ksdbh #} @@cachedSessions = 1000 @mapfile = 'mapfile.cnf' super end end Iowa.startDaemon('webrick_demo.cnf') Iowa.run