RSS

TinyRubyWiki

It is a tiny Wiki Engine, only 6 lines.

E=ENV;U="http://"+E['HTTP_HOST']+E['SCRIPT_NAME'];require 'cgi';M='v';T='t/';S=
'w';V="?v=v;w=";F='e';N=" ";G=CGI.new("html4");C=G[M][0];P=(G[S][0]or'WiKi');(
C==S)?(open(T+P,S)<<G[T][0];G.out({'Location'=>U+V+P}){N}):(t=CGI::escapeHTML(
File.exist?(T+P)?open(T+P).read: (C=F;N));G.out{G.html{(C==F ? P+N+G.form(
'post',U){G.textarea(T){t}+G.hidden(M,S)+G.hidden(S,P)+G.submit}:(P+N+G.a(U+"?
v=e;w="+P){F}+G.pre{t.gsub(/\b(([A-Z][a-z]+){2,})\b/x){G.a(U+V+$1){$1}}}))}})