Plz find below a part of the patch I applied to RPAfy instiki 0.9.1;
it contains some RPA-specific stuff, but adapting it should be easy.
If you have rpa-base (http://rpa-base.rubyforge.org) installed,
running instiki becomes really a 2 step process 
(rpa install instiki; instiki.rb)
--- instiki.rb 2004-06-07 17:19:22.000000000 +0200
+++ instiki.rb.new 2004-09-07 10:06:51.000000000 +0200
@@ -6,9 +6,12 @@
end
require 'optparse'
+require 'rpa/defaults'
+require 'rpa'
+RPA.version = "0.0"
-cdir = File.expand_path(File.dirname(__FILE__))
-%w( /libraries/ /app/models /app/controllers ).each { |dir| $:.unshift(cdir + dir) }
+cdir = File.join(RPA::Defaults::PREFIX, RPA::Defaults::SITELIBDIR, "instiki")
+%w( /libraries/ /app/models /app/controllers ).each { |dir| $:.unshift File.join(cdir, dir) }
%w( web_controller_server action_controller_servlet wiki_service wiki ).each { |lib| require lib }
fork_available = true
@@ -23,10 +26,11 @@
OPTIONS = {
:server_type => fork_available ? Daemon : SimpleServer,
:port => 2500,
- :storage => "#{cdir}/storage",
+ :storage => "instiki/storage",
:pdflatex => pdflatex_available
}
路路路
On Tue, Sep 07, 2004 at 03:10:13AM +0900, Phil Tomson wrote:
I downloaded the latest (0.9.1) and installed it under Linux. Then I
tried to access: http://localhost:2500 and I got a message about there not
being a storage/2500 directory (but the server seemed to be running to be
able to give me this message). I then created those directories and it
worked fine - but this is a step 3 that isn't a chuckle 
+
ARGV.options do |opts|
script_name = File.basename($0)
opts.banner = "Usage: ruby #{script_name} [options]"
@@ -41,7 +45,7 @@
) { OPTIONS[:server_type] = SimpleServer }
opts.on("-t", "--storage=storage", String,
"Makes Instiki use the specified directory for storage.",
- "Default: ./storage/[port]") { |OPTIONS[:storage]| }
+ "Default: #{OPTIONS[:storage]}") { |OPTIONS[:storage]| }
opts.separator ""
@@ -52,7 +56,11 @@
end
Socket.do_not_reverse_lookup = true
-WikiService.storage_path = OPTIONS[:storage] + "/" + OPTIONS[:port].to_s
+require 'fileutils'
+FileUtils.mkdir_p OPTIONS[:storage]
+WikiService.storage_path = File.join(Dir.pwd, OPTIONS[:storage],
+ OPTIONS[:port])
WikiController.template_root = "#{cdir}/app/views/"
+WikiController.const_set("EXPORT_DIRECTORY", File.join(Dir.pwd, OPTIONS[:storage]) + "/")
-WebControllerServer.new(OPTIONS[:port], OPTIONS[:server_type], "#{cdir}/app/controllers/")
\ No newline at end of file
+WebControllerServer.new(OPTIONS[:port], OPTIONS[:server_type], "#{cdir}/app/controllers/")
--
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com