mod_ruby is a module to embed Ruby interpreter in Apache web server. Some processes are needed to use CGIKit with it.
Using with mod_ruby is experimental.
If you donft save name space of components in mod_ruby, CGIKit applications can affect each other. Then, create subclasses of CKApplication to save the name space.
Create a new file except a startup script and define a subclass of CKApplication in thi file (loaded in the startup script). Change the subclass name along with the application.
class Application < CKApplication end
Next, define each components inside the subclass.
class Application class MainPage < CKComponent ... end end
You can use subclasses of CKApplication but for mod_ruby. If you collect methods related whole of an application into the subclass, you use effectively it because CKApplication objects are shared in each components.
CGIKit communicates with browsers using adapters
. By default, CGI and mod_ruby adapters are selected automatically. If you use customized adapter or adapters donft be selected, specify an adapter for interface
attribute of CKApplication.
#!/usr/local/bin/ruby require ecgikitf require eapplicationf app = Application.new app.interface = CKAdapter::ModRuby app.run